mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
PR2027, Fix bugpoint's -find-bugs option, clean up the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47105 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5598b70a78
commit
1d1ef14248
@ -30,8 +30,7 @@ using namespace llvm;
|
|||||||
/// recreate the failure. This returns true if a compiler error is found.
|
/// recreate the failure. This returns true if a compiler error is found.
|
||||||
///
|
///
|
||||||
bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses) {
|
bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses) {
|
||||||
std::string Filename;
|
setPassesToRun(AllPasses);
|
||||||
std::vector<const PassInfo*> TempPass(AllPasses);
|
|
||||||
std::cout << "Starting bug finding procedure...\n\n";
|
std::cout << "Starting bug finding procedure...\n\n";
|
||||||
|
|
||||||
// Creating a reference output if necessary
|
// Creating a reference output if necessary
|
||||||
@ -45,26 +44,24 @@ bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
std::vector<const PassInfo*>::iterator I = TempPass.begin();
|
|
||||||
std::vector<const PassInfo*>::iterator E = TempPass.end();
|
|
||||||
|
|
||||||
unsigned num = 1;
|
unsigned num = 1;
|
||||||
while(1) {
|
while(1) {
|
||||||
//
|
//
|
||||||
// Step 1: Randomize the order of the optimizer passes.
|
// Step 1: Randomize the order of the optimizer passes.
|
||||||
//
|
//
|
||||||
std::random_shuffle(TempPass.begin(), TempPass.end());
|
std::random_shuffle(PassesToRun.begin(), PassesToRun.end());
|
||||||
|
|
||||||
//
|
//
|
||||||
// Step 2: Run optimizer passes on the program and check for success.
|
// Step 2: Run optimizer passes on the program and check for success.
|
||||||
//
|
//
|
||||||
std::cout << "Running selected passes on program to test for crash: ";
|
std::cout << "Running selected passes on program to test for crash: ";
|
||||||
for(int i = 0, e = TempPass.size(); i != e; i++) {
|
for(int i = 0, e = PassesToRun.size(); i != e; i++) {
|
||||||
std::cout << "-" << TempPass[i]->getPassArgument( )<< " ";
|
std::cout << "-" << PassesToRun[i]->getPassArgument( )<< " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Filename;
|
std::string Filename;
|
||||||
if(runPasses(TempPass, Filename, false)) {
|
if(runPasses(PassesToRun, Filename, false)) {
|
||||||
std::cout << "\n";
|
std::cout << "\n";
|
||||||
std::cout << "Optimizer passes caused failure!\n\n";
|
std::cout << "Optimizer passes caused failure!\n\n";
|
||||||
debugOptimizerCrash();
|
debugOptimizerCrash();
|
||||||
@ -72,7 +69,7 @@ bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses) {
|
|||||||
} else {
|
} else {
|
||||||
std::cout << "Combination " << num << " optimized successfully!\n";
|
std::cout << "Combination " << num << " optimized successfully!\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Step 3: Compile the optimized code.
|
// Step 3: Compile the optimized code.
|
||||||
//
|
//
|
||||||
@ -85,7 +82,7 @@ bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses) {
|
|||||||
std::cout << TEE.what();
|
std::cout << TEE.what();
|
||||||
return debugCodeGeneratorCrash();
|
return debugCodeGeneratorCrash();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Step 4: Run the program and compare its output to the reference
|
// Step 4: Run the program and compare its output to the reference
|
||||||
// output (created above).
|
// output (created above).
|
||||||
|
Loading…
Reference in New Issue
Block a user