Skip to content

Commit 1f663d2

Browse files
committed
Remove undefined-function-is-assume-false from goto-instrument
Users can like-for-like replace such use with `--generate-function-body '.*' --generate-function-body-options assume-false`. Fixes: #2070
1 parent 4fe3ade commit 1f663d2

File tree

5 files changed

+0
-48
lines changed

5 files changed

+0
-48
lines changed

doc/man/goto-instrument.1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,6 @@ prepends a call to \fIcallee\fR in the body of \fIcaller\fR
414414
instruments checks to assert that all call
415415
sequences match \fIseq\fR
416416
.TP
417-
\fB\-\-undefined\-function\-is\-assume\-false\fR
418-
convert each call to an undefined function to assume(false)
419-
.TP
420417
\fB\-\-insert\-final\-assert\-false\fR \fIfunction\fR
421418
generate assert(false) at end of \fIfunction\fR
422419
.TP

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -911,12 +911,6 @@ int goto_instrument_parse_optionst::doit()
911911
remove_unused_functions(goto_model.goto_functions, ui_message_handler);
912912
}
913913

914-
if(cmdline.isset("undefined-function-is-assume-false"))
915-
{
916-
do_indirect_call_and_rtti_removal();
917-
undefined_function_abort_path(goto_model);
918-
}
919-
920914
// write new binary?
921915
if(cmdline.args.size()==2)
922916
{
@@ -1959,8 +1953,6 @@ void goto_instrument_parse_optionst::help()
19591953
" the body of {ucaller}\n"
19601954
" {y--check-call-sequence} {useq} \t instruments checks to assert that all"
19611955
" call sequences match {useq}\n"
1962-
" {y--undefined-function-is-assume-false} \t convert each call to an"
1963-
" undefined function to assume(false)\n"
19641956
HELP_INSERT_FINAL_ASSERT_FALSE
19651957
HELP_REPLACE_FUNCTION_BODY
19661958
HELP_RESTRICT_FUNCTION_POINTER

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ Author: Daniel Kroening, [email protected]
109109
"(" FLAG_ENFORCE_CONTRACT "):" \
110110
OPT_ENFORCE_CONTRACT_REC \
111111
"(show-threaded)(list-calls-args)" \
112-
"(undefined-function-is-assume-false)" \
113112
"(remove-function-body):" \
114113
"(remove-function-body-regex):" \
115114
OPT_AGGRESSIVE_SLICER \

src/goto-instrument/undefined_functions.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,3 @@ void list_undefined_functions(
3131
os << gf_entry.first << '\n';
3232
}
3333
}
34-
35-
void undefined_function_abort_path(goto_modelt &goto_model)
36-
{
37-
for(auto &gf_entry : goto_model.goto_functions.function_map)
38-
{
39-
for(auto &ins : gf_entry.second.body.instructions)
40-
{
41-
if(!ins.is_function_call())
42-
continue;
43-
44-
const auto &function = ins.call_function();
45-
46-
if(function.id() != ID_symbol)
47-
continue;
48-
49-
const irep_idt &function_identifier =
50-
to_symbol_expr(function).get_identifier();
51-
52-
goto_functionst::function_mapt::const_iterator entry =
53-
goto_model.goto_functions.function_map.find(function_identifier);
54-
DATA_INVARIANT(
55-
entry!=goto_model.goto_functions.function_map.end(),
56-
"called function must be in function_map");
57-
58-
if(entry->second.body_available())
59-
continue;
60-
61-
source_locationt annotated_location = ins.source_location();
62-
annotated_location.set_comment(
63-
"'" + id2string(function_identifier) + "' is undefined");
64-
ins = goto_programt::make_assumption(false_exprt(), annotated_location);
65-
}
66-
}
67-
}

src/goto-instrument/undefined_functions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,4 @@ void list_undefined_functions(
2222
const goto_modelt &,
2323
std::ostream &);
2424

25-
void undefined_function_abort_path(goto_modelt &);
26-
2725
#endif

0 commit comments

Comments
 (0)