diff options
author | David Blaikie <dblaikie@gmail.com> | 2021-11-24 13:47:42 -0800 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2021-11-24 14:03:56 -0800 |
commit | cd93ab8947a88470b3e1ef738a2947c0bfda667f (patch) | |
tree | d9a9605db77a400ddb8bb72564ae790ce4c8d1c5 /llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp | |
parent | 7a0584fe3fd6b342d56251e92acc437961c8d29d (diff) | |
download | llvm-cd93ab8947a88470b3e1ef738a2947c0bfda667f.zip llvm-cd93ab8947a88470b3e1ef738a2947c0bfda667f.tar.gz llvm-cd93ab8947a88470b3e1ef738a2947c0bfda667f.tar.bz2 |
DWARFVerifier: Don't parse all units twice
Introduced/discussed in https://reviews.llvm.org/D38719
The header validation logic was also explicitly building the DWARFUnits
to validate. But then other calls, like "Units.getUnitForOffset" creates
the DWARFUnits again in the DWARFContext proper - so, let's avoid
creating the DWARFUnits twice by walking the DWARFContext's units rather
than building a new list explicitly.
This does reduce some verifier power - it means that any unit with a
header parsing failure won't get further validation, whereas the
verifier-created units were getting some further validation despite
invalid headers. I don't think this is a great loss/seems "right" in
some ways to me that if the header's invalid we should stop there.
Exposing the raw DWARFUnitVectors from DWARFContext feels a bit
sub-optimal, but gave simple access to the getUnitForOffset to keep the
rest of the code fairly similar.
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp')
0 files changed, 0 insertions, 0 deletions