cprover
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 <ansi-c/ansi_c_language.h>
16 
17 #include <util/parse_options.h>
18 #include <util/timestamper.h>
19 #include <util/ui_message.h>
21 
29 
30 #include <analyses/goto_check.h>
31 
32 #include "aggressive_slicer.h"
33 #include "code_contracts.h"
36 #include "nondet_volatile.h"
37 #include "replace_calls.h"
38 
39 #include "count_eloc.h"
40 
41 // clang-format off
42 #define GOTO_INSTRUMENT_OPTIONS \
43  "(all)" \
44  "(document-claims-latex)(document-claims-html)" \
45  "(document-properties-latex)(document-properties-html)" \
46  "(dump-c-type-header):" \
47  "(dump-c)(dump-cpp)(no-system-headers)(use-all-headers)(dot)(xml)" \
48  "(harness)" \
49  OPT_GOTO_CHECK \
50  /* no-X-check are deprecated and ignored */ \
51  "(no-bounds-check)(no-pointer-check)(no-div-by-zero-check)" \
52  "(no-nan-check)" \
53  "(remove-pointers)" \
54  "(no-simplify)" \
55  "(uninitialized-check)" \
56  "(race-check)(scc)(one-event-per-cycle)" \
57  "(minimum-interference)" \
58  "(mm):(my-events)" \
59  "(unwind):(unwindset):(unwindset-file):" \
60  "(unwinding-assertions)(partial-loops)(continue-as-loops)" \
61  "(log):" \
62  "(max-var):(max-po-trans):(ignore-arrays)" \
63  "(cfg-kill)(no-dependencies)(force-loop-duplication)" \
64  "(call-graph)(reachable-call-graph)" \
65  OPT_INSERT_FINAL_ASSERT_FALSE \
66  OPT_SHOW_CLASS_HIERARCHY \
67  "(no-po-rendering)(render-cluster-file)(render-cluster-function)" \
68  "(isr):" \
69  "(stack-depth):(nondet-static)" \
70  "(nondet-static-exclude):" \
71  "(function-enter):(function-exit):(branch):" \
72  OPT_SHOW_GOTO_FUNCTIONS \
73  OPT_SHOW_PROPERTIES \
74  "(drop-unused-functions)" \
75  "(show-value-sets)" \
76  "(show-global-may-alias)" \
77  "(show-local-bitvector-analysis)(show-custom-bitvector-analysis)" \
78  "(show-escape-analysis)(escape-analysis)" \
79  "(custom-bitvector-analysis)" \
80  "(show-struct-alignment)(interval-analysis)(show-intervals)" \
81  "(show-uninitialized)(show-locations)" \
82  "(full-slice)(reachability-slice)(slice-global-inits)" \
83  "(fp-reachability-slice):" \
84  "(inline)(partial-inline)(function-inline):(log):(no-caching)" \
85  "(value-set-fi-fp-removal)" \
86  OPT_REMOVE_CONST_FUNCTION_POINTERS \
87  "(print-internal-representation)" \
88  "(remove-function-pointers)" \
89  "(show-claims)(property):" \
90  "(show-symbol-table)(show-points-to)(show-rw-set)" \
91  "(cav11)" \
92  OPT_TIMESTAMP \
93  "(show-natural-loops)(show-lexical-loops)(accelerate)(havoc-loops)" \
94  "(string-abstraction)" \
95  "(verbosity):(version)(xml-ui)(json-ui)(show-loops)" \
96  "(accelerate)(constant-propagator)" \
97  "(k-induction):(step-case)(base-case)" \
98  "(show-call-sequences)(check-call-sequence)" \
99  "(interpreter)(show-reaching-definitions)" \
100  "(list-symbols)(list-undefined-functions)" \
101  "(z3)(add-library)(show-dependence-graph)" \
102  "(horn)(skip-loops):(model-argc-argv):" \
103  "(" FLAG_REPLACE_CALL "):" \
104  "(" FLAG_REPLACE_ALL_CALLS ")" \
105  "(" FLAG_ENFORCE_CONTRACT "):" \
106  "(" FLAG_ENFORCE_ALL_CONTRACTS ")" \
107  "(show-threaded)(list-calls-args)" \
108  "(undefined-function-is-assume-false)" \
109  "(remove-function-body):"\
110  OPT_AGGRESSIVE_SLICER \
111  OPT_FLUSH \
112  "(splice-call):" \
113  OPT_REMOVE_CALLS_NO_BODY \
114  OPT_REPLACE_FUNCTION_BODY \
115  OPT_GOTO_PROGRAM_STATS \
116  "(show-local-safe-pointers)(show-safe-dereferences)" \
117  "(show-sese-regions)" \
118  OPT_REPLACE_CALLS \
119  "(validate-goto-binary)" \
120  OPT_VALIDATE \
121  OPT_ANSI_C_LANGUAGE \
122  OPT_RESTRICT_FUNCTION_POINTER \
123  OPT_NONDET_VOLATILE \
124  "(ensure-one-backedge-per-target)" \
125  // empty last line
126 
127 // clang-format on
128 
130 {
131 public:
132  virtual int doit();
133  virtual void help();
134 
135  goto_instrument_parse_optionst(int argc, const char **argv)
138  argc,
139  argv,
140  "goto-instrument"),
142  partial_inlining_done(false),
143  remove_returns_done(false)
144  {
145  }
146 
147 protected:
148  void register_languages();
149 
150  void get_goto_program();
152 
153  void do_indirect_call_and_rtti_removal(bool force=false);
155  void do_partial_inlining();
156  void do_remove_returns();
157 
161 
163 };
164 
165 #endif // CPROVER_GOTO_INSTRUMENT_GOTO_INSTRUMENT_PARSE_OPTIONS_H
goto_instrument_parse_optionst
Definition: goto_instrument_parse_options.h:130
parse_options_baset
Definition: parse_options.h:20
goto_instrument_parse_optionst::do_remove_returns
void do_remove_returns()
Definition: goto_instrument_parse_options.cpp:973
goto_instrument_parse_optionst::help
virtual void help()
display command line help
Definition: goto_instrument_parse_options.cpp:1731
goto_instrument_parse_optionst::do_partial_inlining
void do_partial_inlining()
Definition: goto_instrument_parse_options.cpp:959
goto_instrument_parse_optionst::goto_instrument_parse_optionst
goto_instrument_parse_optionst(int argc, const char **argv)
Definition: goto_instrument_parse_options.h:135
goto_instrument_parse_optionst::function_pointer_removal_done
bool function_pointer_removal_done
Definition: goto_instrument_parse_options.h:158
validation_interface.h
count_eloc.h
Count effective lines of code.
remove_calls_no_body.h
Remove calls to functions without a body.
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:942
goto_modelt
Definition: goto_model.h:26
show_goto_functions.h
Show the goto functions.
insert_final_assert_false.h
Insert final assert false into a function.
replace_calls.h
Replace calls to given functions with calls to other given functions.
generate_function_bodies.h
goto_instrument_parse_optionst::doit
virtual int doit()
invoke main modules
Definition: goto_instrument_parse_options.cpp:120
GOTO_INSTRUMENT_OPTIONS
#define GOTO_INSTRUMENT_OPTIONS
Definition: goto_instrument_parse_options.h:42
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:922
restrict_function_pointers.h
Given goto functions and a list of function parameters or globals that are function pointers with lis...
goto_instrument_parse_optionst::get_goto_program
void get_goto_program()
Definition: goto_instrument_parse_options.cpp:984
show_properties.h
Show the properties.
goto_instrument_parse_optionst::instrument_goto_program
void instrument_goto_program()
Definition: goto_instrument_parse_options.cpp:1001
parse_options.h
goto_check.h
Program Transformation.
goto_instrument_parse_optionst::register_languages
void register_languages()
Definition: goto_instrument_languages.cpp:19
goto_instrument_parse_optionst::partial_inlining_done
bool partial_inlining_done
Definition: goto_instrument_parse_options.h:159
aggressive_slicer.h
Aggressive slicer Consider the control flow graph of the goto program and a criterion description of ...
goto_instrument_parse_optionst::remove_returns_done
bool remove_returns_done
Definition: goto_instrument_parse_options.h:160
class_hierarchy.h
Class Hierarchy.
remove_const_function_pointers.h
Goto Programs.
ansi_c_language.h
nondet_volatile.h
Volatile Variables.
goto_functions.h
Goto Programs with Functions.
timestamper.h
Emit timestamps.
goto_instrument_parse_optionst::goto_model
goto_modelt goto_model
Definition: goto_instrument_parse_options.h:162
code_contracts.h
Verify and use annotated invariants and pre/post-conditions.
ui_message.h