mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-30 00:32:53 +00:00
Check for (unlikely) errors from FindExecutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
62a5ff573b
commit
cc11df0ee6
@ -143,11 +143,18 @@ bool BugDriver::runPasses(Module *Program,
|
|||||||
InFile.os().clear_error();
|
InFile.os().clear_error();
|
||||||
return 1;
|
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();
|
InFile.keep();
|
||||||
|
|
||||||
// setup the child process' arguments
|
// setup the child process' arguments
|
||||||
SmallVector<const char*, 8> Args;
|
SmallVector<const char*, 8> Args;
|
||||||
sys::Path tool = FindExecutable("opt", getToolName(), (void*)"opt");
|
|
||||||
std::string Opt = tool.str();
|
std::string Opt = tool.str();
|
||||||
if (UseValgrind) {
|
if (UseValgrind) {
|
||||||
Args.push_back("valgrind");
|
Args.push_back("valgrind");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user