Skip to content

Commit 8761de4

Browse files
committed
Add support for function-local analysis to goto-analyser
1 parent 6a5c9b9 commit 8761de4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/goto-analyzer/build_analyzer.cpp

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

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
225225
options.set_option("recursive-interprocedural", true);
226226
else if(cmdline.isset("three-way-merge"))
227227
options.set_option("three-way-merge", true);
228+
else if(cmdline.isset("local"))
229+
options.set_option("local", true);
228230
else if(cmdline.isset("legacy-ait") || cmdline.isset("location-sensitive"))
229231
{
230232
options.set_option("legacy-ait", true);
@@ -758,6 +760,7 @@ void goto_analyzer_parse_optionst::help()
758760
" reasoning\n"
759761
" {y--three-way-merge} \t use VSD's three-way merge on return from function"
760762
" call\n"
763+
" {y--local} \t perform function-local analysis for every function\n"
761764
" {y--legacy-concurrent} \t legacy-ait with an extended fixed-point for"
762765
" concurrency\n"
763766
" {y--location-sensitive} \t use location-sensitive abstract interpreter\n"

src/goto-analyzer/goto_analyzer_parse_options.h

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

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

0 commit comments

Comments
 (0)