Skip to content

Commit 0cba79c

Browse files
author
martin
committed
Add support for function-local analysis to goto-analyser
1 parent e487991 commit 0cba79c

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
@@ -192,6 +192,8 @@ void goto_analyzer_parse_optionst::get_command_line_options(optionst &options)
192192
options.set_option("recursive-interprocedural", true);
193193
else if(cmdline.isset("three-way-merge"))
194194
options.set_option("three-way-merge", true);
195+
else if(cmdline.isset("local"))
196+
options.set_option("local", true);
195197
else if(cmdline.isset("legacy-ait") || cmdline.isset("location-sensitive"))
196198
{
197199
options.set_option("legacy-ait", true);
@@ -717,6 +719,8 @@ void goto_analyzer_parse_optionst::help()
717719
// NOLINTNEXTLINE(whitespace/line_length)
718720
" --three-way-merge use VSD's three-way merge on return from function call\n"
719721
// NOLINTNEXTLINE(whitespace/line_length)
722+
" --local perform function-local analysis for every function\n"
723+
// NOLINTNEXTLINE(whitespace/line_length)
720724
" --legacy-concurrent legacy-ait with an extended fixed-point for concurrency\n"
721725
// NOLINTNEXTLINE(whitespace/line_length)
722726
" --location-sensitive 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
@@ -115,7 +115,8 @@ class optionst;
115115
"(recursive-interprocedural)" \
116116
"(three-way-merge)" \
117117
"(legacy-ait)" \
118-
"(legacy-concurrent)"
118+
"(legacy-concurrent)" \
119+
"(local)"
119120

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

0 commit comments

Comments
 (0)