mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 22:07:27 +00:00
Remove stupid thinko that was preventing bugpoint from working
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
24271cf8d7
commit
b417c795d2
@ -39,32 +39,37 @@ DebugCrashes::TestResult
|
||||
DebugCrashes::doTest(std::vector<const PassInfo*> &Prefix,
|
||||
std::vector<const PassInfo*> &Suffix) {
|
||||
std::string PrefixOutput;
|
||||
Module *OrigProgram = 0;
|
||||
if (!Prefix.empty()) {
|
||||
std::cout << "Checking to see if these passes crash: "
|
||||
<< getPassesString(Prefix) << ": ";
|
||||
if (BD.runPasses(Prefix, PrefixOutput))
|
||||
return KeepPrefix;
|
||||
|
||||
OrigProgram = BD.Program;
|
||||
|
||||
BD.Program = BD.ParseInputFile(PrefixOutput);
|
||||
if (BD.Program == 0) {
|
||||
std::cerr << BD.getToolName() << ": Error reading bytecode file '"
|
||||
<< PrefixOutput << "'!\n";
|
||||
exit(1);
|
||||
}
|
||||
removeFile(PrefixOutput);
|
||||
}
|
||||
|
||||
std::cout << "Checking to see if these passes crash: "
|
||||
<< getPassesString(Suffix) << ": ";
|
||||
Module *OrigProgram = BD.Program;
|
||||
BD.Program = BD.ParseInputFile(PrefixOutput);
|
||||
if (BD.Program == 0) {
|
||||
std::cerr << BD.getToolName() << ": Error reading bytecode file '"
|
||||
<< PrefixOutput << "'!\n";
|
||||
exit(1);
|
||||
}
|
||||
removeFile(PrefixOutput);
|
||||
|
||||
|
||||
if (BD.runPasses(Suffix)) {
|
||||
delete OrigProgram; // The suffix crashes alone...
|
||||
return KeepSuffix;
|
||||
}
|
||||
|
||||
// Nothing failed, restore state...
|
||||
delete BD.Program;
|
||||
BD.Program = OrigProgram;
|
||||
if (OrigProgram) {
|
||||
delete BD.Program;
|
||||
BD.Program = OrigProgram;
|
||||
}
|
||||
return NoFailure;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user