@@ -681,7 +681,8 @@ void goto_instrument_parse_optionst::do_function_pointer_removal()
681
681
function_pointer_removal_done=true ;
682
682
683
683
status () << " Function Pointer Removal" << eom;
684
- remove_function_pointers (symbol_table, goto_functions, false );
684
+ remove_function_pointers (
685
+ symbol_table, goto_functions, cmdline.isset (" pointer-check" ));
685
686
}
686
687
687
688
/* ******************************************************************\
@@ -834,13 +835,28 @@ void goto_instrument_parse_optionst::instrument_goto_program()
834
835
835
836
namespacet ns (symbol_table);
836
837
838
+ // now do full inlining, if requested
839
+ if (cmdline.isset (" inline" ))
840
+ {
841
+ do_function_pointer_removal ();
842
+
843
+ if (cmdline.isset (" show-custom-bitvector-analysis" ) ||
844
+ cmdline.isset (" custom-bitvector-analysis" ))
845
+ {
846
+ do_remove_returns ();
847
+ thread_exit_instrumentation (goto_functions);
848
+ mutex_init_instrumentation (symbol_table, goto_functions);
849
+ }
850
+
851
+ status () << " Performing full inlining" << eom;
852
+ goto_inline (goto_functions, ns, ui_message_handler);
853
+ }
854
+
837
855
if (cmdline.isset (" show-custom-bitvector-analysis" ) ||
838
856
cmdline.isset (" custom-bitvector-analysis" ))
839
857
{
840
- partial_inlining_done=true ;
841
- status () << " Partial Inlining" << eom;
842
- const namespacet ns (symbol_table);
843
- goto_partial_inline (goto_functions, ns, ui_message_handler);
858
+ do_partial_inlining ();
859
+
844
860
status () << " Propagating Constants" << eom;
845
861
constant_propagator_ait constant_propagator_ai (goto_functions, ns);
846
862
remove_skip (goto_functions);
@@ -853,8 +869,6 @@ void goto_instrument_parse_optionst::instrument_goto_program()
853
869
do_remove_returns ();
854
870
parameter_assignments (symbol_table, goto_functions);
855
871
856
- namespacet ns (symbol_table);
857
-
858
872
// recalculate numbers, etc.
859
873
goto_functions.update ();
860
874
@@ -877,31 +891,14 @@ void goto_instrument_parse_optionst::instrument_goto_program()
877
891
code_contracts (symbol_table, goto_functions);
878
892
}
879
893
880
- // now do full inlining, if requested
881
- if (cmdline.isset (" inline" ))
882
- {
883
- status () << " Function Pointer Removal" << eom;
884
- remove_function_pointers (
885
- symbol_table, goto_functions, cmdline.isset (" pointer-check" ));
886
-
887
- if (cmdline.isset (" show-custom-bitvector-analysis" ) ||
888
- cmdline.isset (" custom-bitvector-analysis" ))
889
- {
890
- do_remove_returns ();
891
- thread_exit_instrumentation (goto_functions);
892
- mutex_init_instrumentation (symbol_table, goto_functions);
893
- }
894
-
895
- status () << " Performing full inlining" << eom;
896
- goto_inline (goto_functions, ns, ui_message_handler);
897
- }
894
+ // replace function pointers, if explicitly requested
895
+ if (cmdline.isset (" remove-function-pointers" ))
896
+ do_function_pointer_removal ();
898
897
899
898
if (cmdline.isset (" constant-propagator" ))
900
899
{
901
900
do_function_pointer_removal ();
902
901
903
- namespacet ns (symbol_table);
904
-
905
902
status () << " Propagating Constants" << eom;
906
903
907
904
constant_propagator_ait constant_propagator_ai (goto_functions, ns);
@@ -950,16 +947,9 @@ void goto_instrument_parse_optionst::instrument_goto_program()
950
947
cmdline.isset (" isr" ) ||
951
948
cmdline.isset (" concurrency" ))
952
949
{
953
- if (!cmdline.isset (" inline" ))
954
- {
955
- status () << " Function Pointer Removal" << eom;
956
- remove_function_pointers (symbol_table, goto_functions, cmdline.isset (" pointer-check" ));
957
-
958
- // do partial inlining
959
- status () << " Partial Inlining" << eom;
960
- goto_partial_inline (goto_functions, ns, ui_message_handler);
961
- }
962
-
950
+ do_function_pointer_removal ();
951
+ do_partial_inlining ();
952
+
963
953
status () << " Pointer Analysis" << eom;
964
954
value_set_analysist value_set_analysis (ns);
965
955
value_set_analysis (goto_functions);
@@ -1191,9 +1181,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
1191
1181
// full slice?
1192
1182
if (cmdline.isset (" full-slice" ))
1193
1183
{
1194
- status () << " Function Pointer Removal" << eom;
1195
- remove_function_pointers (
1196
- symbol_table, goto_functions, cmdline.isset (" pointer-check" ));
1184
+ do_function_pointer_removal ();
1197
1185
1198
1186
status () << " Performing a full slice" << eom;
1199
1187
if (cmdline.isset (" property" ))
@@ -1299,6 +1287,7 @@ void goto_instrument_parse_optionst::help()
1299
1287
" Further transformations:\n "
1300
1288
" --constant-propagator propagate constants and simplify expressions\n "
1301
1289
" --inline perform full inlining\n "
1290
+ " --remove-function-pointers replace function pointers by case statement over function calls\n "
1302
1291
" --add-library add models of C library functions\n "
1303
1292
" \n "
1304
1293
" Other options:\n "
0 commit comments