CBMC
goto_instrument_parse_options.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Command Line Parsing
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H
13 #define CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H
14 
15 #include <util/config.h>
16 #include <util/parse_options.h>
17 #include <util/timestamper.h>
18 #include <util/ui_message.h>
20 
27 
28 #include <ansi-c/ansi_c_language.h>
29 #include <ansi-c/goto_check_c.h>
31 
32 #include "aggressive_slicer.h"
33 #include "count_eloc.h"
34 #include "document_properties.h"
35 #include "dump_c.h"
38 #include "nondet_volatile.h"
39 #include "replace_calls.h"
40 #include "uninitialized.h"
41 #include "unwindset.h"
42 
43 #include "contracts/contracts.h"
45 #include "wmm/weak_memory.h"
46 
47 // clang-format off
48 #define GOTO_INSTRUMENT_OPTIONS \
49  OPT_DOCUMENT_PROPERTIES \
50  OPT_DUMP_C \
51  "(dot)(xml)" \
52  OPT_GOTO_CHECK \
53  OPT_REMOVE_POINTERS \
54  "(no-simplify)" \
55  OPT_UNINITIALIZED_CHECK \
56  OPT_WMM \
57  "(race-check)" \
58  OPT_UNWINDSET \
59  "(unwindset-file):" \
60  "(unwinding-assertions)(partial-loops)(continue-as-loops)" \
61  "(log):" \
62  "(call-graph)(reachable-call-graph)" \
63  OPT_INSERT_FINAL_ASSERT_FALSE \
64  OPT_SHOW_CLASS_HIERARCHY \
65  "(isr):" \
66  "(stack-depth):(nondet-static)" \
67  "(nondet-static-exclude):" \
68  "(function-enter):(function-exit):(branch):" \
69  OPT_SHOW_GOTO_FUNCTIONS \
70  OPT_SHOW_PROPERTIES \
71  "(drop-unused-functions)" \
72  "(show-value-sets)" \
73  "(show-global-may-alias)" \
74  "(show-local-bitvector-analysis)(show-custom-bitvector-analysis)" \
75  "(show-escape-analysis)(escape-analysis)" \
76  "(custom-bitvector-analysis)" \
77  "(show-struct-alignment)(interval-analysis)(show-intervals)" \
78  "(show-uninitialized)(show-locations)" \
79  "(full-slice)(reachability-slice)(slice-global-inits)" \
80  "(fp-reachability-slice):" \
81  "(inline)(partial-inline)(function-inline):(log):(no-caching)" \
82  "(value-set-fi-fp-removal)" \
83  OPT_REMOVE_CONST_FUNCTION_POINTERS \
84  "(print-internal-representation)" \
85  "(remove-function-pointers)" \
86  "(show-claims)(property):" \
87  "(show-symbol-table)(show-points-to)(show-rw-set)" \
88  OPT_TIMESTAMP \
89  "(show-natural-loops)(show-lexical-loops)(accelerate)(havoc-loops)" \
90  "(verbosity):(version)(xml-ui)(json-ui)" \
91  "(accelerate)(constant-propagator)" \
92  "(k-induction):(step-case)(base-case)" \
93  "(show-call-sequences)(check-call-sequence)" \
94  "(interpreter)(show-reaching-definitions)" \
95  "(list-symbols)(list-undefined-functions)" \
96  "(z3)(add-library)(show-dependence-graph)" \
97  "(horn)(skip-loops):(model-argc-argv):" \
98  "(" FLAG_LOOP_CONTRACTS ")" \
99  "(" FLAG_REPLACE_CALL "):" \
100  "(" FLAG_ENFORCE_CONTRACT "):" \
101  "(show-threaded)(list-calls-args)" \
102  "(undefined-function-is-assume-false)" \
103  "(remove-function-body):"\
104  OPT_AGGRESSIVE_SLICER \
105  OPT_FLUSH \
106  "(splice-call):" \
107  OPT_REMOVE_CALLS_NO_BODY \
108  OPT_REPLACE_FUNCTION_BODY \
109  OPT_GOTO_PROGRAM_STATS \
110  "(show-local-safe-pointers)(show-safe-dereferences)" \
111  "(show-sese-regions)" \
112  OPT_REPLACE_CALLS \
113  "(validate-goto-binary)" \
114  OPT_VALIDATE \
115  OPT_ANSI_C_LANGUAGE \
116  OPT_RESTRICT_FUNCTION_POINTER \
117  OPT_NONDET_VOLATILE \
118  "(ensure-one-backedge-per-target)" \
119  OPT_CONFIG_LIBRARY \
120  OPT_SYNTHESIZE_LOOP_INVARIANTS \
121  // empty last line
122 
123 // clang-format on
124 
126 {
127 public:
128  int doit() override;
129  void help() override;
130 
131  goto_instrument_parse_optionst(int argc, const char **argv)
134  argc,
135  argv,
136  "goto-instrument"),
138  partial_inlining_done(false),
139  remove_returns_done(false)
140  {
141  }
142 
143 protected:
144  void register_languages() override;
145 
146  void get_goto_program();
148 
149  void do_indirect_call_and_rtti_removal(bool force=false);
151  void do_partial_inlining();
152  void do_remove_returns();
153 
157 
159 };
160 
161 #endif // CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H
goto_instrument_parse_optionst::help
void help() override
display command line help
Definition: goto_instrument_parse_options.cpp:1755
goto_instrument_parse_optionst
Definition: goto_instrument_parse_options.h:125
parse_options_baset
Definition: parse_options.h:19
goto_instrument_parse_optionst::do_remove_returns
void do_remove_returns()
Definition: goto_instrument_parse_options.cpp:988
goto_instrument_parse_optionst::do_partial_inlining
void do_partial_inlining()
Definition: goto_instrument_parse_options.cpp:974
goto_instrument_parse_optionst::goto_instrument_parse_optionst
goto_instrument_parse_optionst(int argc, const char **argv)
Definition: goto_instrument_parse_options.h:131
goto_instrument_parse_optionst::function_pointer_removal_done
bool function_pointer_removal_done
Definition: goto_instrument_parse_options.h:154
validation_interface.h
count_eloc.h
goto_check_c.h
remove_calls_no_body.h
goto_instrument_parse_optionst::do_remove_const_function_pointers_only
void do_remove_const_function_pointers_only()
Remove function pointers that can be resolved by analysing const variables (i.e.
Definition: goto_instrument_parse_options.cpp:958
goto_modelt
Definition: goto_model.h:25
show_goto_functions.h
weak_memory.h
goto_instrument_parse_optionst::doit
int doit() override
invoke main modules
Definition: goto_instrument_parse_options.cpp:113
insert_final_assert_false.h
replace_calls.h
document_properties.h
generate_function_bodies.h
GOTO_INSTRUMENT_OPTIONS
#define GOTO_INSTRUMENT_OPTIONS
Definition: goto_instrument_parse_options.h:48
goto_instrument_parse_optionst::do_indirect_call_and_rtti_removal
void do_indirect_call_and_rtti_removal(bool force=false)
Definition: goto_instrument_parse_options.cpp:939
restrict_function_pointers.h
goto_instrument_parse_optionst::get_goto_program
void get_goto_program()
Definition: goto_instrument_parse_options.cpp:999
goto_instrument_parse_optionst::register_languages
void register_languages() override
Definition: goto_instrument_languages.cpp:19
show_properties.h
goto_instrument_parse_optionst::instrument_goto_program
void instrument_goto_program()
Definition: goto_instrument_parse_options.cpp:1016
parse_options.h
goto_instrument_parse_optionst::partial_inlining_done
bool partial_inlining_done
Definition: goto_instrument_parse_options.h:155
contracts.h
uninitialized.h
aggressive_slicer.h
goto_instrument_parse_optionst::remove_returns_done
bool remove_returns_done
Definition: goto_instrument_parse_options.h:156
class_hierarchy.h
remove_const_function_pointers.h
ansi_c_language.h
enumerative_loop_invariant_synthesizer.h
goto_program_dereference.h
nondet_volatile.h
timestamper.h
Emit timestamps.
config.h
goto_instrument_parse_optionst::goto_model
goto_modelt goto_model
Definition: goto_instrument_parse_options.h:158
unwindset.h
dump_c.h
ui_message.h