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
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 {
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());