File tree Expand file tree Collapse file tree 6 files changed +7
-34
lines changed
src/goto-instrument/contracts/dynamic-frames Expand file tree Collapse file tree 6 files changed +7
-34
lines changed Original file line number Diff line number Diff line change @@ -360,7 +360,8 @@ void dfcc_libraryt::load(std::set<irep_idt> &to_instrument)
360
360
inline_functions ();
361
361
362
362
// 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 ();
364
365
}
365
366
366
367
optionalt<dfcc_funt> dfcc_libraryt::get_dfcc_fun (const irep_idt &id) const
@@ -512,14 +513,6 @@ void dfcc_libraryt::inhibit_front_end_builtins()
512
513
}
513
514
}
514
515
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
-
523
516
const symbolt &dfcc_libraryt::get_instrumented_functions_map_symbol ()
524
517
{
525
518
const irep_idt map_name = " __dfcc_instrumented_functions" ;
Original file line number Diff line number Diff line change @@ -250,9 +250,6 @@ class dfcc_libraryt
250
250
// / implementation.
251
251
void inhibit_front_end_builtins ();
252
252
253
- // / Sets the given hide flag on all instructions of all library functions
254
- void set_hide (bool hide);
255
-
256
253
// / Adds "checked" pragmas to instructions of all library functions
257
254
// / instructions. By default checks are not disabled.
258
255
void disable_checks ();
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ void dfcc_spec_functionst::generate_havoc_function(
136
136
not_enough_arguments.empty (),
137
137
" not enough arguments when inlining " + id2string (havoc_function_id));
138
138
139
- utils. set_hide (havoc_function_id, true );
139
+ goto_model. goto_functions . function_map . at (havoc_function_id). make_hidden ( );
140
140
141
141
goto_model.goto_functions .update ();
142
142
}
@@ -278,7 +278,7 @@ void dfcc_spec_functionst::to_spec_assigns_function(
278
278
INVARIANT (
279
279
function_pointer_contracts.empty (),
280
280
" discovered function pointer contracts unexpectedly" );
281
- utils. set_hide (function_id, true );
281
+ goto_model. goto_functions . function_map . at (function_id). make_hidden ( );
282
282
}
283
283
284
284
void dfcc_spec_functionst::to_spec_assigns_instructions (
@@ -367,8 +367,7 @@ void dfcc_spec_functionst::to_spec_frees_function(
367
367
INVARIANT (
368
368
function_pointer_contracts.empty (),
369
369
" 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 ();
372
371
}
373
372
374
373
void dfcc_spec_functionst::to_spec_frees_instructions (
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ void dfcc_swap_and_wrapt::check_contract(
267
267
// extend the signature of the wrapper function with the write set parameter
268
268
utils.add_parameter (write_set_symbol, function_id);
269
269
270
- utils. set_hide (wrapper_id, true );
270
+ goto_model. goto_functions . function_map . at (wrapper_id). make_hidden ( );
271
271
272
272
// instrument the wrapped function
273
273
instrument.instrument_wrapped_function (
@@ -305,7 +305,7 @@ void dfcc_swap_and_wrapt::replace_with_contract(
305
305
body.add (goto_programt::make_end_function (
306
306
utils.get_function_symbol (wrapper_id).location ));
307
307
308
- utils. set_hide (wrapper_id, true );
308
+ goto_model. goto_functions . function_map . at (wrapper_id). make_hidden ( );
309
309
310
310
// write the body to the GOTO function
311
311
goto_model.goto_functions .function_map .at (function_id).body .swap (body);
Original file line number Diff line number Diff line change @@ -564,18 +564,6 @@ bool dfcc_utilst::has_no_loops(const irep_idt &function_id)
564
564
goto_model.goto_functions .function_map .at (function_id).body );
565
565
}
566
566
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
-
579
567
void dfcc_utilst::inhibit_unused_functions (const irep_idt &start)
580
568
{
581
569
PRECONDITION_WITH_DIAGNOSTICS (false , " not yet implemented" );
Original file line number Diff line number Diff line change @@ -230,10 +230,6 @@ class dfcc_utilst
230
230
// / \returns True iff \p goto_program is loop free.
231
231
bool has_no_loops (const goto_programt &goto_program);
232
232
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
-
237
233
// / \brief Traverses the call tree from the given entry point to identify
238
234
// / functions symbols that are effectively called in the model,
239
235
// / Then goes over all functions of the model and turns the bodies of all
You can’t perform that action at this time.
0 commit comments