summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-05-24 09:31:04 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-05-24 09:31:04 +0000
commit5bd3f7b4a24a22fdfbb03ffd3469c6c5ca601df2 (patch)
tree05f164647cf6529a4fbdb5cfa1c7e8d5387720f9
parentcd2e0cd297f6ebb72f2bf0a8ded1b04fc9a34b27 (diff)
downloadbcm5719-llvm-5bd3f7b4a24a22fdfbb03ffd3469c6c5ca601df2.tar.gz
bcm5719-llvm-5bd3f7b4a24a22fdfbb03ffd3469c6c5ca601df2.zip
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. llvm-svn: 72361
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 4225a40c743..2e43f88c711 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud