[llvm-commits] [llvm] r49354 - in /llvm/trunk: include/llvm/System/Path.h lib/System/Path.cpp lib/System/Unix/Path.inc lib/System/Win32/Path.inc

Ted Kremenek kremenek at apple.com
Mon Apr 7 15:01:32 PDT 2008


Author: kremenek
Date: Mon Apr  7 17:01:32 2008
New Revision: 49354

URL: http://llvm.org/viewvc/llvm-project?rev=49354&view=rev
Log:
Make getDirnameSep a static method (not part of Path's interface).

Modified:
    llvm/trunk/include/llvm/System/Path.h
    llvm/trunk/lib/System/Path.cpp
    llvm/trunk/lib/System/Unix/Path.inc
    llvm/trunk/lib/System/Win32/Path.inc

Modified: llvm/trunk/include/llvm/System/Path.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Path.h?rev=49354&r1=49353&r2=49354&view=diff

==============================================================================
--- llvm/trunk/include/llvm/System/Path.h (original)
+++ llvm/trunk/include/llvm/System/Path.h Mon Apr  7 17:01:32 2008
@@ -571,13 +571,6 @@
       /// MemoryBuffer::getFile instead.
       static void UnMapFilePages(const char *Base, uint64_t FileSize);
     
-
-    /// @}
-    /// @name Internal methods.
-    /// @{
-    protected:
-      std::string getDirnameCharSep(char Sep) const; 
-    
     /// @}
     /// @name Data
     /// @{

Modified: llvm/trunk/lib/System/Path.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Path.cpp?rev=49354&r1=49353&r2=49354&view=diff

==============================================================================
--- llvm/trunk/lib/System/Path.cpp (original)
+++ llvm/trunk/lib/System/Path.cpp Mon Apr  7 17:01:32 2008
@@ -196,7 +196,7 @@
         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 ".";

Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=49354&r1=49353&r2=49354&view=diff

==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Mon Apr  7 17:01:32 2008
@@ -277,7 +277,9 @@
 }
 
 
-std::string Path::getDirname() const { return getDirnameCharSep('/'); }
+std::string Path::getDirname() const {
+  return getDirnameCharSep(path, '/');
+}
 
 std::string
 Path::getBasename() const {

Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=49354&r1=49353&r2=49354&view=diff

==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Mon Apr  7 17:01:32 2008
@@ -229,7 +229,9 @@
   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 {





More information about the llvm-commits mailing list