Skip to content

Commit

Permalink
Add support for function-local analysis to goto-analyser
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-cs committed Feb 2, 2024
1 parent 6a5c9b9 commit 8761de4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/goto-analyzer/build_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ std::unique_ptr<ai_baset> build_analyzer(
// These support all of the option categories
if(
options.get_bool_option("recursive-interprocedural") ||
options.get_bool_option("three-way-merge"))
options.get_bool_option("three-way-merge") ||
options.get_bool_option("local") ||)
{
// Build the history factory
std::unique_ptr<ai_history_factory_baset> hf = nullptr;
Expand Down Expand Up @@ -111,6 +112,11 @@ std::unique_ptr<ai_baset> build_analyzer(
std::move(hf), std::move(df), std::move(st), mh);
}
}
else if(options.get_bool_option("local"))
{
return util_make_unique<ai_localt>(
std::move(hf), std::move(df), std::move(st), mh);
}
}
}
else if(options.get_bool_option("legacy-ait"))
Expand Down
3 changes: 3 additions & 0 deletions src/goto-analyzer/goto_analyzer_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
options.set_option("recursive-interprocedural", true);
else if(cmdline.isset("three-way-merge"))
options.set_option("three-way-merge", true);
else if(cmdline.isset("local"))
options.set_option("local", true);
else if(cmdline.isset("legacy-ait") || cmdline.isset("location-sensitive"))
{
options.set_option("legacy-ait", true);
Expand Down Expand Up @@ -758,6 +760,7 @@ void goto_analyzer_parse_optionst::help()
" reasoning\n"
" {y--three-way-merge} \t use VSD's three-way merge on return from function"
" call\n"
" {y--local} \t perform function-local analysis for every function\n"
" {y--legacy-concurrent} \t legacy-ait with an extended fixed-point for"
" concurrency\n"
" {y--location-sensitive} \t use location-sensitive abstract interpreter\n"
Expand Down
3 changes: 2 additions & 1 deletion src/goto-analyzer/goto_analyzer_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ class optionst;
"(recursive-interprocedural)" \
"(three-way-merge)" \
"(legacy-ait)" \
"(legacy-concurrent)"
"(legacy-concurrent)" \
"(local)"

#define GOTO_ANALYSER_OPTIONS_HISTORY \
"(ahistorical)" \
Expand Down

0 comments on commit 8761de4

Please sign in to comment.