diff options
author | Torok Edwin <edwintorok@gmail.com> | 2009-05-24 09:31:04 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2009-05-24 09:31:04 +0000 |
commit | 23d471f62eed3518fe7737dbccee52faec4ffe75 (patch) | |
tree | 75c693737d970c9e206cb43400c510bb7f7b5f05 /tools/bugpoint/CrashDebugger.cpp | |
parent | 7d869fb062aee8a3de7dad23eb48d7a5d2d64190 (diff) | |
download | llvm-23d471f62eed3518fe7737dbccee52faec4ffe75.tar.gz llvm-23d471f62eed3518fe7737dbccee52faec4ffe75.tar.bz2 llvm-23d471f62eed3518fe7737dbccee52faec4ffe75.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/CrashDebugger.cpp')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 4225a40c74..2e43f88c71 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -37,6 +37,10 @@ namespace { 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 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) { 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()); |