diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-11 19:25:17 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-11 19:25:17 +0000 |
commit | aab313f80bc447ecd3a6073014243b108bac6855 (patch) | |
tree | 59d7d9acafcd854265856f972853f3f460e93442 /lib/Support/Unix/Path.inc | |
parent | 189c27e871763efac38c65a9786127af8d5b92b8 (diff) | |
download | llvm-aab313f80bc447ecd3a6073014243b108bac6855.tar.gz llvm-aab313f80bc447ecd3a6073014243b108bac6855.tar.bz2 llvm-aab313f80bc447ecd3a6073014243b108bac6855.tar.xz |
Remove Path::getLast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix/Path.inc')
-rw-r--r-- | lib/Support/Unix/Path.inc | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index e3f20822e5..13bf9aaef9 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -427,28 +427,6 @@ Path::canExecute() const { return true; } -StringRef -Path::getLast() const { - // Find the last slash - size_t pos = path.rfind('/'); - - // Handle the corner cases - if (pos == std::string::npos) - return path; - - // If the last character is a slash - if (pos == path.length()-1) { - // Find the second to last slash - size_t pos2 = path.rfind('/', pos-1); - if (pos2 == std::string::npos) - return StringRef(path).substr(0,pos); - else - return StringRef(path).substr(pos2+1,pos-pos2-1); - } - // Return everything after the last slash - return StringRef(path).substr(pos+1); -} - const FileStatus * PathWithStatus::getFileStatus(bool update, std::string *ErrStr) const { if (!fsIsValid || update) { |