Skip to content

Commit b50279c

Browse files
committed
Make goto_symext::language_mode protected
This should be set via constructors. Remove bmc_util/setup_symex as all work is done through constructors.
1 parent e5df371 commit b50279c

9 files changed

+13
-32
lines changed

src/goto-checker/bmc_util.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Author: Daniel Kroening, Peter Schrammel
2222
#include <goto-symex/slice.h>
2323
#include <goto-symex/symex_target_equation.h>
2424

25-
#include <linking/static_lifetime_init.h>
26-
2725
#include <solvers/decision_procedure.h>
2826

2927
#include <util/json_stream.h>
@@ -175,21 +173,6 @@ get_memory_model(const optionst &options, const namespacet &ns)
175173
}
176174
}
177175

178-
void setup_symex(
179-
symex_bmct &symex,
180-
const namespacet &ns,
181-
ui_message_handlert &ui_message_handler)
182-
{
183-
messaget msg(ui_message_handler);
184-
const symbolt *init_symbol;
185-
if(!ns.lookup(INITIALIZE_FUNCTION, init_symbol))
186-
symex.language_mode = init_symbol->mode;
187-
188-
msg.status() << "Starting Bounded Model Checking" << messaget::eom;
189-
190-
symex.last_source_location.make_nil();
191-
}
192-
193176
void slice(
194177
symex_bmct &symex,
195178
symex_target_equationt &symex_target_equation,

src/goto-checker/bmc_util.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ void output_graphml(
6868
std::unique_ptr<memory_model_baset>
6969
get_memory_model(const optionst &options, const namespacet &);
7070

71-
void setup_symex(symex_bmct &, const namespacet &, ui_message_handlert &);
72-
7371
void slice(
7472
symex_bmct &,
7573
symex_target_equationt &symex_target_equation,

src/goto-checker/multi_path_symex_only_checker.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ multi_path_symex_only_checkert::multi_path_symex_only_checkert(
3939
unwindset.parse_unwind(options.get_option("unwind"));
4040
unwindset.parse_unwindset(
4141
options.get_list_option("unwindset"), goto_model, ui_message_handler);
42-
setup_symex(symex, ns, ui_message_handler);
4342
}
4443

4544
incremental_goto_checkert::resultt multi_path_symex_only_checkert::

src/goto-checker/single_loop_incremental_symex_checker.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ single_loop_incremental_symex_checkert::single_loop_incremental_symex_checkert(
4242
unwindset.parse_unwind(options.get_option("unwind"));
4343
unwindset.parse_unwindset(
4444
options.get_list_option("unwindset"), goto_model, ui_message_handler);
45-
setup_symex(symex, ns, ui_message_handler);
4645

4746
// Freeze all symbols if we are using a prop_conv_solvert
4847
prop_conv_solvert *prop_conv_solver = dynamic_cast<prop_conv_solvert *>(

src/goto-checker/single_path_symex_only_checker.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ void single_path_symex_only_checkert::equation_output(
152152
}
153153
}
154154

155-
void single_path_symex_only_checkert::setup_symex(symex_bmct &symex)
156-
{
157-
::setup_symex(symex, ns, ui_message_handler);
158-
}
159-
160155
void single_path_symex_only_checkert::update_properties(
161156
propertiest &properties,
162157
std::unordered_set<irep_idt> &updated_properties,

src/goto-checker/single_path_symex_only_checker.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ class single_path_symex_only_checkert : public incremental_goto_checkert
4747
const symex_bmct &symex,
4848
const symex_target_equationt &equation);
4949

50-
virtual void setup_symex(symex_bmct &symex);
50+
virtual void setup_symex(symex_bmct &symex)
51+
{
52+
// deriving classes may do extra work here
53+
}
5154

5255
/// Adds the initial goto-symex state as a path to the worklist
5356
virtual void initialize_worklist();

src/goto-checker/symex_bmc.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Author: Daniel Kroening, [email protected]
1818

1919
#include <goto-instrument/unwindset.h>
2020

21+
#include <linking/static_lifetime_init.h>
22+
2123
symex_bmct::symex_bmct(
2224
message_handlert &mh,
2325
const symbol_tablet &outer_symbol_table,
@@ -33,10 +35,17 @@ symex_bmct::symex_bmct(
3335
options,
3436
path_storage,
3537
guard_manager),
38+
last_source_location(source_locationt::nil()),
3639
record_coverage(!options.get_option("symex-coverage-report").empty()),
3740
unwindset(unwindset),
3841
symex_coverage(ns)
3942
{
43+
const symbolt *init_symbol = outer_symbol_table.lookup(INITIALIZE_FUNCTION);
44+
if(init_symbol)
45+
language_mode = init_symbol->mode;
46+
47+
messaget msg{mh};
48+
msg.status() << "Starting Bounded Model Checking" << messaget::eom;
4049
}
4150

4251
/// show progress

src/goto-symex/goto_symex.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,10 @@ class goto_symext
234234
messaget::mstreamt &
235235
print_callstack_entry(const symex_targett::sourcet &target);
236236

237-
public:
238-
239237
/// language_mode: ID_java, ID_C or another language identifier
240238
/// if we know the source language in use, irep_idt() otherwise.
241239
irep_idt language_mode;
242240

243-
protected:
244241
/// The symbol table associated with the goto-program being executed.
245242
/// This symbol table will not have objects that are dynamically created as
246243
/// part of symbolic execution added to it; those object are stored in the

unit/path_strategies.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ void _check_with_strategy(
431431
*worklist,
432432
guard_manager,
433433
unwindset);
434-
setup_symex(symex, ns, ui_message_handler);
435434

436435
symex.initialize_path_storage_from_entry_point_of(
437436
goto_symext::get_goto_function(goto_model),
@@ -454,7 +453,6 @@ void _check_with_strategy(
454453
*worklist,
455454
guard_manager,
456455
unwindset);
457-
setup_symex(symex, ns, ui_message_handler);
458456

459457
symex_symbol_table = symex.resume_symex_from_saved_state(
460458
goto_symext::get_goto_function(goto_model),

0 commit comments

Comments
 (0)