r221546 - Fix style.
Michael J. Spencer
bigcheesegs at gmail.com
Fri Nov 7 13:30:32 PST 2014
Author: mspencer
Date: Fri Nov 7 15:30:32 2014
New Revision: 221546
URL: http://llvm.org/viewvc/llvm-project?rev=221546&view=rev
Log:
Fix style.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=221546&r1=221545&r2=221546&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Nov 7 15:30:32 2014
@@ -1885,11 +1885,10 @@ std::string Driver::GetProgramPath(const
}
// If all else failed, search the path.
- for (const auto &TargetSpecificExecutable : TargetSpecificExecutables) {
- auto P = llvm::sys::findProgramByName(TargetSpecificExecutable);
- if (P)
+ for (const auto &TargetSpecificExecutable : TargetSpecificExecutables)
+ if (llvm::ErrorOr<std::string> P =
+ llvm::sys::findProgramByName(TargetSpecificExecutable))
return *P;
- }
return Name;
}
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=221546&r1=221545&r2=221546&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Nov 7 15:30:32 2014
@@ -353,12 +353,10 @@ static void SetInstallDir(SmallVectorImp
SmallString<128> InstalledPath(argv[0]);
// Do a PATH lookup, if there are no directory components.
- if (llvm::sys::path::filename(InstalledPath) == InstalledPath) {
- auto Tmp = llvm::sys::findProgramByName(
- llvm::sys::path::filename(InstalledPath.str()));
- if (Tmp)
+ if (llvm::sys::path::filename(InstalledPath) == InstalledPath)
+ if (llvm::ErrorOr<std::string> Tmp = llvm::sys::findProgramByName(
+ llvm::sys::path::filename(InstalledPath.str())))
InstalledPath = *Tmp;
- }
llvm::sys::fs::make_absolute(InstalledPath);
InstalledPath = llvm::sys::path::parent_path(InstalledPath);
if (llvm::sys::fs::exists(InstalledPath.c_str()))
More information about the cfe-commits
mailing list