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

Torok Edwin edwintorok at gmail.com
Sun May 24 02:31:28 PDT 2009


Author: edwin
Date: Sun May 24 04:31:04 2009
New Revision: 72361

URL: http://llvm.org/viewvc/llvm-project?rev=72361&view=rev
Log:
Add -disable-global-remove option to bugpoint.
Sometimes when bugpointing a crash the bugpoint-reduced-simplified.bc reproduces
a totally different bug than the original one ("GV doesn't have initializer").
Although its useful to report that bug too, I need a way to reduce the original
bug, hence I introduced -disable-global-remove.

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=72361&r1=72360&r2=72361&view=diff

==============================================================================
--- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
+++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Sun May 24 04:31:04 2009
@@ -37,6 +37,10 @@
   KeepMain("keep-main",
            cl::desc("Force function reduction to keep main"),
            cl::init(false));
+  cl::opt<bool>
+  NoGlobalRM ("disable-global-remove",
+         cl::desc("Do not remove global variables"),
+         cl::init(false));
 }
 
 namespace llvm {
@@ -344,7 +348,8 @@
 static bool DebugACrash(BugDriver &BD,  bool (*TestFn)(BugDriver &, Module *)) {
   // See if we can get away with nuking some of the global variable initializers
   // in the program...
-  if (BD.getProgram()->global_begin() != BD.getProgram()->global_end()) {
+  if (!NoGlobalRM &&
+      BD.getProgram()->global_begin() != BD.getProgram()->global_end()) {
     // Now try to reduce the number of global variable initializers in the
     // module to something small.
     Module *M = CloneModule(BD.getProgram());





More information about the llvm-commits mailing list