diff options
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 5 |
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); } |