@@ -89,23 +89,30 @@ class external_value_set_exprt:public exprt
89
89
const typet &type,
90
90
const constant_exprt &_label,
91
91
const local_value_set_analysis_modet mode,
92
- bool modified ):
92
+ bool is_initializer ):
93
93
exprt (ID_external_value_set, type)
94
94
{
95
95
operands ().resize (1 );
96
96
operands ()[0 ]=_label;
97
97
set (" #lva_mode" , std::to_string (static_cast <int >(mode)));
98
- set (" modified " , std::to_string (modified ? 1 : 0 ));
98
+ set (" is_initializer " , std::to_string (is_initializer ? 1 : 0 ));
99
99
}
100
100
101
101
local_value_set_analysis_modet analysis_mode () const
102
102
{
103
103
return (local_value_set_analysis_modet)get_int (" #lva_mode" );
104
104
}
105
105
106
- bool is_modified () const
106
+ // / At the beginning of a function, the value set for EVS("A.b") is
107
+ // / { EVS("A.b", is_initializer=true) }. Whenever EVS("A.b") gets put into a
108
+ // / value set the is_initializer flag is set to false. This includes when
109
+ // / it is put into the value set for EVS("A.b"), for example because of the
110
+ // / line `a1.b = a2.b`. This allows us to distinguish the case that nothing
111
+ // / was written to any A.b and the case that a value was written to an A.b
112
+ // / from a different A.b.
113
+ bool is_initializer () const
107
114
{
108
- return get_bool (" modified " );
115
+ return get_bool (" is_initializer " );
109
116
}
110
117
111
118
constant_exprt &label () { return to_constant_expr (op0 ()); }
@@ -214,14 +221,14 @@ class external_value_set_exprt:public exprt
214
221
}
215
222
}
216
223
217
- external_value_set_exprt as_modified () const
224
+ external_value_set_exprt as_non_initializer () const
218
225
{
219
- if (is_modified ())
226
+ if (! is_initializer ())
220
227
return *this ;
221
228
else
222
229
{
223
230
external_value_set_exprt copy=*this ;
224
- copy.set (" modified " , ID_1 );
231
+ copy.set (" is_initializer " , ID_0 );
225
232
return copy;
226
233
}
227
234
}
0 commit comments