summaryrefslogtreecommitdiff
path: root/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-11 19:32:57 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-11 19:32:57 +0000
commit715a1be51fe25a09fcc5318cd787893a8fbfc9e1 (patch)
tree02e65335f271290a37ea2431943985c2b4758355 /lib/Support/Path.cpp
parentb4d07b770c41b285a613a5b4953fe815044fad19 (diff)
downloadllvm-715a1be51fe25a09fcc5318cd787893a8fbfc9e1.tar.gz
llvm-715a1be51fe25a09fcc5318cd787893a8fbfc9e1.tar.bz2
llvm-715a1be51fe25a09fcc5318cd787893a8fbfc9e1.tar.xz
Remove Path::getDirname.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Path.cpp')
-rw-r--r--lib/Support/Path.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp
index 2e8223b6a1..b873b9ab4a 100644
--- a/lib/Support/Path.cpp
+++ b/lib/Support/Path.cpp
@@ -91,46 +91,6 @@ bool Path::hasMagicNumber(StringRef Magic) const {
return false;
}
-static StringRef getDirnameCharSep(StringRef path, const char *Sep) {
- assert(Sep[0] != '\0' && Sep[1] == '\0' &&
- "Sep must be a 1-character string literal.");
- if (path.empty())
- return ".";
-
- // If the path is all slashes, return a single slash.
- // Otherwise, remove all trailing slashes.
-
- signed pos = static_cast<signed>(path.size()) - 1;
-
- while (pos >= 0 && path[pos] == Sep[0])
- --pos;
-
- if (pos < 0)
- return path[0] == Sep[0] ? Sep : ".";
-
- // Any slashes left?
- signed i = 0;
-
- while (i < pos && path[i] != Sep[0])
- ++i;
-
- if (i == pos) // No slashes? Return "."
- return ".";
-
- // There is at least one slash left. Remove all trailing non-slashes.
- while (pos >= 0 && path[pos] != Sep[0])
- --pos;
-
- // Remove any trailing slashes.
- while (pos >= 0 && path[pos] == Sep[0])
- --pos;
-
- if (pos < 0)
- return path[0] == Sep[0] ? Sep : ".";
-
- return path.substr(0, pos+1);
-}
-
// Include the truly platform-specific parts of this class.
#if defined(LLVM_ON_UNIX)
#include "Unix/Path.inc"