Use the simpler is_directory.

llvm-svn: 186487
This commit is contained in:
Rafael Espindola 2013-07-17 04:23:07 +00:00
parent 904165fc7c
commit a07f720a1b
2 changed files with 2 additions and 4 deletions

View File

@ -1569,8 +1569,7 @@ std::string Driver::GetProgramPath(const char *Name,
// attempting to use this prefix when looking for program paths.
for (Driver::prefix_list::const_iterator it = PrefixDirs.begin(),
ie = PrefixDirs.end(); it != ie; ++it) {
bool IsDirectory;
if (!llvm::sys::fs::is_directory(*it, IsDirectory) && IsDirectory) {
if (llvm::sys::fs::is_directory(*it)) {
SmallString<128> P(*it);
llvm::sys::path::append(P, TargetSpecificExecutable);
if (llvm::sys::fs::can_execute(Twine(P)))

View File

@ -1052,8 +1052,7 @@ static void pruneModuleCache(const HeaderSearchOptions &HSOpts) {
Dir(ModuleCachePathNative.str(), EC), DirEnd;
Dir != DirEnd && !EC; Dir.increment(EC)) {
// If we don't have a directory, there's nothing to look into.
bool IsDirectory;
if (llvm::sys::fs::is_directory(Dir->path(), IsDirectory) || !IsDirectory)
if (!llvm::sys::fs::is_directory(Dir->path()))
continue;
// Walk all of the files within this directory.