@@ -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,20 @@ 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 (expr.op0 (), r, w, " ." +component_name+suffix, guard_conjuncts );
118
119
}
119
120
else if (expr.id ()==ID_index)
120
121
{
121
122
// we don't distinguish the array elements for now
122
123
assert (expr.operands ().size ()==2 );
123
- read_write_rec (expr.op0 (), r, w, " []" +suffix, guard );
124
- read (expr.op1 (), guard );
124
+ read_write_rec (expr.op0 (), r, w, " []" +suffix, guard_conjuncts );
125
+ read (expr.op1 (), guard_conjuncts );
125
126
}
126
127
else if (expr.id ()==ID_dereference)
127
128
{
128
129
assert (expr.operands ().size ()==1 );
129
130
set_track_deref ();
130
- read (expr.op0 (), guard );
131
+ read (expr.op0 (), guard_conjuncts );
131
132
132
133
exprt tmp=expr;
133
134
#ifdef LOCAL_MAY
@@ -147,25 +148,25 @@ void _rw_set_loct::read_write_rec(
147
148
entryt &entry=r_entries[object];
148
149
entry.object =object;
149
150
entry.symbol_expr =symbol_exprt (ID_unknown);
150
- entry.guard =guard. as_expr ( ); // should 'OR'
151
+ entry.guard =conjunction (guard_conjuncts ); // should 'OR'
151
152
152
153
continue ;
153
154
}
154
155
#endif
155
- read_write_rec (*it, r, w, suffix, guard );
156
+ read_write_rec (*it, r, w, suffix, guard_conjuncts );
156
157
}
157
158
#else
158
159
dereference (function_id, target, tmp, ns, value_sets);
159
160
160
- read_write_rec (tmp, r, w, suffix, guard );
161
+ read_write_rec (tmp, r, w, suffix, guard_conjuncts );
161
162
#endif
162
163
163
164
reset_track_deref ();
164
165
}
165
166
else if (expr.id ()==ID_typecast)
166
167
{
167
168
assert (expr.operands ().size ()==1 );
168
- read_write_rec (expr.op0 (), r, w, suffix, guard );
169
+ read_write_rec (expr.op0 (), r, w, suffix, guard_conjuncts );
169
170
}
170
171
else if (expr.id ()==ID_address_of)
171
172
{
@@ -174,20 +175,20 @@ void _rw_set_loct::read_write_rec(
174
175
else if (expr.id ()==ID_if)
175
176
{
176
177
assert (expr.operands ().size ()==3 );
177
- read (expr.op0 (), guard );
178
+ read (expr.op0 (), guard_conjuncts );
178
179
179
- guardt true_guard (guard) ;
180
- true_guard.add (expr.op0 ());
180
+ exprt::operandst true_guard = guard_conjuncts ;
181
+ true_guard.push_back (expr.op0 ());
181
182
read_write_rec (expr.op1 (), r, w, suffix, true_guard);
182
183
183
- guardt false_guard (guard) ;
184
- false_guard.add (not_exprt (expr.op0 ()));
184
+ exprt::operandst false_guard = guard_conjuncts ;
185
+ false_guard.push_back (not_exprt (expr.op0 ()));
185
186
read_write_rec (expr.op2 (), r, w, suffix, false_guard);
186
187
}
187
188
else
188
189
{
189
190
forall_operands (it, expr)
190
- read_write_rec (*it, r, w, suffix, guard );
191
+ read_write_rec (*it, r, w, suffix, guard_conjuncts );
191
192
}
192
193
}
193
194
0 commit comments