File tree 3 files changed +13
-4
lines changed
src/analyses/variable-sensitivity 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -285,7 +285,9 @@ abstract_object_pointert abstract_environmentt::add_object_context(
285
285
return object_factory->wrap_with_context (abstract_object);
286
286
}
287
287
288
- bool abstract_environmentt::merge (const abstract_environmentt &env)
288
+ bool abstract_environmentt::merge (
289
+ const abstract_environmentt &env,
290
+ wident widen_mode)
289
291
{
290
292
// for each entry in the incoming environment we need to either add it
291
293
// if it is new, or merge with the existing key if it is not present
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ class variable_sensitivity_object_factoryt;
32
32
using variable_sensitivity_object_factory_ptrt =
33
33
std::shared_ptr<variable_sensitivity_object_factoryt>;
34
34
35
+ enum class wident
36
+ {
37
+ no,
38
+ should_widen
39
+ };
40
+
35
41
class abstract_environmentt
36
42
{
37
43
public:
@@ -186,9 +192,10 @@ class abstract_environmentt
186
192
// / Computes the join between "this" and "b"
187
193
// /
188
194
// / \param env: the other environment
195
+ // / \param widen_mode: indicates if this is a widening merge
189
196
// /
190
197
// / \return A Boolean, true when the merge has changed something
191
- virtual bool merge (const abstract_environmentt &env);
198
+ virtual bool merge (const abstract_environmentt &env, wident widen_mode );
192
199
193
200
// / This should be used as a default case / everything else has failed
194
201
// / The string is so that I can easily find and diagnose cases where this
Original file line number Diff line number Diff line change @@ -204,9 +204,9 @@ bool variable_sensitivity_domaint::merge(
204
204
std::cout << " Merging from/to:\n " << from->location_number << " --> "
205
205
<< to->location_number << ' \n ' ;
206
206
#endif
207
-
207
+ auto widen_mode = from-> should_widen (*to) ? wident::should_widen : wident::no;
208
208
// Use the abstract_environment merge
209
- bool any_changes = abstract_state.merge (b.abstract_state );
209
+ bool any_changes = abstract_state.merge (b.abstract_state , widen_mode );
210
210
211
211
DATA_INVARIANT (abstract_state.verify (), " Structural invariant" );
212
212
return any_changes;
You can’t perform that action at this time.
0 commit comments