r221222 - [llvm-api-change] Use findProgramByName.
Michael J. Spencer
bigcheesegs at gmail.com
Mon Nov 3 17:30:55 PST 2014
Author: mspencer
Date: Mon Nov 3 19:30:55 2014
New Revision: 221222
URL: http://llvm.org/viewvc/llvm-project?rev=221222&view=rev
Log:
[llvm-api-change] Use findProgramByName.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.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=221222&r1=221221&r2=221222&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Nov 3 19:30:55 2014
@@ -1885,9 +1885,9 @@ std::string Driver::GetProgramPath(const
// If all else failed, search the path.
for (const auto &TargetSpecificExecutable : TargetSpecificExecutables) {
- std::string P(llvm::sys::FindProgramByName(TargetSpecificExecutable));
- if (!P.empty())
- return P;
+ auto P = llvm::sys::findProgramByName(TargetSpecificExecutable);
+ if (P)
+ return *P;
}
return Name;
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=221222&r1=221221&r2=221222&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Mon Nov 3 19:30:55 2014
@@ -788,7 +788,9 @@ UbigraphViz::~UbigraphViz() {
Out.reset();
llvm::errs() << "Running 'ubiviz' program... ";
std::string ErrMsg;
- std::string Ubiviz = llvm::sys::FindProgramByName("ubiviz");
+ std::string Ubiviz;
+ if (auto Path = llvm::sys::findProgramByName("ubiviz"))
+ Ubiviz = *Path;
std::vector<const char*> args;
args.push_back(Ubiviz.c_str());
args.push_back(Filename.c_str());
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=221222&r1=221221&r2=221222&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Mon Nov 3 19:30:55 2014
@@ -354,10 +354,10 @@ static void SetInstallDir(SmallVectorImp
// Do a PATH lookup, if there are no directory components.
if (llvm::sys::path::filename(InstalledPath) == InstalledPath) {
- std::string Tmp = llvm::sys::FindProgramByName(
+ auto Tmp = llvm::sys::findProgramByName(
llvm::sys::path::filename(InstalledPath.str()));
- if (!Tmp.empty())
- InstalledPath = Tmp;
+ if (Tmp)
+ InstalledPath = *Tmp;
}
llvm::sys::fs::make_absolute(InstalledPath);
InstalledPath = llvm::sys::path::parent_path(InstalledPath);
More information about the cfe-commits
mailing list