In all these cases it looks like the intention was to handle error in a similar
way to the file not existing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217614
91177308-0d34-0410-b5e6-
96231b3b80d8
assert(FromToMappings.empty() &&
"initFromDisk should be called before any remap calls");
std::string infoFile = filePath;
- bool fileExists = false;
- llvm::sys::fs::exists(infoFile, fileExists);
- if (!fileExists)
+ if (!llvm::sys::fs::exists(infoFile))
return false;
std::vector<std::pair<const FileEntry *, const FileEntry *> > pairs;
I = FromToMappings.begin(), E = FromToMappings.end(); I != E; ++I) {
const FileEntry *origFE = I->first;
assert(I->second.is<llvm::MemoryBuffer *>());
- bool fileExists = false;
- fs::exists(origFE->getName(), fileExists);
- if (!fileExists)
+ if (!fs::exists(origFE->getName()))
return report(StringRef("File does not exist: ") + origFE->getName(),
Diag);
const InputInfoList &Inputs,
const ArgList &Args,
const char *LinkingOutput) const {
- bool UseGCC47 = false;
const Driver &D = getToolChain().getDriver();
ArgStringList CmdArgs;
-
- if (llvm::sys::fs::exists("/usr/lib/gcc47", UseGCC47))
- UseGCC47 = false;
+ bool UseGCC47 = llvm::sys::fs::exists("/usr/lib/gcc47");
if (!D.SysRoot.empty())
CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
return true;
}
- bool exists = false;
- sys::fs::exists(It->second, exists);
- if (!exists) {
+ if (!sys::fs::exists(It->second)) {
errs() << "error: '" << It->second << "' does not exist\n";
return true;
}
- sys::fs::exists(inputResultFname, exists);
- if (!exists) {
+ if (!sys::fs::exists(inputResultFname)) {
errs() << "error: '" << inputResultFname << "' does not exist\n";
return true;
}
}
llvm::sys::fs::make_absolute(InstalledPath);
InstalledPath = llvm::sys::path::parent_path(InstalledPath);
- bool exists;
- if (!llvm::sys::fs::exists(InstalledPath.str(), exists) && exists)
+ if (llvm::sys::fs::exists(InstalledPath.c_str()))
TheDriver.setInstalledDir(InstalledPath);
}
return nullptr;
}
- bool exists = false;
- llvm::sys::fs::exists(migrate_dir_path, exists);
- if (!exists) {
+ if (!llvm::sys::fs::exists(migrate_dir_path)) {
if (Logging) {
llvm::errs() << "Error by clang_getRemappings(\"" << migrate_dir_path
<< "\")\n";