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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 14 08:32:55 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:

Oh, but it's the same form for all entries, even the smaller ones - if the list is large enough?
Might be good to just include the form in the hash here, as we might optimize it later to use smaller forms for smaller entries? (at least we should assert the expected form so we can catch this later - but some amount of generality might just be easier to do now rather than assert and fix later)

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


More information about the llvm-commits mailing list