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

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 09:09:58 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 DWARFDebugNames::Abbrev &Abbr : Abbrevs)
+    AbbrevsVect.push_back(&Abbr);
+  llvm::sort(AbbrevsVect.begin(), AbbrevsVect.end(),
----------------
felipepiovezan wrote:

minor nit: note that we can use a range based version here, no need for `begin` and `end`, just `AbbrevsVect` :)

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


More information about the llvm-commits mailing list