Skip to content

Commit a387193

Browse files
committed
Change domain merge(...) to take trace_ptrts rather than locationt.
Passing in trace_ptrts provides more context that locationt, which we will need in the variable-sensitivity domain to determine if we need to widen. At the moment however, none of the merge functions use this information at all, so this change is a no-op.
1 parent f899754 commit a387193

23 files changed

+34
-65
lines changed

src/analyses/ai_domain.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ class ai_domain_factoryt : public ai_domain_factory_baset
214214
{
215215
// For backwards compatability, use the location version
216216
return static_cast<domainT &>(dest).merge(
217-
static_cast<const domainT &>(src),
218-
from->current_location(),
219-
to->current_location());
217+
static_cast<const domainT &>(src), from, to);
220218
}
221219
};
222220

src/analyses/constant_propagator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@ bool constant_propagator_domaint::valuest::meet(
638638
/// \return Return true if "this" has changed.
639639
bool constant_propagator_domaint::merge(
640640
const constant_propagator_domaint &other,
641-
locationt,
642-
locationt)
641+
trace_ptrt,
642+
trace_ptrt)
643643
{
644644
return values.merge(other.values);
645645
}

src/analyses/constant_propagator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class constant_propagator_domaint:public ai_domain_baset
4848

4949
bool merge(
5050
const constant_propagator_domaint &other,
51-
locationt from,
52-
locationt to);
51+
trace_ptrt from,
52+
trace_ptrt to);
5353

5454
virtual bool ai_simplify(
5555
exprt &condition,

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ void custom_bitvector_domaint::output(
609609

610610
bool custom_bitvector_domaint::merge(
611611
const custom_bitvector_domaint &b,
612-
locationt,
613-
locationt)
612+
trace_ptrt,
613+
trace_ptrt)
614614
{
615615
bool changed=has_values.is_false();
616616
has_values=tvt::unknown();

src/analyses/custom_bitvector_analysis.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ class custom_bitvector_domaint:public ai_domain_baset
7171
return has_values.is_true();
7272
}
7373

74-
bool merge(
75-
const custom_bitvector_domaint &b,
76-
locationt from,
77-
locationt to);
74+
bool merge(const custom_bitvector_domaint &b, trace_ptrt from, trace_ptrt to);
7875

7976
typedef unsigned long long bit_vectort;
8077

src/analyses/dependence_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Date: August 2013
2121

2222
bool dep_graph_domaint::merge(
2323
const dep_graph_domaint &src,
24-
goto_programt::const_targett,
25-
goto_programt::const_targett)
24+
trace_ptrt,
25+
trace_ptrt)
2626
{
2727
// An abstract state at location `to` may be non-bottom even if
2828
// `merge(..., `to`) has not been called so far. This is due to the special

src/analyses/dependence_graph.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ class dep_graph_domaint:public ai_domain_baset
7373
{
7474
}
7575

76-
bool merge(
77-
const dep_graph_domaint &src,
78-
goto_programt::const_targett from,
79-
goto_programt::const_targett to);
76+
bool merge(const dep_graph_domaint &src, trace_ptrt from, trace_ptrt to);
8077

8178
void transform(
8279
const irep_idt &function_from,

src/analyses/escape_analysis.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,7 @@ void escape_domaint::output(
326326
}
327327
}
328328

329-
bool escape_domaint::merge(
330-
const escape_domaint &b,
331-
locationt,
332-
locationt)
329+
bool escape_domaint::merge(const escape_domaint &b, trace_ptrt, trace_ptrt)
333330
{
334331
bool changed=has_values.is_false();
335332
has_values=tvt::unknown();

src/analyses/escape_analysis.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ class escape_domaint:public ai_domain_baset
4141
const ai_baset &ai,
4242
const namespacet &ns) const final override;
4343

44-
bool merge(
45-
const escape_domaint &b,
46-
locationt from,
47-
locationt to);
44+
bool merge(const escape_domaint &b, trace_ptrt from, trace_ptrt to);
4845

4946
void make_bottom() final override
5047
{

src/analyses/global_may_alias.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ void global_may_alias_domaint::output(
197197

198198
bool global_may_alias_domaint::merge(
199199
const global_may_alias_domaint &b,
200-
locationt,
201-
locationt)
200+
trace_ptrt,
201+
trace_ptrt)
202202
{
203203
bool changed=has_values.is_false();
204204
has_values=tvt::unknown();

src/analyses/global_may_alias.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ class global_may_alias_domaint:public ai_domain_baset
4848
const namespacet &ns) const final override;
4949

5050
/// Abstract Interpretation domain merge function.
51-
bool merge(
52-
const global_may_alias_domaint &b,
53-
locationt from,
54-
locationt to);
51+
bool merge(const global_may_alias_domaint &b, trace_ptrt from, trace_ptrt to);
5552

5653
/// Clear list of aliases, and mark domain as bottom.
5754
void make_bottom() final override

src/analyses/interval_domain.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ class interval_domaint:public ai_domain_baset
4848
bool join(const interval_domaint &b);
4949

5050
public:
51-
bool merge(
52-
const interval_domaint &b,
53-
locationt,
54-
locationt)
51+
bool merge(const interval_domaint &b, trace_ptrt, trace_ptrt)
5552
{
5653
return join(b);
5754
}

src/analyses/invariant_set_domain.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ class invariant_set_domaint:public ai_domain_baset
3333

3434
// overloading
3535

36-
bool merge(
37-
const invariant_set_domaint &other,
38-
locationt,
39-
locationt)
36+
bool merge(const invariant_set_domaint &other, trace_ptrt, trace_ptrt)
4037
{
4138
bool changed=invariant_set.make_union(other.invariant_set) ||
4239
has_values.is_false();

src/analyses/is_threaded.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ class is_threaded_domaint:public ai_domain_baset
2828
// this is bottom
2929
}
3030

31-
bool merge(
32-
const is_threaded_domaint &src,
33-
locationt,
34-
locationt)
31+
bool merge(const is_threaded_domaint &src, trace_ptrt, trace_ptrt)
3532
{
3633
INVARIANT(src.reachable,
3734
"Abstract states are only merged at reachable locations");

src/analyses/reaching_definitions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,8 @@ bool rd_range_domaint::merge_inner(
675675

676676
bool rd_range_domaint::merge(
677677
const rd_range_domaint &other,
678-
locationt,
679-
locationt)
678+
trace_ptrt,
679+
trace_ptrt)
680680
{
681681
bool changed=has_values.is_false();
682682
has_values=tvt::unknown();

src/analyses/reaching_definitions.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,7 @@ class rd_range_domaint:public ai_domain_baset
218218
/// \param from: Not used at all.
219219
/// \param to: Not used at all.
220220
/// \return Returns true iff there is something new
221-
bool merge(
222-
const rd_range_domaint &other,
223-
locationt from,
224-
locationt to);
221+
bool merge(const rd_range_domaint &other, trace_ptrt from, trace_ptrt to);
225222

226223
bool merge_shared(
227224
const rd_range_domaint &other,

src/analyses/uninitialized_domain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ void uninitialized_domaint::output(
8080
/// \return returns true iff there is something new
8181
bool uninitialized_domaint::merge(
8282
const uninitialized_domaint &other,
83-
locationt,
84-
locationt)
83+
trace_ptrt,
84+
trace_ptrt)
8585
{
8686
auto old_uninitialized=uninitialized.size();
8787

src/analyses/uninitialized_domain.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ class uninitialized_domaint:public ai_domain_baset
7474
}
7575

7676
// returns true iff there is something new
77-
bool merge(
78-
const uninitialized_domaint &other,
79-
locationt from,
80-
locationt to);
77+
bool
78+
merge(const uninitialized_domaint &other, trace_ptrt from, trace_ptrt to);
8179

8280
private:
8381
tvt has_values;

src/analyses/variable-sensitivity/variable_sensitivity_dependence_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ bool variable_sensitivity_dependence_domaint::merge_control_dependencies(
399399
*/
400400
bool variable_sensitivity_dependence_domaint::merge(
401401
const variable_sensitivity_domaint &b,
402-
locationt from,
403-
locationt to)
402+
trace_ptrt from,
403+
trace_ptrt to)
404404
{
405405
bool changed = false;
406406

src/analyses/variable-sensitivity/variable_sensitivity_dependence_graph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ class variable_sensitivity_dependence_domaint
134134

135135
bool merge(
136136
const variable_sensitivity_domaint &b,
137-
locationt from,
138-
locationt to) override;
137+
trace_ptrt from,
138+
trace_ptrt to) override;
139139

140140
void merge_three_way_function_return(
141141
const ai_domain_baset &function_call,

src/analyses/variable-sensitivity/variable_sensitivity_domain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ void variable_sensitivity_domaint::make_entry()
197197

198198
bool variable_sensitivity_domaint::merge(
199199
const variable_sensitivity_domaint &b,
200-
locationt from,
201-
locationt to)
200+
trace_ptrt from,
201+
trace_ptrt to)
202202
{
203203
#ifdef DEBUG
204204
std::cout << "Merging from/to:\n " << from->location_number << " --> "

src/analyses/variable-sensitivity/variable_sensitivity_domain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class variable_sensitivity_domaint : public ai_domain_baset
157157
///
158158
/// \return true if something has changed.
159159
virtual bool
160-
merge(const variable_sensitivity_domaint &b, locationt from, locationt to);
160+
merge(const variable_sensitivity_domaint &b, trace_ptrt from, trace_ptrt to);
161161

162162
/// Perform a context aware merge of the changes that have been applied
163163
/// between function_start and the current state. Anything that has not been

unit/analyses/ai/ai.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class instruction_counter_domaint : public ai_domain_baset
7070
return true;
7171
}
7272

73-
bool merge(const instruction_counter_domaint &b, locationt, locationt)
73+
bool merge(const instruction_counter_domaint &b, trace_ptrt, trace_ptrt)
7474
{
7575
if(b.is_bottom())
7676
return false;

0 commit comments

Comments
 (0)