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

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 15:26:39 PST 2024


================
@@ -467,26 +427,44 @@ 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);
+  }
+}
+
 void Dwarf5AccelTableWriter::populateAbbrevsMap() {
   for (auto &Bucket : Contents.getBuckets()) {
     for (auto *Hash : Bucket) {
-      for (auto *Value : Hash->getValues<DWARF5AccelTableData *>()) {
+      for (DWARF5AccelTableData *Value :
----------------
felipepiovezan wrote:

The type is already spelled on the RHS of this expression, so this is one of the blessed uses of auto according to our coding guidelines

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


More information about the llvm-commits mailing list