Remove Path::getBasename.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 11 Jun 2013 19:29:48 +0000 (19:29 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 11 Jun 2013 19:29:48 +0000 (19:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183779 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 18a6e9a14202a2807f79c39baf9a135d71d70580..8c898b7140d7dcdb8fec5894c92029194cd07a51 100644 (file)
@@ -200,14 +200,6 @@ namespace sys {
       /// @brief Determines if the path name is empty (invalid).
       bool isEmpty() const { return path.empty(); }
 
-      /// This function strips off the path and suffix of the file or directory
-      /// name and returns just the basename. For example /a/foo.bar would cause
-      /// this function to return "foo".
-      /// @returns StringRef containing the basename of the path
-      /// @brief Get the base name of the path
-      LLVM_ATTRIBUTE_DEPRECATED(StringRef getBasename() const,
-        LLVM_PATH_DEPRECATED_MSG(path::stem));
-
       /// This function strips off the suffix of the path beginning with the
       /// path separator ('/' on Unix, '\' on Windows) and returns the result.
       LLVM_ATTRIBUTE_DEPRECATED(StringRef getDirname() const,
index 13bf9aaef9240f38c01bc657a58e9ec57dad5b36..a442b7f7ead8adcfb20fd9118fcfb09df08cbb10 100644 (file)
@@ -323,22 +323,6 @@ StringRef Path::getDirname() const {
   return getDirnameCharSep(path, "/");
 }
 
-StringRef
-Path::getBasename() 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(path).substr(slash);
-  else
-    return StringRef(path).substr(slash, dot - slash);
-}
-
 StringRef
 Path::getSuffix() const {
   // Find the last slash
index 44c89ad8fb653199b36fcff9072ec5470d06850d..2b75e737bac2751d73a3ad92568fc1d998962cce 100644 (file)
@@ -256,22 +256,6 @@ StringRef Path::getDirname() const {
   return getDirnameCharSep(path, "/");
 }
 
-StringRef
-Path::getBasename() 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(path).substr(slash);
-  else
-    return StringRef(path).substr(slash, dot - slash);
-}
-
 StringRef
 Path::getSuffix() const {
   // Find the last slash