From: Rafael Espindola Date: Wed, 19 Jun 2013 13:24:29 +0000 (+0000) Subject: Use llvm::sys::fs::can_execute. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ff463e4af8615a019dbdce406dc50b74460fe2a;p=clang Use llvm::sys::fs::can_execute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184297 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 6eeb737ebc..f32a375ae5 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1579,13 +1579,16 @@ std::string Driver::GetProgramPath(const char *Name, if (!llvm::sys::fs::is_directory(*it, IsDirectory) && IsDirectory) { llvm::sys::Path P(*it); P.appendComponent(TargetSpecificExecutable); - if (P.canExecute()) return P.str(); + if (llvm::sys::fs::can_execute(P.str())) + return P.str(); P.eraseComponent(); P.appendComponent(Name); - if (P.canExecute()) return P.str(); + if (llvm::sys::fs::can_execute(P.str())) + return P.str(); } else { llvm::sys::Path P(*it + Name); - if (P.canExecute()) return P.str(); + if (llvm::sys::fs::can_execute(P.str())) + return P.str(); } } @@ -1594,10 +1597,12 @@ std::string Driver::GetProgramPath(const char *Name, it = List.begin(), ie = List.end(); it != ie; ++it) { llvm::sys::Path P(*it); P.appendComponent(TargetSpecificExecutable); - if (P.canExecute()) return P.str(); + if (llvm::sys::fs::can_execute(P.str())) + return P.str(); P.eraseComponent(); P.appendComponent(Name); - if (P.canExecute()) return P.str(); + if (llvm::sys::fs::can_execute(P.str())) + return P.str(); } // If all else failed, search the path.