1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Check for (unlikely) errors from FindExecutable.

llvm-svn: 117658
This commit is contained in:
Dan Gohman 2010-10-29 16:18:26 +00:00
parent e9b4001854
commit 3419ae24eb

View File

@ -143,11 +143,18 @@ bool BugDriver::runPasses(Module *Program,
InFile.os().clear_error();
return 1;
}
sys::Path tool = FindExecutable("opt", getToolName(), (void*)"opt");
if (tool.empty()) {
errs() << "Cannot find `opt' in executable directory!\n";
return 1;
}
// Ok, everything that could go wrong before running opt is done.
InFile.keep();
// setup the child process' arguments
SmallVector<const char*, 8> Args;
sys::Path tool = FindExecutable("opt", getToolName(), (void*)"opt");
std::string Opt = tool.str();
if (UseValgrind) {
Args.push_back("valgrind");