From: Andrew Lenharth Date: Mon, 24 Mar 2008 22:16:14 +0000 (+0000) Subject: With debug info, there are nameless constant global values. do not crash when we... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=df4613ced2d5d1025575f70a16f1fac9bcc2669d;p=oota-llvm.git 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 --- diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 2257873ac83..419e1f19987 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -125,13 +125,14 @@ bool ReduceCrashingGlobalVariables::TestGlobalVariables( std::vector& GVs) { // Clone the program to try hacking it apart... - Module *M = CloneModule(BD.getProgram()); + DenseMap ValueMap; + Module *M = CloneModule(BD.getProgram(), ValueMap); // Convert list to set for fast lookup... std::set GVSet; for (unsigned i = 0, e = GVs.size(); i != e; ++i) { - GlobalVariable* CMGV = M->getNamedGlobal(GVs[i]->getName()); + GlobalVariable* CMGV = cast(ValueMap[GVs[i]]); assert(CMGV && "Global Variable not in module?!"); GVSet.insert(CMGV); }