@@ -151,16 +151,16 @@ as std::map, an ordering is defined.
151
151
#### Class ` sparse_bitvector_analysist `
152
152
153
153
An instance of this class provides an assignment of unique numeric ` ID ` to each
154
- inserted ` reaching_definitionst ` instance. Internally, the class holds two data
154
+ inserted ` reaching_definitiont ` instance. Internally, the class holds two data
155
155
members:
156
156
157
157
- ` value_map ` is an unordered map from names of program variables to a set
158
158
of pairs (` reaching_definitiont ` , ` ID ` ). Formally, the map is defined as
159
- ` value_map: var_names -> (reaching_definitionst -> ID) ` .
159
+ ` value_map: var_names -> (reaching_definitiont -> ID) ` .
160
160
- ` values ` is a map from an ` ID ` to the corresponding ` reaching_definitiont `
161
161
instance inside the map ` value_map ` . Namely, the map is implemented as an
162
162
` std::vector ` of iterators to elements of the map ` value_map ` . An index to
163
- ` values ` vector is the ` ID ` of the related ` reaching_definitionst ` instance.
163
+ ` values ` vector is the ` ID ` of the related ` reaching_definitiont ` instance.
164
164
165
165
#### Class ` rd_range_domaint `
166
166
@@ -188,14 +188,16 @@ information is held in these data members:
188
188
The map is not empty only if ` has_value ` is ` UNKNOWN ` . Variables in the map
189
189
are all those which are live at the associated instruction.
190
190
- ` export_cache ` is a helper data structure. It consists of data already
191
- stored in ` values ` and ` bv_container ` . The purpose of this structure is to
192
- provide a speed-up for certain operations (discussed below). It is basically
193
- (an ordered) map from (a subset of) variables in ` values ` to iterators to
194
- GOTO instructions where the variables are defined. Moreover, each such
195
- iterator is also associated with a range of bits defining the value of that
196
- variable at that GOTO instruction. Both the iterators and the corresponding
197
- bit ranges are simply taken from ` reaching_definitiont ` instances obtained
198
- for ` ID ` s in ` values[var_name] ` .
191
+ stored in ` values ` and ` bv_container ` . It is basically (an ordered) map from
192
+ (a subset of) variables in ` values ` to iterators to GOTO instructions where
193
+ the variables are defined. Moreover, each such iterator is also associated
194
+ with a range of bits defining the value of that variable at that GOTO
195
+ instruction. Both the iterators and the corresponding bit ranges are simply
196
+ taken from ` reaching_definitiont ` instances obtained for ` ID ` s in
197
+ ` values[var_name] ` . This data structure is actually used only in the ` output `
198
+ method; other methods only remove outdated data from it. Since the cache
199
+ does not contribute to the computation, it should be either moved to the
200
+ ` output ` method or removed entirely.
199
201
200
202
##### Method ` merge `
201
203
@@ -208,9 +210,6 @@ of `ID`s is the set union of `a.values[v]` and `b.values[v]`.
208
210
NOTE: The operation actually does not produce a new ` join ` element. The element
209
211
` a ` is modified to become the ` join ` element.
210
212
211
- NOTE: When union of ` a.values[v] ` and ` b.values[v] ` is computed, then ` v ` must
212
- be removed from the cache ` export_cache ` .
213
-
214
213
##### Method ` transform `
215
214
216
215
Computes an instance obtained from a source instance ` a ` by transformation over
@@ -222,8 +221,7 @@ instruction. The dedicated methods are described below.
222
221
##### Method ` transform_dead `
223
222
224
223
Computes an instance obtained from a source instance ` a ` by transformation over
225
- ` DEAD v ` GOTO instruction. The operation simply removes ` v ` from ` a.values ` (an
226
- from the ` export_cache ` ).
224
+ ` DEAD v ` GOTO instruction. The operation simply removes ` v ` from ` a.values ` .
227
225
228
226
##### Method ` transform_start_thread `
229
227
@@ -258,6 +256,9 @@ in `values[v]` and stores them into `export_cache[v]`. Namely, for each
258
256
` reaching_definitiont ` instance ` rd ` obtained from ` bv_container ` it associates
259
257
` rd.definition_at ` with the bit-range ` (rd.bit_begin, rd.bit_end) ` .
260
258
259
+ This function is only used to fill in the cache ` export_cache ` for the ` output `
260
+ method.
261
+
261
262
### Class ` reaching_definitions_analysist `
262
263
263
264
\subsection analyses-reaching-definitions Reaching definitions (reaching_definitions_analysist)
0 commit comments