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 committed Jun 15, 2022
1 parent c6a4ee9 commit df6b17f
Show file tree
Hide file tree
Showing 3 changed files with 13 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 @@ -40,7 +40,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 @@ -112,6 +113,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
4 changes: 4 additions & 0 deletions src/goto-analyzer/goto_analyzer_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,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 @@ -715,6 +717,8 @@ void goto_analyzer_parse_optionst::help()
// NOLINTNEXTLINE(whitespace/line_length)
" --three-way-merge use VSD's three-way merge on return from function call\n"
// NOLINTNEXTLINE(whitespace/line_length)
" --local perform function-local analysis for every function\n"
// NOLINTNEXTLINE(whitespace/line_length)
" --legacy-ait recursion for function and one domain per location\n"
// NOLINTNEXTLINE(whitespace/line_length)
" --legacy-concurrent legacy-ait with an extended fixed-point for concurrency\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 @@ -115,7 +115,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 df6b17f

Please sign in to comment.