@@ -79,14 +79,15 @@ void _rw_set_loct::compute()
79
79
void _rw_set_loct::assign (const exprt &lhs, const exprt &rhs)
80
80
{
81
81
read (rhs);
82
- read_write_rec (lhs, false , true , " " , guardt ( true_exprt () ));
82
+ read_write_rec (lhs, false , true , " " , exprt::operandst ( ));
83
83
}
84
84
85
85
void _rw_set_loct::read_write_rec (
86
86
const exprt &expr,
87
- bool r, bool w,
87
+ bool r,
88
+ bool w,
88
89
const std::string &suffix,
89
- const guardt &guard )
90
+ const exprt::operandst &guard_conjuncts )
90
91
{
91
92
if (expr.id ()==ID_symbol)
92
93
{
@@ -96,16 +97,16 @@ void _rw_set_loct::read_write_rec(
96
97
97
98
if (r)
98
99
{
99
- const auto &entry =
100
- r_entries. emplace ( object, entryt (symbol_expr, object, guard. as_expr ( )));
100
+ const auto &entry = r_entries. emplace (
101
+ object, entryt (symbol_expr, object, conjunction (guard_conjuncts )));
101
102
102
103
track_deref (entry.first ->second , true );
103
104
}
104
105
105
106
if (w)
106
107
{
107
- const auto &entry =
108
- w_entries. emplace ( object, entryt (symbol_expr, object, guard. as_expr ( )));
108
+ const auto &entry = w_entries. emplace (
109
+ object, entryt (symbol_expr, object, conjunction (guard_conjuncts )));
109
110
110
111
track_deref (entry.first ->second , false );
111
112
}
@@ -114,20 +115,21 @@ void _rw_set_loct::read_write_rec(
114
115
{
115
116
assert (expr.operands ().size ()==1 );
116
117
const std::string &component_name=expr.get_string (ID_component_name);
117
- read_write_rec (expr.op0 (), r, w, " ." +component_name+suffix, guard);
118
+ read_write_rec (
119
+ expr.op0 (), r, w, " ." + component_name + suffix, guard_conjuncts);
118
120
}
119
121
else if (expr.id ()==ID_index)
120
122
{
121
123
// we don't distinguish the array elements for now
122
124
assert (expr.operands ().size ()==2 );
123
- read_write_rec (expr.op0 (), r, w, " []" + suffix, guard );
124
- read (expr.op1 (), guard );
125
+ read_write_rec (expr.op0 (), r, w, " []" + suffix, guard_conjuncts );
126
+ read (expr.op1 (), guard_conjuncts );
125
127
}
126
128
else if (expr.id ()==ID_dereference)
127
129
{
128
130
assert (expr.operands ().size ()==1 );
129
131
set_track_deref ();
130
- read (expr.op0 (), guard );
132
+ read (expr.op0 (), guard_conjuncts );
131
133
132
134
exprt tmp=expr;
133
135
#ifdef LOCAL_MAY
@@ -147,25 +149,25 @@ void _rw_set_loct::read_write_rec(
147
149
entryt &entry=r_entries[object];
148
150
entry.object =object;
149
151
entry.symbol_expr =symbol_exprt (ID_unknown);
150
- entry.guard =guard. as_expr ( ); // should 'OR'
152
+ entry.guard = conjunction (guard_conjuncts ); // should 'OR'
151
153
152
154
continue ;
153
155
}
154
156
#endif
155
- read_write_rec (*it, r, w, suffix, guard );
157
+ read_write_rec (*it, r, w, suffix, guard_conjuncts );
156
158
}
157
159
#else
158
160
dereference (function_id, target, tmp, ns, value_sets);
159
161
160
- read_write_rec (tmp, r, w, suffix, guard );
161
- #endif
162
+ read_write_rec (tmp, r, w, suffix, guard_conjuncts );
163
+ #endif
162
164
163
165
reset_track_deref ();
164
166
}
165
167
else if (expr.id ()==ID_typecast)
166
168
{
167
169
assert (expr.operands ().size ()==1 );
168
- read_write_rec (expr.op0 (), r, w, suffix, guard );
170
+ read_write_rec (expr.op0 (), r, w, suffix, guard_conjuncts );
169
171
}
170
172
else if (expr.id ()==ID_address_of)
171
173
{
@@ -174,20 +176,20 @@ void _rw_set_loct::read_write_rec(
174
176
else if (expr.id ()==ID_if)
175
177
{
176
178
assert (expr.operands ().size ()==3 );
177
- read (expr.op0 (), guard );
179
+ read (expr.op0 (), guard_conjuncts );
178
180
179
- guardt true_guard (guard) ;
180
- true_guard.add (expr.op0 ());
181
+ exprt::operandst true_guard = guard_conjuncts ;
182
+ true_guard.push_back (expr.op0 ());
181
183
read_write_rec (expr.op1 (), r, w, suffix, true_guard);
182
184
183
- guardt false_guard (guard) ;
184
- false_guard.add (not_exprt (expr.op0 ()));
185
+ exprt::operandst false_guard = guard_conjuncts ;
186
+ false_guard.push_back (not_exprt (expr.op0 ()));
185
187
read_write_rec (expr.op2 (), r, w, suffix, false_guard);
186
188
}
187
189
else
188
190
{
189
191
forall_operands (it, expr)
190
- read_write_rec (*it, r, w, suffix, guard );
192
+ read_write_rec (*it, r, w, suffix, guard_conjuncts );
191
193
}
192
194
}
193
195
0 commit comments