[llvm] r183833 - Remove Path::getSuffix.

Rafael Espindola rafael.espindola at gmail.com
Wed Jun 12 07:32:51 PDT 2013


Author: rafael
Date: Wed Jun 12 09:32:51 2013
New Revision: 183833

URL: http://llvm.org/viewvc/llvm-project?rev=183833&view=rev
Log:
Remove Path::getSuffix.

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

Modified: llvm/trunk/include/llvm/Support/PathV1.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV1.h?rev=183833&r1=183832&r2=183833&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PathV1.h (original)
+++ llvm/trunk/include/llvm/Support/PathV1.h Wed Jun 12 09:32:51 2013
@@ -200,14 +200,7 @@ namespace sys {
       /// @brief Determines if the path name is empty (invalid).
       bool isEmpty() const { return path.empty(); }
 
-      /// This function strips off the path and basename(up to and
-      /// including the last dot) of the file or directory name and
-      /// returns just the suffix. For example /a/foo.bar would cause
-      /// this function to return "bar".
-      /// @returns StringRef containing the suffix of the path
-      /// @brief Get the suffix of the path
-      LLVM_ATTRIBUTE_DEPRECATED(StringRef getSuffix() const,
-        LLVM_PATH_DEPRECATED_MSG(path::extension));
+
 
       /// Obtain a 'C' string for the path name.
       /// @returns a 'C' string containing the path name.

Modified: llvm/trunk/lib/Support/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=183833&r1=183832&r2=183833&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Path.inc (original)
+++ llvm/trunk/lib/Support/Unix/Path.inc Wed Jun 12 09:32:51 2013
@@ -318,23 +318,6 @@ Path Path::GetMainExecutable(const char
   return Path();
 }
 
-
-StringRef
-Path::getSuffix() const {
-  // Find the last slash
-  std::string::size_type slash = path.rfind('/');
-  if (slash == std::string::npos)
-    slash = 0;
-  else
-    slash++;
-
-  std::string::size_type dot = path.rfind('.');
-  if (dot == std::string::npos || dot < slash)
-    return StringRef();
-  else
-    return StringRef(path).substr(dot + 1);
-}
-
 bool Path::getMagicNumber(std::string &Magic, unsigned len) const {
   assert(len < 1024 && "Request for magic string too long");
   char Buf[1025];

Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=183833&r1=183832&r2=183833&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Wed Jun 12 09:32:51 2013
@@ -250,22 +250,6 @@ Path Path::GetMainExecutable(const char
 
 // FIXME: the above set of functions don't map to Windows very well.
 
-StringRef
-Path::getSuffix() const {
-  // Find the last slash
-  size_t slash = path.rfind('/');
-  if (slash == std::string::npos)
-    slash = 0;
-  else
-    slash++;
-
-  size_t dot = path.rfind('.');
-  if (dot == std::string::npos || dot < slash)
-    return StringRef("");
-  else
-    return StringRef(path).substr(dot + 1);
-}
-
 bool
 Path::exists() const {
   DWORD attr = GetFileAttributes(path.c_str());





More information about the llvm-commits mailing list