diff --git a/include/llvm/Support/PathV1.h b/include/llvm/Support/PathV1.h index 550da319469..fe2dd9aff32 100644 --- a/include/llvm/Support/PathV1.h +++ b/include/llvm/Support/PathV1.h @@ -274,14 +274,6 @@ namespace sys { /// @brief Determines if the file is a regular file bool isRegularFile() const; - /// This function determines if the path name references an executable - /// file in the file system. This function checks for the existence and - /// executability (by the current program) of the file. - /// @returns true if the pathname references an executable file. - /// @brief Determines if the path is an executable file in the file - /// system. - bool canExecute() const; - /// This function builds a list of paths that are the names of the /// files and directories in a directory. /// @returns true if an error occurs, true otherwise diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index fad2697cdb6..f3e4b610563 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -338,18 +338,6 @@ Path::isRegularFile() const { return false; } -bool -Path::canExecute() const { - if (0 != access(path.c_str(), R_OK | X_OK )) - return false; - struct stat buf; - if (0 != stat(path.c_str(), &buf)) - return false; - if (!S_ISREG(buf.st_mode)) - return false; - return true; -} - const FileStatus * PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const { if (!fsIsValid || update) { diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index de33fdbc6f3..6b1e0f2bac9 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -243,13 +243,6 @@ Path::isSymLink() const { return attributes & FILE_ATTRIBUTE_REPARSE_POINT; } -bool -Path::canExecute() const { - // FIXME: take security attributes into account. - DWORD attr = GetFileAttributes(path.c_str()); - return attr != INVALID_FILE_ATTRIBUTES; -} - bool Path::isRegularFile() const { bool res;