From fc44e88cbdf013d285f2e4e3962fb80dcad56770 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Wed, 3 Oct 2012 19:52:37 +0000 Subject: Remove useless parameter "WantFile" from Driver::GetProgramPath(). This parameter is useless because nowhere used explicitly and always gets its default value - "false". The patch reviewed by Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165149 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Driver.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'lib/Driver/Driver.cpp') diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 254c419b3d..1897a63196 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1620,14 +1620,8 @@ std::string Driver::GetFilePath(const char *Name, const ToolChain &TC) const { return Name; } -static bool isPathExecutable(llvm::sys::Path &P, bool WantFile) { - bool Exists; - return (WantFile ? !llvm::sys::fs::exists(P.str(), Exists) && Exists - : P.canExecute()); -} - -std::string Driver::GetProgramPath(const char *Name, const ToolChain &TC, - bool WantFile) const { +std::string Driver::GetProgramPath(const char *Name, + const ToolChain &TC) const { // FIXME: Needs a better variable than DefaultTargetTriple std::string TargetSpecificExecutable(DefaultTargetTriple + "-" + Name); // Respect a limited subset of the '-Bprefix' functionality in GCC by @@ -1636,10 +1630,10 @@ std::string Driver::GetProgramPath(const char *Name, const ToolChain &TC, ie = PrefixDirs.end(); it != ie; ++it) { llvm::sys::Path P(*it); P.appendComponent(TargetSpecificExecutable); - if (isPathExecutable(P, WantFile)) return P.str(); + if (P.canExecute()) return P.str(); P.eraseComponent(); P.appendComponent(Name); - if (isPathExecutable(P, WantFile)) return P.str(); + if (P.canExecute()) return P.str(); } const ToolChain::path_list &List = TC.getProgramPaths(); @@ -1647,10 +1641,10 @@ std::string Driver::GetProgramPath(const char *Name, const ToolChain &TC, it = List.begin(), ie = List.end(); it != ie; ++it) { llvm::sys::Path P(*it); P.appendComponent(TargetSpecificExecutable); - if (isPathExecutable(P, WantFile)) return P.str(); + if (P.canExecute()) return P.str(); P.eraseComponent(); P.appendComponent(Name); - if (isPathExecutable(P, WantFile)) return P.str(); + if (P.canExecute()) return P.str(); } // If all else failed, search the path. -- cgit v1.2.3