Skip to content

Commit 83a5c00

Browse files
author
martin
committed
Add support for function-local analysis to goto-analyser
1 parent f86d17b commit 83a5c00

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/goto-analyzer/build_analyzer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ std::unique_ptr<ai_baset> build_analyzer(
4040
// These support all of the option categories
4141
if(
4242
options.get_bool_option("recursive-interprocedural") ||
43-
options.get_bool_option("three-way-merge"))
43+
options.get_bool_option("three-way-merge") ||
44+
options.get_bool_option("local") ||)
4445
{
4546
// Build the history factory
4647
std::unique_ptr<ai_history_factory_baset> hf = nullptr;
@@ -112,6 +113,11 @@ std::unique_ptr<ai_baset> build_analyzer(
112113
std::move(hf), std::move(df), std::move(st), mh);
113114
}
114115
}
116+
else if(options.get_bool_option("local"))
117+
{
118+
return util_make_unique<ai_localt>(
119+
std::move(hf), std::move(df), std::move(st), mh);
120+
}
115121
}
116122
}
117123
else if(options.get_bool_option("legacy-ait"))

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
195195
options.set_option("recursive-interprocedural", true);
196196
else if(cmdline.isset("three-way-merge"))
197197
options.set_option("three-way-merge", true);
198+
else if(cmdline.isset("local"))
199+
options.set_option("local", true);
198200
else if(cmdline.isset("legacy-ait") || cmdline.isset("location-sensitive"))
199201
{
200202
options.set_option("legacy-ait", true);
@@ -710,6 +712,8 @@ void goto_analyzer_parse_optionst::help()
710712
// NOLINTNEXTLINE(whitespace/line_length)
711713
" --three-way-merge use VSD's three-way merge on return from function call\n"
712714
// NOLINTNEXTLINE(whitespace/line_length)
715+
" --local perform function-local analysis for every function\n"
716+
// NOLINTNEXTLINE(whitespace/line_length)
713717
" --legacy-ait recursion for function and one domain per location\n"
714718
// NOLINTNEXTLINE(whitespace/line_length)
715719
" --legacy-concurrent legacy-ait with an extended fixed-point for concurrency\n"

src/goto-analyzer/goto_analyzer_parse_options.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ class optionst;
116116
"(recursive-interprocedural)" \
117117
"(three-way-merge)" \
118118
"(legacy-ait)" \
119-
"(legacy-concurrent)"
119+
"(legacy-concurrent)" \
120+
"(local)"
120121

121122
#define GOTO_ANALYSER_OPTIONS_HISTORY \
122123
"(ahistorical)" \

0 commit comments

Comments
 (0)