23
23
24
24
#include < goto-programs/class_hierarchy.h>
25
25
#include < goto-programs/goto_convert_functions.h>
26
+ #include < goto-programs/remove_calls_no_body.h>
26
27
#include < goto-programs/remove_function_pointers.h>
27
28
#include < goto-programs/remove_virtual_functions.h>
28
29
#include < goto-programs/remove_exceptions.h>
@@ -729,6 +730,10 @@ int goto_instrument_parse_optionst::doit()
729
730
status () << " Performing full inlining" << eom;
730
731
goto_inline (goto_model, get_message_handler ());
731
732
733
+ status () << " Removing calls to functions without a body" << eom;
734
+ remove_calls_no_bodyt remove_calls_no_body;
735
+ remove_calls_no_body (goto_model.goto_functions );
736
+
732
737
status () << " Accelerating" << eom;
733
738
accelerate_functions (
734
739
goto_model, get_message_handler (), cmdline.isset (" z3" ));
@@ -992,7 +997,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
992
997
// now do full inlining, if requested
993
998
if (cmdline.isset (" inline" ))
994
999
{
995
- do_indirect_call_and_rtti_removal ();
1000
+ do_indirect_call_and_rtti_removal (true );
996
1001
997
1002
if (cmdline.isset (" show-custom-bitvector-analysis" ) ||
998
1003
cmdline.isset (" custom-bitvector-analysis" ))
@@ -1003,7 +1008,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
1003
1008
}
1004
1009
1005
1010
status () << " Performing full inlining" << eom;
1006
- goto_inline (goto_model, get_message_handler ());
1011
+ goto_inline (goto_model, get_message_handler (), true );
1007
1012
}
1008
1013
1009
1014
if (cmdline.isset (" show-custom-bitvector-analysis" ) ||
@@ -1111,27 +1116,23 @@ void goto_instrument_parse_optionst::instrument_goto_program()
1111
1116
if (cmdline.isset (" partial-inline" ))
1112
1117
{
1113
1118
do_indirect_call_and_rtti_removal ();
1114
- do_partial_inlining ();
1119
+
1120
+ status () << " Partial inlining" << eom;
1121
+ goto_partial_inline (goto_model, ui_message_handler, 0 , true );
1115
1122
1116
1123
goto_model.goto_functions .update ();
1117
1124
goto_model.goto_functions .compute_loop_numbers ();
1118
1125
}
1119
1126
1120
- // now do full inlining, if requested
1121
- if (cmdline.isset (" inline" ))
1127
+ if (cmdline.isset (" remove-calls-no-body" ))
1122
1128
{
1123
- do_indirect_call_and_rtti_removal ( /* force= */ true ) ;
1129
+ status () << " Removing calls to functions without a body " << eom ;
1124
1130
1125
- if (cmdline.isset (" show-custom-bitvector-analysis" ) ||
1126
- cmdline.isset (" custom-bitvector-analysis" ))
1127
- {
1128
- do_remove_returns ();
1129
- thread_exit_instrumentation (goto_model);
1130
- mutex_init_instrumentation (goto_model);
1131
- }
1131
+ remove_calls_no_bodyt remove_calls_no_body;
1132
+ remove_calls_no_body (goto_model.goto_functions );
1132
1133
1133
- status () << " Performing full inlining " << eom ;
1134
- goto_inline ( goto_model, get_message_handler (), true );
1134
+ goto_model. goto_functions . update () ;
1135
+ goto_model. goto_functions . compute_loop_numbers ( );
1135
1136
}
1136
1137
1137
1138
if (cmdline.isset (" constant-propagator" ))
@@ -1560,6 +1561,7 @@ void goto_instrument_parse_optionst::help()
1560
1561
" --no-caching disable caching of intermediate results during transitive function inlining\n " // NOLINT(*)
1561
1562
" --log <file> log in json format which code segments were inlined, use with --function-inline\n " // NOLINT(*)
1562
1563
" --remove-function-pointers replace function pointers by case statement over function calls\n " // NOLINT(*)
1564
+ HELP_REMOVE_CALLS_NO_BODY
1563
1565
HELP_REMOVE_CONST_FUNCTION_POINTERS
1564
1566
" --add-library add models of C library functions\n "
1565
1567
" --model-argc-argv <n> model up to <n> command line arguments\n "
0 commit comments