[llvm] r204361 - Remove dead and incorrect code.

Rafael Espindola rafael.espindola at gmail.com
Thu Mar 20 10:39:04 PDT 2014


Author: rafael
Date: Thu Mar 20 12:39:04 2014
New Revision: 204361

URL: http://llvm.org/viewvc/llvm-project?rev=204361&view=rev
Log:
Remove dead and incorrect code.

is_symlink was always false since it was using stat instead of lstat.

Modified:
    llvm/trunk/include/llvm/Support/FileSystem.h
    llvm/trunk/lib/Support/Path.cpp

Modified: llvm/trunk/include/llvm/Support/FileSystem.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/FileSystem.h?rev=204361&r1=204360&r2=204361&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/FileSystem.h (original)
+++ llvm/trunk/include/llvm/Support/FileSystem.h Thu Mar 20 12:39:04 2014
@@ -454,8 +454,7 @@ inline bool is_regular_file(const Twine
 ///        directory, regular file, or symlink?
 ///
 /// @param status A file_status previously returned from status.
-/// @returns exists(s) && !is_regular_file(s) && !is_directory(s) &&
-///          !is_symlink(s)
+/// @returns exists(s) && !is_regular_file(s) && !is_directory(s)
 bool is_other(file_status status);
 
 /// @brief Is path something that exists but is not a directory,
@@ -468,21 +467,6 @@ bool is_other(file_status status);
 ///          platform specific error_code.
 error_code is_other(const Twine &path, bool &result);
 
-/// @brief Does status represent a symlink?
-///
-/// @param status A file_status previously returned from stat.
-/// @returns status.type() == symlink_file.
-bool is_symlink(file_status status);
-
-/// @brief Is path a symlink?
-///
-/// @param path Input path.
-/// @param result Set to true if \a path is a symlink, false if it is not.
-///               Undefined otherwise.
-/// @returns errc::success if result has been successfully set, otherwise a
-///          platform specific error_code.
-error_code is_symlink(const Twine &path, bool &result);
-
 /// @brief Get file status as if by POSIX stat().
 ///
 /// @param path Input path.

Modified: llvm/trunk/lib/Support/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Path.cpp?rev=204361&r1=204360&r2=204361&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Path.cpp (original)
+++ llvm/trunk/lib/Support/Path.cpp Thu Mar 20 12:39:04 2014
@@ -870,23 +870,10 @@ error_code is_regular_file(const Twine &
   return error_code::success();
 }
 
-bool is_symlink(file_status status) {
-  return status.type() == file_type::symlink_file;
-}
-
-error_code is_symlink(const Twine &path, bool &result) {
-  file_status st;
-  if (error_code ec = status(path, st))
-    return ec;
-  result = is_symlink(st);
-  return error_code::success();
-}
-
 bool is_other(file_status status) {
   return exists(status) &&
          !is_regular_file(status) &&
-         !is_directory(status) &&
-         !is_symlink(status);
+         !is_directory(status);
 }
 
 void directory_entry::replace_filename(const Twine &filename, file_status st) {





More information about the llvm-commits mailing list