[llvm] [LLVM][DWARF] Chnage order for .debug_names abbrev print out (PR #80229)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 15:43:01 PST 2024


================
@@ -847,8 +847,15 @@ void DWARFDebugNames::NameIndex::dumpForeignTUs(ScopedPrinter &W) const {
 
 void DWARFDebugNames::NameIndex::dumpAbbreviations(ScopedPrinter &W) const {
   ListScope AbbrevsScope(W, "Abbreviations");
-  for (const auto &Abbr : Abbrevs)
-    Abbr.dump(W);
+  std::vector<const Abbrev *> AbbrevsVect;
+  for (const llvm::DWARFDebugNames::Abbrev &Abbr : Abbrevs)
+    AbbrevsVect.push_back(&Abbr);
+  std::sort(AbbrevsVect.begin(), AbbrevsVect.end(),
----------------
ayermolo wrote:

My interpretation that only applies if we have equal elements. Which shouldn't be the case in this case. Abbrev offsets are monotonically increasing.

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


More information about the llvm-commits mailing list