[llvm] r221547 - Fix style.
Michael J. Spencer
bigcheesegs at gmail.com
Fri Nov 7 13:30:37 PST 2014
Author: mspencer
Date: Fri Nov 7 15:30:36 2014
New Revision: 221547
URL: http://llvm.org/viewvc/llvm-project?rev=221547&view=rev
Log:
Fix style.
Modified:
llvm/trunk/lib/Support/GraphWriter.cpp
llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Modified: llvm/trunk/lib/Support/GraphWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/GraphWriter.cpp?rev=221547&r1=221546&r2=221547&view=diff
==============================================================================
--- llvm/trunk/lib/Support/GraphWriter.cpp (original)
+++ llvm/trunk/lib/Support/GraphWriter.cpp Fri Nov 7 15:30:36 2014
@@ -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;
}
Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=221547&r1=221546&r2=221547&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Fri Nov 7 15:30:36 2014
@@ -161,11 +161,10 @@ bool BugDriver::runPasses(Module *Progra
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 *Progra
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()) {
More information about the llvm-commits
mailing list