summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2008-03-24 22:16:14 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2008-03-24 22:16:14 +0000
commit5e0067d9828ed657211ba7b24b463b7f70e52db1 (patch)
tree2049db61ab680d50daa5e8cca8e389976675ba2f /llvm/tools
parent65838bb2d5e37deb7dbe1a17e50fd2786c456cd8 (diff)
downloadbcm5719-llvm-5e0067d9828ed657211ba7b24b463b7f70e52db1.tar.gz
bcm5719-llvm-5e0067d9828ed657211ba7b24b463b7f70e52db1.zip
With debug info, there are nameless constant global values. do not crash when we hit one
llvm-svn: 48749
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 2257873ac83..419e1f19987 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -125,13 +125,14 @@ bool
ReduceCrashingGlobalVariables::TestGlobalVariables(
std::vector<GlobalVariable*>& GVs) {
// Clone the program to try hacking it apart...
- Module *M = CloneModule(BD.getProgram());
+ DenseMap<const Value*, Value*> ValueMap;
+ Module *M = CloneModule(BD.getProgram(), ValueMap);
// Convert list to set for fast lookup...
std::set<GlobalVariable*> GVSet;
for (unsigned i = 0, e = GVs.size(); i != e; ++i) {
- GlobalVariable* CMGV = M->getNamedGlobal(GVs[i]->getName());
+ GlobalVariable* CMGV = cast<GlobalVariable>(ValueMap[GVs[i]]);
assert(CMGV && "Global Variable not in module?!");
GVSet.insert(CMGV);
}
OpenPOWER on IntegriCloud