Remove Path::getSuffix.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 14:32:51 +0000 (14:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 14:32:51 +0000 (14:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183833 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 5ed9c9fd2fee6a904b8bac2bddb350f0f17263f9..e391d2a1c7dc744d88ed441136952faf9d54da38 100644 (file)
@@ -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.
index b17b9f91dec711cc3278d0f2e9bad2e5fb9c498d..f604a79849cd95550eae1960bacaaa8163bcec8b 100644 (file)
@@ -318,23 +318,6 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
   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];
index 734e6f50d80b8cfa65ed8bed4412dd831f52e9ea..f2029841c58c7c5ed45903fa2ae5abbb11f4f822 100644 (file)
@@ -250,22 +250,6 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
 
 // 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());