summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2016-12-15 23:37:38 +0000
committerDavid Blaikie <dblaikie@gmail.com>2016-12-15 23:37:38 +0000
commit38b74bf249a59ebe5bb1664c69fa46c2a8ab4eb3 (patch)
tree60b95d597e8e3b5e8b042b81bb9ee7015c4e8430 /llvm/lib/CodeGen/AsmPrinter
parent327f942876d0fb83a3650cda6d4042112291b44a (diff)
downloadbcm5719-llvm-38b74bf249a59ebe5bb1664c69fa46c2a8ab4eb3.tar.gz
bcm5719-llvm-38b74bf249a59ebe5bb1664c69fa46c2a8ab4eb3.zip
DebugInfo: Address non-deterministic output (iterating a SmallPtrSet) in 289697
Post-commit review feedback from Adrian Prantl. Hopefully this fixes that up :) llvm-svn: 289892
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp1
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h11
3 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index e313b8aa91c..5f9506cd540 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -569,8 +569,6 @@ DIE *DwarfCompileUnit::createScopeChildrenDIE(LexicalScope *Scope,
}
void DwarfCompileUnit::constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope) {
- DD->getProcessedSPNodes().insert(Sub);
-
DIE &ScopeDIE = updateSubprogramScopeDIE(Sub);
if (Scope) {
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 384c0abc79e..f83a340219d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1212,6 +1212,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
constructAbstractSubprogramScopeDIE(AScope);
}
+ ProcessedSPNodes.insert(SP);
TheCU.constructSubprogramScopeDIE(SP, FnScope);
if (auto *SkelCU = TheCU.getSkeleton())
if (!LScopes.getAbstractScopesList().empty() &&
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 42503c7fe3e..e5bf33db81f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -22,6 +22,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/CodeGen/DIE.h"
@@ -216,7 +217,9 @@ class DwarfDebug : public DebugHandlerBase {
/// This is a collection of subprogram MDNodes that are processed to
/// create DIEs.
- SmallPtrSet<const DISubprogram *, 16> ProcessedSPNodes;
+ SetVector<const DISubprogram *, SmallVector<const DISubprogram *, 16>,
+ SmallPtrSet<const DISubprogram *, 16>>
+ ProcessedSPNodes;
/// If nonnull, stores the current machine function we're processing.
const MachineFunction *CurFn;
@@ -550,12 +553,6 @@ public:
/// A helper function to check whether the DIE for a given Scope is
/// going to be null.
bool isLexicalScopeDIENull(LexicalScope *Scope);
-
- // FIXME: Sink these functions down into DwarfFile/Dwarf*Unit.
-
- SmallPtrSet<const DISubprogram *, 16> &getProcessedSPNodes() {
- return ProcessedSPNodes;
- }
};
} // End of namespace llvm
OpenPOWER on IntegriCloud