diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2014-11-07 21:30:36 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2014-11-07 21:30:36 +0000 |
commit | d48829b9582d4f7f29a519c13689dac8d89522c9 (patch) | |
tree | 42be33d6c6b7c373e3c673fa74c4d23c33e65ab4 /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | b011d48282007ab6cd3363aeb108adbecdb3f213 (diff) | |
download | bcm5719-llvm-d48829b9582d4f7f29a519c13689dac8d89522c9.tar.gz bcm5719-llvm-d48829b9582d4f7f29a519c13689dac8d89522c9.zip |
Fix style.
llvm-svn: 221547
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index 752fc8950e5..f197cc53926 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -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()) { |