[llvm] [LLVM][DWARF] Change .debug_names abbrev to be an index (PR #81200)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 08:58:34 PST 2024


================
@@ -467,26 +427,43 @@ getFormForIdxParent(const DenseSet<OffsetAndUnitID> &IndexedOffsets,
   return dwarf::Form::DW_FORM_flag_present;
 }
 
+void DebugNamesAbbrev::Profile(FoldingSetNodeID &ID) const {
+  ID.AddInteger(DieTag);
+  for (const DebugNamesAbbrev::AttributeEncoding &Enc : AttrVect) {
+    ID.AddInteger(Enc.Index);
+    if (Enc.Index == dwarf::DW_IDX_parent)
+      ID.AddInteger(Enc.Form);
----------------
dwblaikie wrote:

This special case is here because we use the same form for every other DW_IDX attribute except parent? Could you add an assert that checks the form for non-parent IDX is the expected form? (so if we tweak the code to use other novel forms in the future, we know to update this code)

https://github.com/llvm/llvm-project/pull/81200


More information about the llvm-commits mailing list