aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-07 22:01:32 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-07 22:01:32 +0000
commit9b01cc0ede3bfef32ce46159670dedc3e9769a64 (patch)
treedb65b3617c28ba9aa88c3f60781f477c516c97d2
parentcf55c8e221c1d31a361f99ee49078d261cdf431c (diff)
downloadexternal_llvm-9b01cc0ede3bfef32ce46159670dedc3e9769a64.zip
external_llvm-9b01cc0ede3bfef32ce46159670dedc3e9769a64.tar.gz
external_llvm-9b01cc0ede3bfef32ce46159670dedc3e9769a64.tar.bz2
Make getDirnameSep a static method (not part of Path's interface).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49354 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/System/Path.h7
-rw-r--r--lib/System/Path.cpp2
-rw-r--r--lib/System/Unix/Path.inc4
-rw-r--r--lib/System/Win32/Path.inc4
4 files changed, 7 insertions, 10 deletions
diff --git a/include/llvm/System/Path.h b/include/llvm/System/Path.h
index 5846fa9..36b48e7 100644
--- a/include/llvm/System/Path.h
+++ b/include/llvm/System/Path.h
@@ -571,13 +571,6 @@ namespace sys {
/// MemoryBuffer::getFile instead.
static void UnMapFilePages(const char *Base, uint64_t FileSize);
-
- /// @}
- /// @name Internal methods.
- /// @{
- protected:
- std::string getDirnameCharSep(char Sep) const;
-
/// @}
/// @name Data
/// @{
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp
index 43c36d5..e8fd5f2 100644
--- a/lib/System/Path.cpp
+++ b/lib/System/Path.cpp
@@ -196,7 +196,7 @@ static void getPathList(const char*path, std::vector<Path>& Paths) {
Paths.push_back(tmpPath);
}
-std::string Path::getDirnameCharSep(char Sep) const {
+static std::string getDirnameCharSep(const std::string& path, char Sep) {
if (path.empty())
return ".";
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index fe2e3c6..aca4b93 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -277,7 +277,9 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
}
-std::string Path::getDirname() const { return getDirnameCharSep('/'); }
+std::string Path::getDirname() const {
+ return getDirnameCharSep(path, '/');
+}
std::string
Path::getBasename() const {
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 35bae33..357cb2f 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -229,7 +229,9 @@ Path::isRootDirectory() const {
return len > 0 && path[len-1] == '/';
}
-std::string Path::getDirname() const { return getDirnameCharSep('\\'); }
+std::string Path::getDirname() const {
+ return getDirnameCharSep(path, '\\');
+}
std::string
Path::getBasename() const {