Skip to content

Commit f9684b4

Browse files
authored
Merge pull request #6852 from diffblue/remove_get_set_condition
remove goto_programt::get_ and set_condition
2 parents 58d64d8 + a25657d commit f9684b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+139
-184
lines changed

src/analyses/constant_propagator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void constant_propagator_domaint::transform(
171171
}
172172
else if(from->is_assume())
173173
{
174-
two_way_propagate_rec(from->get_condition(), ns, cp);
174+
two_way_propagate_rec(from->condition(), ns, cp);
175175
}
176176
else if(from->is_goto())
177177
{
@@ -180,9 +180,9 @@ void constant_propagator_domaint::transform(
180180
// Comparing iterators is safe as the target must be within the same list
181181
// of instructions because this is a GOTO.
182182
if(from->get_target()==to)
183-
g = from->get_condition();
183+
g = from->condition();
184184
else
185-
g = not_exprt(from->get_condition());
185+
g = not_exprt(from->condition());
186186
partial_evaluate(values, g, ns);
187187
if(g.is_false())
188188
values.set_to_bottom();
@@ -762,10 +762,10 @@ void constant_propagator_ait::replace(
762762

763763
if(it->is_goto() || it->is_assume() || it->is_assert())
764764
{
765-
exprt c = it->get_condition();
765+
exprt c = it->condition();
766766
replace_types_rec(d.values.replace_const, c);
767767
if(!constant_propagator_domaint::partial_evaluate(d.values, c, ns))
768-
it->set_condition(c);
768+
it->condition_nonconst() = c;
769769
}
770770
else if(it->is_assign())
771771
{

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ void custom_bitvector_domaint::transform(
517517
break;
518518

519519
case GOTO:
520-
if(has_get_must_or_may(instruction.get_condition()))
520+
if(has_get_must_or_may(instruction.condition()))
521521
{
522-
exprt guard = instruction.get_condition();
522+
exprt guard = instruction.condition();
523523

524524
// Comparing iterators is safe as the target must be within the same list
525525
// of instructions because this is a GOTO.
@@ -790,16 +790,15 @@ void custom_bitvector_analysist::check(
790790

791791
if(i_it->is_assert())
792792
{
793-
if(!custom_bitvector_domaint::has_get_must_or_may(
794-
i_it->get_condition()))
793+
if(!custom_bitvector_domaint::has_get_must_or_may(i_it->condition()))
795794
{
796795
continue;
797796
}
798797

799798
if(operator[](i_it).has_values.is_false())
800799
continue;
801800

802-
exprt tmp = eval(i_it->get_condition(), i_it);
801+
exprt tmp = eval(i_it->condition(), i_it);
803802
const namespacet ns(goto_model.symbol_table);
804803
result = simplify_expr(std::move(tmp), ns);
805804

src/analyses/flow_insensitive_analysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ exprt flow_insensitive_abstract_domain_baset::get_guard(
2323
if(!from->is_goto())
2424
return true_exprt();
2525
else if(std::next(from) == to)
26-
return boolean_negate(from->get_condition());
26+
return boolean_negate(from->condition());
2727
else
28-
return from->get_condition();
28+
return from->condition();
2929
}
3030

3131
exprt flow_insensitive_abstract_domain_baset::get_return_lhs(locationt to) const

src/analyses/goto_rw.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,10 +867,7 @@ void goto_rw(
867867
case ASSUME:
868868
case ASSERT:
869869
rw_set.get_objects_rec(
870-
function,
871-
target,
872-
rw_range_sett::get_modet::READ,
873-
target->get_condition());
870+
function, target, rw_range_sett::get_modet::READ, target->condition());
874871
break;
875872

876873
case SET_RETURN_VALUE:

src/analyses/interval_analysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void instrument_intervals(
4646
{
4747
goto_programt::const_targett previous = std::prev(i_it);
4848

49-
if(previous->is_goto() && !previous->get_condition().is_true())
49+
if(previous->is_goto() && !previous->condition().is_true())
5050
{
5151
// we follow a branch, instrument
5252
}

src/analyses/interval_domain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ void interval_domaint::transform(
9191
if(from->get_target() != next) // If equal then a skip
9292
{
9393
if(next == to)
94-
assume(not_exprt(instruction.get_condition()), ns);
94+
assume(not_exprt(instruction.condition()), ns);
9595
else
96-
assume(instruction.get_condition(), ns);
96+
assume(instruction.condition(), ns);
9797
}
9898
break;
9999
}
100100

101101
case ASSUME:
102-
assume(instruction.get_condition(), ns);
102+
assume(instruction.condition(), ns);
103103
break;
104104

105105
case FUNCTION_CALL:

src/analyses/invariant_propagation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void invariant_propagationt::simplify(goto_programt &goto_program)
264264

265265
const invariant_sett &invariant_set = d.invariant_set;
266266

267-
exprt simplified_guard(i_it->get_condition());
267+
exprt simplified_guard(i_it->condition());
268268

269269
invariant_set.simplify(simplified_guard);
270270
::simplify(simplified_guard, ns);

src/analyses/invariant_set_domain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void invariant_set_domaint::transform(
3131
{
3232
// Comparing iterators is safe as the target must be within the same list
3333
// of instructions because this is a GOTO.
34-
exprt tmp(from_l->get_condition());
34+
exprt tmp(from_l->condition());
3535

3636
if(std::next(from_l) == to_l)
3737
tmp = boolean_negate(tmp);
@@ -44,7 +44,7 @@ void invariant_set_domaint::transform(
4444
case ASSERT:
4545
case ASSUME:
4646
{
47-
exprt tmp(from_l->get_condition());
47+
exprt tmp(from_l->condition());
4848
simplify(tmp, ns);
4949
invariant_set.strengthen(tmp);
5050
}

src/analyses/local_cfg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void local_cfgt::build(const goto_programt &goto_program)
3535
switch(instruction.type())
3636
{
3737
case GOTO:
38-
if(!instruction.get_condition().is_true())
38+
if(!instruction.condition().is_true())
3939
node.successors.push_back(loc_nr+1);
4040

4141
for(const auto &target : instruction.targets)

src/analyses/local_safe_pointers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void local_safe_pointerst::operator()(const goto_programt &goto_program)
127127

128128
// Possible checks:
129129
case ASSUME:
130-
if(auto assume_check = get_null_checked_expr(instruction.get_condition()))
130+
if(auto assume_check = get_null_checked_expr(instruction.condition()))
131131
{
132132
if(assume_check->checked_when_taken)
133133
checked_expressions.insert(assume_check->checked_expr);
@@ -150,7 +150,7 @@ void local_safe_pointerst::operator()(const goto_programt &goto_program)
150150
{
151151
if(
152152
auto conditional_check =
153-
get_null_checked_expr(instruction.get_condition()))
153+
get_null_checked_expr(instruction.condition()))
154154
{
155155
// Add the GOTO condition to either the target or current state,
156156
// as appropriate:

0 commit comments

Comments
 (0)