diff options
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/Unix/Path.inc | 16 | ||||
-rw-r--r-- | lib/Support/Windows/Path.inc | 16 |
2 files changed, 0 insertions, 32 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index 13bf9aaef9..a442b7f7ea 100644 --- a/lib/Support/Unix/Path.inc +++ b/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/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index 44c89ad8fb..2b75e737ba 100644 --- a/lib/Support/Windows/Path.inc +++ b/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('/'); |