[PATCH] D107554: [DWARF][Verifier] Do not add child DieRangeInfo with empty address range to the parent.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 19 08:13:47 PDT 2021


avl added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:389
 
-  DWARFAddressRangesVector Ranges = RangesOrError.get();
+  const DWARFAddressRangesVector &Ranges = RangesOrError.get();
   // Build RI for this DIE and check that ranges within this DIE do not
----------------
dblaikie wrote:
> Probably commit this as a separate NFC change.
done.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:453
                              ParentRI.Die.getTag() == DW_TAG_subprogram);
   if (ShouldBeContained && !ParentRI.contains(RI)) {
     ++NumErrors;
----------------
dblaikie wrote:
> Could `contains` have the same handling? (maybe both ParentRI/this and RI/RHS could be checked, then they wouldn't need to be checked at this caller)
The meaning of "ShouldBeContained" looks to be different than "contains".
"ShouldBeContained" - means we want to check.
"contains" - means ParentRI contains RI.

f.e. contains() returns false if (ParentRI/this).Ranges is empty.
without extra check for ShouldBeContained we would report error here.

So it looks like contains could not have the same handling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107554/new/

https://reviews.llvm.org/D107554



More information about the llvm-commits mailing list