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

Fix style.

llvm-svn: 221547
This commit is contained in:
Michael J. Spencer 2014-11-07 21:30:36 +00:00
parent fe816ec6cd
commit 6a5243a18f
2 changed files with 7 additions and 10 deletions

View File

@ -105,8 +105,7 @@ struct GraphSession {
SmallVector<StringRef, 8> parts;
Names.split(parts, "|");
for (auto Name : parts) {
auto P = sys::findProgramByName(Name);
if (P) {
if (ErrorOr<std::string> P = sys::findProgramByName(Name)) {
ProgramPath = *P;
return true;
}

View File

@ -161,11 +161,10 @@ bool BugDriver::runPasses(Module *Program,
std::string tool = OptCmd;
if (OptCmd.empty()) {
auto Path = sys::findProgramByName("opt");
if (!Path)
errs() << Path.getError().message() << "\n";
else
if (ErrorOr<std::string> Path = sys::findProgramByName("opt"))
tool = *Path;
else
errs() << Path.getError().message() << "\n";
}
if (tool.empty()) {
errs() << "Cannot find `opt' in PATH!\n";
@ -174,11 +173,10 @@ bool BugDriver::runPasses(Module *Program,
std::string Prog;
if (UseValgrind) {
auto Path = sys::findProgramByName("valgrind");
if (!Path)
errs() << Path.getError().message() << "\n";
else
if (ErrorOr<std::string> Path = sys::findProgramByName("valgrind"))
Prog = *Path;
else
errs() << Path.getError().message() << "\n";
} else
Prog = tool;
if (Prog.empty()) {