diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-04-07 22:01:32 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-04-07 22:01:32 +0000 |
| commit | a518bb79b1854ad624e5223508813f9aaa77a547 (patch) | |
| tree | e1217ca872827e6a88e8c28324a702f5b0fe5cfd /llvm/lib/System | |
| parent | e0680b7e7ab4a2a118c43012c8094f02044875cc (diff) | |
| download | bcm5719-llvm-a518bb79b1854ad624e5223508813f9aaa77a547.tar.gz bcm5719-llvm-a518bb79b1854ad624e5223508813f9aaa77a547.zip | |
Make getDirnameSep a static method (not part of Path's interface).
llvm-svn: 49354
Diffstat (limited to 'llvm/lib/System')
| -rw-r--r-- | llvm/lib/System/Path.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/System/Unix/Path.inc | 4 | ||||
| -rw-r--r-- | llvm/lib/System/Win32/Path.inc | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/System/Path.cpp b/llvm/lib/System/Path.cpp index 43c36d5e09b..e8fd5f29634 100644 --- a/llvm/lib/System/Path.cpp +++ b/llvm/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/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index fe2e3c67778..aca4b936e87 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/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/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc index 35bae337da7..357cb2f27ee 100644 --- a/llvm/lib/System/Win32/Path.inc +++ b/llvm/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 { |

