Skip to content

Commit eef01a1

Browse files
authored
Merge pull request diffblue#4018 from romainbrenguier/clean-up/goto-symex-state
Break goto_symex_state into more manageable bits
2 parents 6b3d01a + 7938cd1 commit eef01a1

14 files changed

+173
-217
lines changed

src/goto-checker/symex_bmc.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ void symex_bmct::symex_step(
8686
}
8787
}
8888

89-
void symex_bmct::merge_goto(
90-
const statet::goto_statet &goto_state,
91-
statet &state)
89+
void symex_bmct::merge_goto(const goto_statet &goto_state, statet &state)
9290
{
9391
const goto_programt::const_targett prev_pc = goto_state.source.pc;
9492
const guardt prev_guard = goto_state.guard;

src/goto-checker/symex_bmc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ class symex_bmct : public goto_symext
9494
void symex_step(const get_goto_functiont &get_goto_function, statet &state)
9595
override;
9696

97-
void
98-
merge_goto(const statet::goto_statet &goto_state, statet &state) override;
97+
void merge_goto(const goto_statet &goto_state, statet &state) override;
9998

10099
bool should_stop_unwind(
101100
const symex_targett::sourcet &source,

src/goto-symex/goto_symex.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,11 @@ class goto_symext
256256
// gotos
257257
void merge_gotos(statet &);
258258

259-
virtual void merge_goto(
260-
const statet::goto_statet &goto_state,
261-
statet &);
259+
virtual void merge_goto(const goto_statet &goto_state, statet &);
262260

263-
void merge_value_sets(
264-
const statet::goto_statet &goto_state,
265-
statet &dest);
261+
void merge_value_sets(const goto_statet &goto_state, statet &dest);
266262

267-
void phi_function(
268-
const statet::goto_statet &goto_state,
269-
statet &);
263+
void phi_function(const goto_statet &goto_state, statet &);
270264

271265
// determine whether to unwind a loop -- true indicates abort,
272266
// with false we continue.

src/goto-symex/goto_symex_state.cpp

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ Author: Daniel Kroening, [email protected]
2828
static void get_l1_name(exprt &expr);
2929

3030
goto_symex_statet::goto_symex_statet()
31-
: depth(0),
32-
symex_target(nullptr),
33-
atomic_section_id(0),
34-
total_vccs(0),
35-
remaining_vccs(0),
36-
record_events(true),
37-
dirty()
31+
: symex_target(nullptr), record_events(true), dirty()
3832
{
3933
threads.resize(1);
4034
new_frame();
@@ -697,42 +691,6 @@ void goto_symex_statet::rename(
697691
l1_type_entry.first->second=type;
698692
}
699693

700-
void goto_symex_statet::get_original_name(exprt &expr) const
701-
{
702-
get_original_name(expr.type());
703-
704-
if(expr.id()==ID_symbol &&
705-
expr.get_bool(ID_C_SSA_symbol))
706-
expr=to_ssa_expr(expr).get_original_expr();
707-
else
708-
Forall_operands(it, expr)
709-
get_original_name(*it);
710-
}
711-
712-
void goto_symex_statet::get_original_name(typet &type) const
713-
{
714-
// rename all the symbols with their last known value
715-
716-
if(type.id()==ID_array)
717-
{
718-
auto &array_type = to_array_type(type);
719-
get_original_name(array_type.subtype());
720-
get_original_name(array_type.size());
721-
}
722-
else if(type.id() == ID_struct || type.id() == ID_union)
723-
{
724-
struct_union_typet &s_u_type=to_struct_union_type(type);
725-
struct_union_typet::componentst &components=s_u_type.components();
726-
727-
for(auto &component : components)
728-
get_original_name(component.type());
729-
}
730-
else if(type.id()==ID_pointer)
731-
{
732-
get_original_name(to_pointer_type(type).subtype());
733-
}
734-
}
735-
736694
static void get_l1_name(exprt &expr)
737695
{
738696
// do not reset the type !
@@ -777,7 +735,7 @@ void goto_symex_statet::print_backtrace(std::ostream &out) const
777735
/// Print the constant propagation map in a human-friendly format.
778736
/// This is primarily for use from the debugger; please don't delete me just
779737
/// because there aren't any current callers.
780-
void goto_symex_statet::output_propagation_map(std::ostream &out)
738+
void goto_statet::output_propagation_map(std::ostream &out)
781739
{
782740
for(const auto &name_value : propagation)
783741
{

0 commit comments

Comments
 (0)