// 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;
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());
// 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);