diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-12-23 23:49:59 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-12-23 23:49:59 +0000 |
| commit | 218e26ef3583cc3270f5f2a2b9cb1025e5b05ebe (patch) | |
| tree | c580bd5dc8fa21a0244578e71e427ebd0c410825 /tools/bugpoint/CrashDebugger.cpp | |
| parent | 18fda6d7c343afd5970bd26cfc4a80fa4503cc84 (diff) | |
Implement the start of the miscompilation detection stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/CrashDebugger.cpp')
| -rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 3c4fa2dd47..c69ca45362 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -5,6 +5,7 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" +#include "SystemUtils.h" #include "llvm/Module.h" #include "llvm/Bytecode/Writer.h" #include "llvm/Pass.h" @@ -44,8 +45,7 @@ bool BugDriver::debugCrash() { << "': " << CrashingPass->getPassName() << "\n"; // Compile the program with just the passes that don't crash. - if (LastToPass != 0) { - // Don't bother doing this if the first pass crashes... + if (LastToPass != 0) { // Don't bother doing this if the first pass crashes... std::vector<const PassInfo*> P(PassesToRun.begin(), PassesToRun.begin()+LastToPass); std::string Filename; @@ -87,7 +87,7 @@ bool BugDriver::debugPassCrash(const PassInfo *Pass) { if (CountFunctions(Program) > 1) { // Attempt to reduce the input program down to a single function that still - // crashes. + // crashes. Do this by removing everything except for that one function... // std::cout << "\n*** Attempting to reduce the testcase to one function\n"; @@ -116,5 +116,16 @@ bool BugDriver::debugPassCrash(const PassInfo *Pass) { } } + if (CountFunctions(Program) > 1) { + std::cout << "\n*** Couldn't reduce testcase to one function.\n" + << " Attempting to remove individual functions.\n"; + std::cout << "XXX Individual function removal unimplemented!\n"; + } + + // Now that we have deleted the functions that are unneccesary for the + // program, try to remove instructions and basic blocks that are not neccesary + // to cause the crash. + // + return false; } |
