[PATCH] D50213: DebugInfo: Add metadata support for disabling DWARF pub sections

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 06:20:39 PDT 2018


labath added inline comments.


================
Comment at: llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp:558-564
+    if (CU.value()->getCUNode()->getNameTableKind() ==
+        DICompileUnit::DebugNameTableKind::None)
+      continue;
     assert(CU.index() == CU.value()->getUniqueID());
     const DwarfCompileUnit *MainCU =
         DD.useSplitDwarf() ? CU.value()->getSkeleton() : CU.value().get();
     CompUnits.push_back(MainCU->getLabelBegin());
----------------
I am sorry for not noticing this  sooner, but I have a feeling this will break the CU references in the debug_names section in case of CUs with mixed pubnames flags (which I guess only could happen  during LTO).

This code was (perhaps lazily) assuming that compile unit "unique IDs" form a continuous sequence from 0 to `CUs.size()-1`.  This is relied upon by the lambda below which simply calls `getUniqueID` to get the value of the DW_IDX_compile_unit attribute. Now that the unique IDs and the CU lists in the name index don't match, I guess we'll have to create a separate lookup table for that.

(The assert here was meant to catch the case where the UniqueIDs stop being continuous, but I did not anticipate that we would start filtering them ourselves.)


================
Comment at: llvm/trunk/lib/CodeGen/AsmPrinter/AccelTable.cpp:578
         const DIE *CUDie = Entry.getDie().getUnitDie();
         return DD.lookupCU(CUDie)->getUniqueID();
       })
----------------
This lambda here.


Repository:
  rL LLVM

https://reviews.llvm.org/D50213





More information about the llvm-commits mailing list