projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a missing error handling to llvm-lto.
[oota-llvm.git]
/
tools
/
bugpoint
/
FindBugs.cpp
diff --git
a/tools/bugpoint/FindBugs.cpp
b/tools/bugpoint/FindBugs.cpp
index 224c71747a6f5c8c4acaee0a42fcd987d3da8c5b..a0c859b7f33e9a1c8f1d217d0bb00f6fdc862458 100644
(file)
--- a/
tools/bugpoint/FindBugs.cpp
+++ b/
tools/bugpoint/FindBugs.cpp
@@
-17,6
+17,7
@@
#include "BugDriver.h"
#include "ToolRunner.h"
#include "llvm/Pass.h"
#include "BugDriver.h"
#include "ToolRunner.h"
#include "llvm/Pass.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <ctime>
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <ctime>
@@
-29,7
+30,7
@@
using namespace llvm;
/// If the passes did not compile correctly, output the command required to
/// recreate the failure. This returns true if a compiler error is found.
///
/// If the passes did not compile correctly, output the command required to
/// 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<
std::string
> &AllPasses,
std::string &ErrMsg) {
setPassesToRun(AllPasses);
outs() << "Starting bug finding procedure...\n\n";
std::string &ErrMsg) {
setPassesToRun(AllPasses);
outs() << "Starting bug finding procedure...\n\n";
@@
-44,7
+45,7
@@
bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses,
return false;
}
return false;
}
- srand(time(
NULL));
+ srand(time(
nullptr));
unsigned num = 1;
while(1) {
unsigned num = 1;
while(1) {
@@
-58,11
+59,11
@@
bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses,
//
outs() << "Running selected passes on program to test for crash: ";
for(int i = 0, e = PassesToRun.size(); i != e; i++) {
//
outs() << "Running selected passes on program to test for crash: ";
for(int i = 0, e = PassesToRun.size(); i != e; i++) {
- outs() << "-" << PassesToRun[i]
->getPassArgument()
<< " ";
+ outs() << "-" << PassesToRun[i] << " ";
}
std::string Filename;
}
std::string Filename;
- if(runPasses(PassesToRun, Filename, false)) {
+ if(runPasses(P
rogram, P
assesToRun, Filename, false)) {
outs() << "\n";
outs() << "Optimizer passes caused failure!\n\n";
debugOptimizerCrash();
outs() << "\n";
outs() << "Optimizer passes caused failure!\n\n";
debugOptimizerCrash();
@@
-89,7
+90,7
@@
bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses,
// output (created above).
//
outs() << "*** Checking if passes caused miscompliation:\n";
// output (created above).
//
outs() << "*** Checking if passes caused miscompliation:\n";
- bool Diff = diffProgram(Filename, "", false, &Error);
+ bool Diff = diffProgram(
Program,
Filename, "", false, &Error);
if (Error.empty() && Diff) {
outs() << "\n*** diffProgram returned true!\n";
debugMiscompilation(&Error);
if (Error.empty() && Diff) {
outs() << "\n*** diffProgram returned true!\n";
debugMiscompilation(&Error);
@@
-103,7
+104,7
@@
bool BugDriver::runManyPasses(const std::vector<const PassInfo*> &AllPasses,
}
outs() << "\n*** diff'd output matches!\n";
}
outs() << "\n*** diff'd output matches!\n";
- sys::
Path(Filename).eraseFromDisk(
);
+ sys::
fs::remove(Filename
);
outs() << "\n\n";
num++;
outs() << "\n\n";
num++;