diff options
| author | Andrew Lenharth <andrewl@lenharth.org> | 2006-03-05 22:21:36 +0000 |
|---|---|---|
| committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-03-05 22:21:36 +0000 |
| commit | ef9aa1294a65a76accc209ab3cf6cc8e1f41cce1 (patch) | |
| tree | d1f1383be39dd2b1846e3941250023bd6a5c221c /llvm/tools/bugpoint/CrashDebugger.cpp | |
| parent | 55e2aac24b1c44f3a38024cd37d6b1c336884ab8 (diff) | |
| download | bcm5719-llvm-ef9aa1294a65a76accc209ab3cf6cc8e1f41cce1.tar.gz bcm5719-llvm-ef9aa1294a65a76accc209ab3cf6cc8e1f41cce1.zip | |
For transforms the behave differently if main goes away, add an option to prevent bugpoint from removing main
llvm-svn: 26557
Diffstat (limited to 'llvm/tools/bugpoint/CrashDebugger.cpp')
| -rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index 0d04b2563fe..85e2a89504d 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -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 @@ namespace llvm { } 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()); |

