[llvm-commits] [llvm] r48749 - /llvm/trunk/tools/bugpoint/CrashDebugger.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Mon Mar 24 15:16:14 PDT 2008


Author: alenhar2
Date: Mon Mar 24 17:16:14 2008
New Revision: 48749

URL: http://llvm.org/viewvc/llvm-project?rev=48749&view=rev
Log:
With debug info, there are nameless constant global values.  do not crash when we hit one

Modified:
    llvm/trunk/tools/bugpoint/CrashDebugger.cpp

Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CrashDebugger.cpp?rev=48749&r1=48748&r2=48749&view=diff

==============================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Mon Mar 24 17:16:14 2008
@@ -125,13 +125,14 @@
 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);
   }





More information about the llvm-commits mailing list