Skip to content

Commit 2752f0b

Browse files
committed
Updates requested in the review: Typos, and export_cache issue.
1 parent 75ace41 commit 2752f0b

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

src/analyses/README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@ as std::map, an ordering is defined.
151151
#### Class `sparse_bitvector_analysist`
152152

153153
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
155155
members:
156156

157157
- `value_map` is an unordered map from names of program variables to a set
158158
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)`.
160160
- `values` is a map from an `ID` to the corresponding `reaching_definitiont`
161161
instance inside the map `value_map`. Namely, the map is implemented as an
162162
`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.
164164

165165
#### Class `rd_range_domaint`
166166

@@ -188,14 +188,16 @@ information is held in these data members:
188188
The map is not empty only if `has_value` is `UNKNOWN`. Variables in the map
189189
are all those which are live at the associated instruction.
190190
- `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.
199201

200202
##### Method `merge`
201203

@@ -208,9 +210,6 @@ of `ID`s is the set union of `a.values[v]` and `b.values[v]`.
208210
NOTE: The operation actually does not produce a new `join` element. The element
209211
`a` is modified to become the `join` element.
210212

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-
214213
##### Method `transform`
215214

216215
Computes an instance obtained from a source instance `a` by transformation over
@@ -222,8 +221,7 @@ instruction. The dedicated methods are described below.
222221
##### Method `transform_dead`
223222

224223
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`.
227225

228226
##### Method `transform_start_thread`
229227

@@ -258,6 +256,9 @@ in `values[v]` and stores them into `export_cache[v]`. Namely, for each
258256
`reaching_definitiont` instance `rd` obtained from `bv_container` it associates
259257
`rd.definition_at` with the bit-range `(rd.bit_begin, rd.bit_end)`.
260258

259+
This function is only used to fill in the cache `export_cache` for the `output`
260+
method.
261+
261262
### Class `reaching_definitions_analysist`
262263

263264
\subsection analyses-reaching-definitions Reaching definitions (reaching_definitions_analysist)

0 commit comments

Comments
 (0)