[llvm-commits] CVS: llvm/tools/bugpoint/CrashDebugger.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Sun Mar 5 14:21:48 PST 2006



Changes in directory llvm/tools/bugpoint:

CrashDebugger.cpp updated: 1.45 -> 1.46
---
Log message:

For transforms the behave differently if main goes away, add an option to prevent bugpoint from removing main

---
Diffs of the changes:  (+13 -0)

 CrashDebugger.cpp |   13 +++++++++++++
 1 files changed, 13 insertions(+)


Index: llvm/tools/bugpoint/CrashDebugger.cpp
diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.45 llvm/tools/bugpoint/CrashDebugger.cpp:1.46
--- llvm/tools/bugpoint/CrashDebugger.cpp:1.45	Mon Aug  1 21:16:17 2005
+++ llvm/tools/bugpoint/CrashDebugger.cpp	Sun Mar  5 16:21:36 2006
@@ -27,10 +27,18 @@
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Support/FileUtilities.h"
+#include "llvm/Support/CommandLine.h"
 #include <fstream>
 #include <set>
 using namespace llvm;
 
+namespace {
+  cl::opt<bool>
+  KeepMain("keep-main",
+           cl::desc("Force function reduction to keep main"),
+           cl::init(false));
+}
+
 namespace llvm {
   class ReducePassList : public ListReducer<const PassInfo*> {
     BugDriver &BD;
@@ -109,6 +117,11 @@
 }
 
 bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) {
+
+  //if main isn't present, claim there is no problem
+  if (KeepMain && find(Funcs.begin(), Funcs.end(), BD.getProgram()->getMainFunction()) == Funcs.end())
+    return false;
+
   // Clone the program to try hacking it apart...
   Module *M = CloneModule(BD.getProgram());
 






More information about the llvm-commits mailing list