Skip to content

Commit b1abd41

Browse files
authored
Merge pull request #7681 from tautschnig/cleanup/remove-dfcc-set_hide
Replace DFCC's set_hide by call to make_hidden
2 parents f39a5c1 + 492b06f commit b1abd41

File tree

6 files changed

+7
-34
lines changed

6 files changed

+7
-34
lines changed

src/goto-instrument/contracts/dynamic-frames/dfcc_library.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ void dfcc_libraryt::load(std::set<irep_idt> &to_instrument)
360360
inline_functions();
361361

362362
// hide all instructions in counter example traces
363-
set_hide(true);
363+
for(auto it : dfcc_fun_symbol)
364+
goto_model.goto_functions.function_map.at(it.second.name).make_hidden();
364365
}
365366

366367
optionalt<dfcc_funt> dfcc_libraryt::get_dfcc_fun(const irep_idt &id) const
@@ -512,14 +513,6 @@ void dfcc_libraryt::inhibit_front_end_builtins()
512513
}
513514
}
514515

515-
/// Sets the given hide flag on all instructions of all library functions
516-
void dfcc_libraryt::set_hide(bool hide)
517-
{
518-
PRECONDITION(dfcc_libraryt::loaded);
519-
for(auto it : dfcc_fun_symbol)
520-
utils.set_hide(it.second.name, hide);
521-
}
522-
523516
const symbolt &dfcc_libraryt::get_instrumented_functions_map_symbol()
524517
{
525518
const irep_idt map_name = "__dfcc_instrumented_functions";

src/goto-instrument/contracts/dynamic-frames/dfcc_library.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ class dfcc_libraryt
250250
/// implementation.
251251
void inhibit_front_end_builtins();
252252

253-
/// Sets the given hide flag on all instructions of all library functions
254-
void set_hide(bool hide);
255-
256253
/// Adds "checked" pragmas to instructions of all library functions
257254
/// instructions. By default checks are not disabled.
258255
void disable_checks();

src/goto-instrument/contracts/dynamic-frames/dfcc_spec_functions.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void dfcc_spec_functionst::generate_havoc_function(
136136
not_enough_arguments.empty(),
137137
"not enough arguments when inlining " + id2string(havoc_function_id));
138138

139-
utils.set_hide(havoc_function_id, true);
139+
goto_model.goto_functions.function_map.at(havoc_function_id).make_hidden();
140140

141141
goto_model.goto_functions.update();
142142
}
@@ -278,7 +278,7 @@ void dfcc_spec_functionst::to_spec_assigns_function(
278278
INVARIANT(
279279
function_pointer_contracts.empty(),
280280
"discovered function pointer contracts unexpectedly");
281-
utils.set_hide(function_id, true);
281+
goto_model.goto_functions.function_map.at(function_id).make_hidden();
282282
}
283283

284284
void dfcc_spec_functionst::to_spec_assigns_instructions(
@@ -367,8 +367,7 @@ void dfcc_spec_functionst::to_spec_frees_function(
367367
INVARIANT(
368368
function_pointer_contracts.empty(),
369369
"discovered function pointer contracts unexpectedly");
370-
371-
utils.set_hide(function_id, true);
370+
goto_model.goto_functions.function_map.at(function_id).make_hidden();
372371
}
373372

374373
void dfcc_spec_functionst::to_spec_frees_instructions(

src/goto-instrument/contracts/dynamic-frames/dfcc_swap_and_wrap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ void dfcc_swap_and_wrapt::check_contract(
267267
// extend the signature of the wrapper function with the write set parameter
268268
utils.add_parameter(write_set_symbol, function_id);
269269

270-
utils.set_hide(wrapper_id, true);
270+
goto_model.goto_functions.function_map.at(wrapper_id).make_hidden();
271271

272272
// instrument the wrapped function
273273
instrument.instrument_wrapped_function(
@@ -305,7 +305,7 @@ void dfcc_swap_and_wrapt::replace_with_contract(
305305
body.add(goto_programt::make_end_function(
306306
utils.get_function_symbol(wrapper_id).location));
307307

308-
utils.set_hide(wrapper_id, true);
308+
goto_model.goto_functions.function_map.at(wrapper_id).make_hidden();
309309

310310
// write the body to the GOTO function
311311
goto_model.goto_functions.function_map.at(function_id).body.swap(body);

src/goto-instrument/contracts/dynamic-frames/dfcc_utils.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -564,18 +564,6 @@ bool dfcc_utilst::has_no_loops(const irep_idt &function_id)
564564
goto_model.goto_functions.function_map.at(function_id).body);
565565
}
566566

567-
void dfcc_utilst::set_hide(const irep_idt &function_id, bool hide)
568-
{
569-
auto &goto_function = goto_model.goto_functions.function_map.at(function_id);
570-
if(goto_function.body_available())
571-
{
572-
Forall_goto_program_instructions(inst, goto_function.body)
573-
{
574-
inst->source_location_nonconst().set(ID_hide, hide);
575-
}
576-
}
577-
}
578-
579567
void dfcc_utilst::inhibit_unused_functions(const irep_idt &start)
580568
{
581569
PRECONDITION_WITH_DIAGNOSTICS(false, "not yet implemented");

src/goto-instrument/contracts/dynamic-frames/dfcc_utils.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,6 @@ class dfcc_utilst
230230
/// \returns True iff \p goto_program is loop free.
231231
bool has_no_loops(const goto_programt &goto_program);
232232

233-
/// \brief Sets the given hide flag on all instructions of the function if it
234-
/// exists.
235-
void set_hide(const irep_idt &function_id, bool hide);
236-
237233
/// \brief Traverses the call tree from the given entry point to identify
238234
/// functions symbols that are effectively called in the model,
239235
/// Then goes over all functions of the model and turns the bodies of all

0 commit comments

Comments
 (0)