From 4ec1a52c5f1aa320ec696e500605e99319f46488 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 29 Jan 2014 22:06:23 +0000 Subject: [PATCH] Make the compile unit map a MapVector so that we can assume a stable output ordering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200421 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 +++-- lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 610907255b9..66be6058fd2 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2880,8 +2880,9 @@ void DwarfDebug::emitDebugRanges() { unsigned char Size = Asm->getDataLayout().getPointerSize(); // Grab the specific ranges for the compile units in the module. - for (DenseMap::iterator I = CUMap.begin(), - E = CUMap.end(); + for (MapVector::iterator + I = CUMap.begin(), + E = CUMap.end(); I != E; ++I) { DwarfCompileUnit *TheCU = I->second; diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 11695a5735d..4649cec3388 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -21,6 +21,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/StringMap.h" +#include "llvm/ADT/MapVector.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/LexicalScopes.h" #include "llvm/DebugInfo.h" @@ -334,7 +335,7 @@ class DwarfDebug : public AsmPrinterHandler { DwarfCompileUnit *FirstCU; // Maps MDNode with its corresponding DwarfCompileUnit. - DenseMap CUMap; + MapVector CUMap; // Maps subprogram MDNode with its corresponding DwarfCompileUnit. DenseMap SPMap; -- 2.34.1