diff options
| author | Andrew Lenharth <andrewl@lenharth.org> | 2008-03-24 22:16:14 +0000 |
|---|---|---|
| committer | Andrew Lenharth <andrewl@lenharth.org> | 2008-03-24 22:16:14 +0000 |
| commit | 5e0067d9828ed657211ba7b24b463b7f70e52db1 (patch) | |
| tree | 2049db61ab680d50daa5e8cca8e389976675ba2f /llvm/tools | |
| parent | 65838bb2d5e37deb7dbe1a17e50fd2786c456cd8 (diff) | |
| download | bcm5719-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.cpp | 5 |
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); } |

