[llvm] r326056 - [DebugInfo] Stable sort symbols to remove non-deterministic ordering

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 25 11:52:34 PST 2018


Author: mgrang
Date: Sun Feb 25 11:52:34 2018
New Revision: 326056

URL: http://llvm.org/viewvc/llvm-project?rev=326056&view=rev
Log:
[DebugInfo] Stable sort symbols to remove non-deterministic ordering

Summary: This fixes failure in DebugInfo/X86/multiple-aranges.ll uncovered by D39245.

Reviewers: rafael, echristo, probinson

Reviewed By: probinson

Subscribers: probinson, llvm-commits, JDevlieghere

Tags: #debug-info

Differential Revision: https://reviews.llvm.org/D39950

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=326056&r1=326055&r2=326056&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sun Feb 25 11:52:34 2018
@@ -1780,7 +1780,7 @@ void DwarfDebug::emitDebugARanges() {
     }
 
     // Sort the symbols by offset within the section.
-    std::sort(
+    std::stable_sort(
         List.begin(), List.end(), [&](const SymbolCU &A, const SymbolCU &B) {
           unsigned IA = A.Sym ? Asm->OutStreamer->GetSymbolOrder(A.Sym) : 0;
           unsigned IB = B.Sym ? Asm->OutStreamer->GetSymbolOrder(B.Sym) : 0;




More information about the llvm-commits mailing list