Remove Path::canExecute.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 19 Jun 2013 13:25:31 +0000 (13:25 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 19 Jun 2013 13:25:31 +0000 (13:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184298 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV1.h
lib/Support/Unix/Path.inc
lib/Support/Windows/Path.inc

index 550da319469beccc4bebcbfe54f924fa4cb07c95..fe2dd9aff327398fd8490423e315d6c33774e1fc 100644 (file)
@@ -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
index fad2697cdb6abbf9108e18affdc5f5f52a114c95..f3e4b610563cf7a99c8bc52b30514b900b559eae 100644 (file)
@@ -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) {
index de33fdbc6f3476e777b199c2798c011ba645c1e7..6b1e0f2bac92292ae6375b70cf6e7393703b0cb3 100644 (file)
@@ -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;