Skip to content

Commit 79ad794

Browse files
committed
Remove optionst member from goto_symext
goto_symext now has a const reference rather than owning a member. There is no need to copy an optionst by value from bmct.
1 parent 34a3d85 commit 79ad794

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

src/cbmc/bmc.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ void bmct::get_memory_model()
305305
void bmct::setup()
306306
{
307307
get_memory_model();
308-
symex.options=options;
309308

310309
{
311310
const symbolt *init_symbol;

src/cbmc/bmc.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class bmct:public safety_checkert
7676
ns(outer_symbol_table, symex_symbol_table),
7777
equation(),
7878
path_storage(_path_storage),
79-
symex(_message_handler, outer_symbol_table, equation, path_storage),
79+
symex(
80+
_message_handler, outer_symbol_table, equation, options, path_storage),
8081
prop_conv(_prop_conv),
8182
ui(ui_message_handlert::uit::PLAIN),
8283
driver_callback_after_symex(callback_after_symex)
@@ -148,7 +149,8 @@ class bmct:public safety_checkert
148149
ns(outer_symbol_table),
149150
equation(_equation),
150151
path_storage(_path_storage),
151-
symex(_message_handler, outer_symbol_table, equation, path_storage),
152+
symex(
153+
_message_handler, outer_symbol_table, equation, options, path_storage),
152154
prop_conv(_prop_conv),
153155
ui(ui_message_handlert::uit::PLAIN),
154156
driver_callback_after_symex(callback_after_symex)

src/cbmc/symex_bmc.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ symex_bmct::symex_bmct(
2222
message_handlert &mh,
2323
const symbol_tablet &outer_symbol_table,
2424
symex_target_equationt &_target,
25+
const optionst &options,
2526
path_storaget &path_storage)
26-
: goto_symext(mh, outer_symbol_table, _target, path_storage),
27+
: goto_symext(mh, outer_symbol_table, _target, options, path_storage),
2728
record_coverage(false),
2829
symex_coverage(ns)
2930
{

src/cbmc/symex_bmc.h

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class symex_bmct: public goto_symext
2929
message_handlert &mh,
3030
const symbol_tablet &outer_symbol_table,
3131
symex_target_equationt &_target,
32+
const optionst &options,
3233
path_storaget &path_storage);
3334

3435
// To show progress

src/goto-instrument/accelerate/scratch_program.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class scratch_programt:public goto_programt
4343
ns(symbol_table, symex_symbol_table),
4444
equation(),
4545
path_storage(),
46-
symex(mh, symbol_table, equation, path_storage),
46+
options(),
47+
symex(mh, symbol_table, equation, options, path_storage),
4748
satcheck(util_make_unique<satcheckt>()),
4849
satchecker(ns, *satcheck),
4950
z3(ns, "accelerate", "", "", smt2_dect::solvert::Z3),
@@ -80,6 +81,7 @@ class scratch_programt:public goto_programt
8081
namespacet ns;
8182
symex_target_equationt equation;
8283
path_fifot path_storage;
84+
optionst options;
8385
goto_symext symex;
8486

8587
std::unique_ptr<propt> satcheck;

src/goto-symex/goto_symex.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ class goto_symext
5252
message_handlert &mh,
5353
const symbol_tablet &outer_symbol_table,
5454
symex_target_equationt &_target,
55+
const optionst &options,
5556
path_storaget &path_storage)
5657
: should_pause_symex(false),
58+
options(options),
5759
total_vccs(0),
5860
remaining_vccs(0),
5961
constant_propagation(true),
@@ -66,8 +68,6 @@ class goto_symext
6668
guard_identifier("goto_symex::\\guard"),
6769
path_storage(path_storage)
6870
{
69-
options.set_option("simplify", true);
70-
options.set_option("assertions", true);
7171
}
7272

7373
virtual ~goto_symext()
@@ -194,6 +194,8 @@ class goto_symext
194194
const get_goto_functiont &,
195195
statet &);
196196

197+
const optionst &options;
198+
197199
public:
198200
// these bypass the target maps
199201
virtual void symex_step_goto(statet &, bool taken);
@@ -203,8 +205,6 @@ class goto_symext
203205

204206
bool constant_propagation;
205207

206-
optionst options;
207-
208208
/// language_mode: ID_java, ID_C or another language identifier
209209
/// if we know the source language in use, irep_idt() otherwise.
210210
irep_idt language_mode;

0 commit comments

Comments
 (0)