Skip to content

Commit b9d0fa9

Browse files
author
martin
committed
Update subclasses of ai_domain_baset to deprecate function
transform's signature changed during the addition of ai_historyt. This is removing the old signature in favour of the newer, more flexible one.
1 parent bd6acb6 commit b9d0fa9

27 files changed

+103
-89
lines changed

src/analyses/ai_domain.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,6 @@ class ai_domain_baset
103103
const irep_idt &function_to,
104104
trace_ptrt to,
105105
ai_baset &ai,
106-
const namespacet &ns)
107-
{
108-
return transform(
109-
function_from,
110-
from->current_location(),
111-
function_to,
112-
to->current_location(),
113-
ai,
114-
ns);
115-
}
116-
117-
DEPRECATED(SINCE(2019, 08, 01, "use the history signature instead"))
118-
virtual void transform(
119-
const irep_idt &function_from,
120-
locationt from,
121-
const irep_idt &function_to,
122-
locationt to,
123-
ai_baset &ai,
124106
const namespacet &ns) = 0;
125107

126108
virtual void

src/analyses/constant_propagator.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ void constant_propagator_domaint::assign_rec(
122122

123123
void constant_propagator_domaint::transform(
124124
const irep_idt &function_from,
125-
locationt from,
125+
trace_ptrt trace_from,
126126
const irep_idt &function_to,
127-
locationt to,
127+
trace_ptrt trace_to,
128128
ai_baset &ai,
129129
const namespacet &ns)
130130
{
131+
locationt from{trace_from->current_location()};
132+
locationt to{trace_to->current_location()};
133+
131134
#ifdef DEBUG
132135
std::cout << "Transform from/to:\n";
133136
std::cout << from->location_number << " --> "

src/analyses/constant_propagator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class constant_propagator_domaint:public ai_domain_baset
3535
public:
3636
virtual void transform(
3737
const irep_idt &function_from,
38-
locationt from,
38+
trace_ptrt trace_from,
3939
const irep_idt &function_to,
40-
locationt to,
40+
trace_ptrt trace_to,
4141
ai_baset &ai_base,
4242
const namespacet &ns) final override;
4343

src/analyses/custom_bitvector_analysis.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,15 @@ void custom_bitvector_domaint::assign_struct_rec(
267267

268268
void custom_bitvector_domaint::transform(
269269
const irep_idt &function_from,
270-
locationt from,
270+
trace_ptrt trace_from,
271271
const irep_idt &function_to,
272-
locationt to,
272+
trace_ptrt trace_to,
273273
ai_baset &ai,
274274
const namespacet &ns)
275275
{
276+
locationt from{trace_from->current_location()};
277+
locationt to{trace_to->current_location()};
278+
276279
// upcast of ai
277280
custom_bitvector_analysist &cba=
278281
static_cast<custom_bitvector_analysist &>(ai);

src/analyses/custom_bitvector_analysis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class custom_bitvector_domaint:public ai_domain_baset
2525
public:
2626
void transform(
2727
const irep_idt &function_from,
28-
locationt from,
28+
trace_ptrt trace_from,
2929
const irep_idt &function_to,
30-
locationt to,
30+
trace_ptrt trace_to,
3131
ai_baset &ai,
3232
const namespacet &ns) final override;
3333

src/analyses/dependence_graph.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,15 @@ void dep_graph_domaint::data_dependencies(
194194

195195
void dep_graph_domaint::transform(
196196
const irep_idt &function_from,
197-
goto_programt::const_targett from,
197+
trace_ptrt trace_from,
198198
const irep_idt &function_to,
199-
goto_programt::const_targett to,
199+
trace_ptrt trace_to,
200200
ai_baset &ai,
201201
const namespacet &ns)
202202
{
203+
locationt from{trace_from->current_location()};
204+
locationt to{trace_to->current_location()};
205+
203206
dependence_grapht *dep_graph=dynamic_cast<dependence_grapht*>(&ai);
204207
assert(dep_graph!=nullptr);
205208

src/analyses/dependence_graph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ class dep_graph_domaint:public ai_domain_baset
8080

8181
void transform(
8282
const irep_idt &function_from,
83-
goto_programt::const_targett from,
83+
trace_ptrt trace_from,
8484
const irep_idt &function_to,
85-
goto_programt::const_targett to,
85+
trace_ptrt trace_to,
8686
ai_baset &ai,
8787
const namespacet &ns) final override;
8888

src/analyses/escape_analysis.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,15 @@ void escape_domaint::get_rhs_aliases_address_of(
166166
}
167167

168168
void escape_domaint::transform(
169-
const irep_idt &,
170-
locationt from,
171-
const irep_idt &,
172-
locationt,
173-
ai_baset &,
174-
const namespacet &)
169+
const irep_idt &function_from,
170+
trace_ptrt trace_from,
171+
const irep_idt &function_to,
172+
trace_ptrt trace_to,
173+
ai_baset &ai,
174+
const namespacet &ns)
175175
{
176+
locationt from{trace_from->current_location()};
177+
176178
if(has_values.is_false())
177179
return;
178180

src/analyses/escape_analysis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class escape_domaint:public ai_domain_baset
3030

3131
void transform(
3232
const irep_idt &function_from,
33-
locationt from,
33+
trace_ptrt trace_from,
3434
const irep_idt &function_to,
35-
locationt to,
35+
trace_ptrt trace_to,
3636
ai_baset &ai,
3737
const namespacet &ns) final override;
3838

src/analyses/global_may_alias.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ void global_may_alias_domaint::get_rhs_aliases_address_of(
9191
}
9292

9393
void global_may_alias_domaint::transform(
94-
const irep_idt &,
95-
locationt from,
96-
const irep_idt &,
97-
locationt,
98-
ai_baset &,
99-
const namespacet &)
94+
const irep_idt &function_from,
95+
trace_ptrt trace_from,
96+
const irep_idt &function_to,
97+
trace_ptrt trace_to,
98+
ai_baset &ai,
99+
const namespacet &ns)
100100
{
101+
locationt from{trace_from->current_location()};
102+
101103
if(has_values.is_false())
102104
return;
103105

src/analyses/global_may_alias.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class global_may_alias_domaint:public ai_domain_baset
3131
/// Abstract Interpretation domain transform function.
3232
void transform(
3333
const irep_idt &function_from,
34-
locationt from,
34+
trace_ptrt trace_from,
3535
const irep_idt &function_to,
36-
locationt to,
36+
trace_ptrt trace_to,
3737
ai_baset &ai,
3838
const namespacet &ns) final override;
3939

src/analyses/interval_domain.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@ void interval_domaint::output(
5757
}
5858

5959
void interval_domaint::transform(
60-
const irep_idt &,
61-
locationt from,
62-
const irep_idt &,
63-
locationt to,
64-
ai_baset &,
60+
const irep_idt &function_from,
61+
trace_ptrt trace_from,
62+
const irep_idt &function_to,
63+
trace_ptrt trace_to,
64+
ai_baset &ai,
6565
const namespacet &ns)
6666
{
67+
locationt from{trace_from->current_location()};
68+
locationt to{trace_to->current_location()};
69+
6770
const goto_programt::instructiont &instruction=*from;
6871
switch(instruction.type)
6972
{

src/analyses/interval_domain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class interval_domaint:public ai_domain_baset
3333

3434
void transform(
3535
const irep_idt &function_from,
36-
locationt from,
36+
trace_ptrt trace_from,
3737
const irep_idt &function_to,
38-
locationt to,
38+
trace_ptrt trace_to,
3939
ai_baset &ai,
4040
const namespacet &ns) final override;
4141

src/analyses/invariant_set_domain.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ Author: Daniel Kroening, [email protected]
1515
#include <util/simplify_expr.h>
1616

1717
void invariant_set_domaint::transform(
18-
const irep_idt &,
19-
locationt from_l,
20-
const irep_idt &,
21-
locationt to_l,
22-
ai_baset &,
18+
const irep_idt &function_from,
19+
trace_ptrt trace_from,
20+
const irep_idt &function_to,
21+
trace_ptrt trace_to,
22+
ai_baset &ai,
2323
const namespacet &ns)
2424
{
25+
locationt from_l(trace_from->current_location());
26+
locationt to_l(trace_to->current_location());
27+
2528
switch(from_l->type)
2629
{
2730
case GOTO:

src/analyses/invariant_set_domain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class invariant_set_domaint:public ai_domain_baset
5858

5959
virtual void transform(
6060
const irep_idt &function_from,
61-
locationt from_l,
61+
trace_ptrt trace_from,
6262
const irep_idt &function_to,
63-
locationt to_l,
63+
trace_ptrt trace_to,
6464
ai_baset &ai,
6565
const namespacet &ns) final override;
6666

src/analyses/is_threaded.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ class is_threaded_domaint:public ai_domain_baset
4848

4949
void transform(
5050
const irep_idt &,
51-
locationt from,
51+
trace_ptrt trace_from,
5252
const irep_idt &,
53-
locationt,
53+
trace_ptrt,
5454
ai_baset &,
55-
const namespacet &) final override
55+
const namespacet &) override
5656
{
57+
locationt from{trace_from->current_location()};
58+
5759
INVARIANT(reachable,
5860
"Transformers are only applied at reachable locations");
5961

src/analyses/reaching_definitions.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,15 @@ void rd_range_domaint::populate_cache(const irep_idt &identifier) const
9090

9191
void rd_range_domaint::transform(
9292
const irep_idt &function_from,
93-
locationt from,
93+
trace_ptrt trace_from,
9494
const irep_idt &function_to,
95-
locationt to,
95+
trace_ptrt trace_to,
9696
ai_baset &ai,
9797
const namespacet &ns)
9898
{
99+
locationt from{trace_from->current_location()};
100+
locationt to{trace_to->current_location()};
101+
99102
reaching_definitions_analysist *rd=
100103
dynamic_cast<reaching_definitions_analysist*>(&ai);
101104
INVARIANT_STRUCTURED(

src/analyses/reaching_definitions.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,17 @@ class rd_range_domaint:public ai_domain_baset
149149
/// `transform_*` method for the recognised instruction.
150150
/// \param function_from: Just passed to `transform_function_call` and
151151
/// `transform_end_function` callees.
152-
/// \param from: Reference to a GOTO instruction according to which `*this`
153-
/// instance should be transformed.
152+
/// \param trace_from: The ai_history giving the GOTO instruction which
153+
/// `*this` instance should be transformed.
154154
/// \param function_to: Just passed to `transform_function_call` callee.
155-
/// \param to: Just passed to `transform_end_function` callee.
155+
/// \param trace_to: Just passed to `transform_end_function` callee.
156156
/// \param ai: A reference to 'reaching_definitions_analysist' instance.
157157
/// \param ns: Just passed to callees.
158158
void transform(
159159
const irep_idt &function_from,
160-
locationt from,
160+
trace_ptrt trace_from,
161161
const irep_idt &function_to,
162-
locationt to,
162+
trace_ptrt trace_to,
163163
ai_baset &ai,
164164
const namespacet &ns) final override;
165165

src/analyses/uninitialized_domain.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ Date: January 2010
2020

2121
void uninitialized_domaint::transform(
2222
const irep_idt &,
23-
locationt from,
23+
trace_ptrt trace_from,
2424
const irep_idt &,
25-
locationt,
25+
trace_ptrt,
2626
ai_baset &,
2727
const namespacet &ns)
2828
{
29+
locationt from{trace_from->current_location()};
30+
2931
if(has_values.is_false())
3032
return;
3133

src/analyses/uninitialized_domain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class uninitialized_domaint:public ai_domain_baset
3131

3232
void transform(
3333
const irep_idt &function_from,
34-
locationt from,
34+
trace_ptrt trace_from,
3535
const irep_idt &function_to,
36-
locationt to,
36+
trace_ptrt trace_to,
3737
ai_baset &ai,
3838
const namespacet &ns) final override;
3939

src/analyses/variable-sensitivity/three_way_merge_abstract_interpreter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ bool ai_three_way_merget::visit_edge_function_call(
125125
// but in VSD it does, so this cannot be omitted.
126126
s_working.transform(
127127
callee_function_id,
128-
l_callee_end,
128+
p_callee_end,
129129
calling_function_id,
130-
l_return_site,
130+
p_return_site,
131131
*this,
132132
ns);
133133

src/analyses/variable-sensitivity/variable_sensitivity_dependence_graph.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ void variable_sensitivity_dependence_domaint::eval_data_deps(
6565
*/
6666
void variable_sensitivity_dependence_domaint::transform(
6767
const irep_idt &function_from,
68-
locationt from,
68+
trace_ptrt trace_from,
6969
const irep_idt &function_to,
70-
locationt to,
70+
trace_ptrt trace_to,
7171
ai_baset &ai,
7272
const namespacet &ns)
7373
{
74+
locationt from{trace_from->current_location()};
75+
locationt to{trace_to->current_location()};
76+
7477
variable_sensitivity_domaint::transform(
75-
function_from, from, function_to, to, ai, ns);
78+
function_from, trace_from, function_to, trace_to, ai, ns);
7679

7780
variable_sensitivity_dependence_grapht *dep_graph =
7881
dynamic_cast<variable_sensitivity_dependence_grapht *>(&ai);

src/analyses/variable-sensitivity/variable_sensitivity_dependence_graph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ class variable_sensitivity_dependence_domaint
8181

8282
void transform(
8383
const irep_idt &function_from,
84-
locationt from,
84+
trace_ptrt trace_from,
8585
const irep_idt &function_to,
86-
locationt to,
86+
trace_ptrt trace_to,
8787
ai_baset &ai,
8888
const namespacet &ns) override;
8989

0 commit comments

Comments
 (0)