Skip to content

Commit 4ccdcd5

Browse files
authored
Merge pull request #7684 from tautschnig/cleanup/remove-inhibit_unused_functions
Remove dfcc_utilst::inhibit_unused_functions
2 parents 31dfa3e + 5b99a6f commit 4ccdcd5

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,21 @@ void dfcct::transform_goto_model()
513513
instrument_other_functions();
514514
library.inhibit_front_end_builtins();
515515

516-
// TODO implement and use utils.inhibit_unreachable_functions(harness);
516+
// TODO implement a means to inhibit unreachable functions (possibly via the
517+
// code that implements drop-unused-functions followed by
518+
// generate-function-bodies):
519+
// Traverse the call tree from the given entry point to identify
520+
// functions symbols that are effectively called in the model,
521+
// Then goes over all functions of the model and turns the bodies of all
522+
// functions that are not in the used function set into:
523+
// ```c
524+
// assert(false, "function identified as unreachable");
525+
// assume(false);
526+
// ```
527+
// That way, if the analysis mistakenly pruned some functions, assertions
528+
// will be violated and the analysis will fail.
529+
// TODO: add a command line flag to tell the instrumentation to not prune
530+
// a function.
517531
goto_model.goto_functions.update();
518532

519533
remove_skip(goto_model);

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,3 @@ void dfcc_utilst::inline_program(
552552
decorated.get_not_enough_arguments_set().end());
553553
goto_model.goto_functions.update();
554554
}
555-
556-
void dfcc_utilst::inhibit_unused_functions(const irep_idt &start)
557-
{
558-
PRECONDITION_WITH_DIAGNOSTICS(false, "not yet implemented");
559-
}

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -223,21 +223,6 @@ class dfcc_utilst
223223
std::set<irep_idt> &recursive_call,
224224
std::set<irep_idt> &missing_function,
225225
std::set<irep_idt> &not_enough_arguments);
226-
227-
/// \brief Traverses the call tree from the given entry point to identify
228-
/// functions symbols that are effectively called in the model,
229-
/// Then goes over all functions of the model and turns the bodies of all
230-
/// functions that are not in the used function set into:
231-
/// ```c
232-
/// assert(false, "function identified as unreachable");
233-
/// assume(false);
234-
/// ```
235-
/// That way, if the analysis mistakenly pruned some functions, assertions
236-
/// will be violated and the analysis will fail.
237-
/// TODO: add a command line flag to tell the instrumentation to not prune
238-
/// a function.
239-
/// \param start name of the entry point
240-
void inhibit_unused_functions(const irep_idt &start);
241226
};
242227

243228
#endif

0 commit comments

Comments
 (0)