You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[src][sourcepath] remove .pp extension from sourcepath
As mentionned in f090928, there was a difference between the compilation
unit of a preprocessed file and the one of an unpreprocessed file.
Forcing them to have the same compilation unit by removing the `.pp`
extension works in most cases.
However, in the case of optional arguments, some computations relied on
finding whether a location belonged to the current or a previously
analyzed compilation unit or if it belongs to an unknown (potentially
analyzed later) compilation unit.
This property is checked in `DeadCommon.VdNode.seen` by verifying if the
location has a corresponding sourcepath in the `DeadCommon.abspath`
table. This table associates compilation units (as obtained by
`Utils.unit`) with sourcepaths (read in the `.cmi` and `.cmt` files) and
is filled when starting the analysis of either a `.cmi` or a `.cmt`.
Verifying that a location belongs to a known file is done by checking if
its filename is a suffix of one of the sourcepaths associated with its
compilation unit.
The sourcepath of a `.cmt` file may end with `.pp.ml`, while locaitons
found in the typedtree will not contain the `.pp` part. Therefore, the
inconsistency observed in f090928 still remains for sourcepaths.
Rather than removing the `.pp` extension in `Utils.unit`, it is directly
removed from the sourcepaths read in `.cmt` files. This ways,
compilation units are consistent and file paths read in locations are
also consisten with the sourcepaths.
With this change, I measured a gain of ~10s (from ~22s to ~12s) when
running the analyzer with `-v --all` on [Frama-C 31.0]
(https://git.frama-c.com/pub/frama-c/-/tree/31.0?ref_type=tags) on my
machine.
0 commit comments