summaryrefslogtreecommitdiff
path: root/tools/bugpoint/CrashDebugger.cpp
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
commitdf4613ced2d5d1025575f70a16f1fac9bcc2669d (patch)
treebbc27f7d8533da43eb3fe62bc82ccb2966c149f4 /tools/bugpoint/CrashDebugger.cpp
parentb96af47381e074150e7935554d34ed8b0738b325 (diff)
downloadllvm-df4613ced2d5d1025575f70a16f1fac9bcc2669d.tar.gz
llvm-df4613ced2d5d1025575f70a16f1fac9bcc2669d.tar.bz2
llvm-df4613ced2d5d1025575f70a16f1fac9bcc2669d.tar.xz
With debug info, there are nameless constant global values. do not crash when we hit one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48749 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/CrashDebugger.cpp')
-rw-r--r--tools/bugpoint/CrashDebugger.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index 2257873ac8..419e1f1998 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/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);
}