diff options
-rw-r--r-- | llvm/include/llvm/Support/PathV1.h | 8 | ||||
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 16 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/Path.inc | 16 |
3 files changed, 0 insertions, 40 deletions
diff --git a/llvm/include/llvm/Support/PathV1.h b/llvm/include/llvm/Support/PathV1.h index 18a6e9a1420..8c898b7140d 100644 --- a/llvm/include/llvm/Support/PathV1.h +++ b/llvm/include/llvm/Support/PathV1.h @@ -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, diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 13bf9aaef92..a442b7f7ead 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -324,22 +324,6 @@ StringRef Path::getDirname() const { } 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 std::string::size_type slash = path.rfind('/'); diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index 44c89ad8fb6..2b75e737bac 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -257,22 +257,6 @@ StringRef Path::getDirname() const { } 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 size_t slash = path.rfind('/'); |