[llvm-commits] [llvm] r54655 - in /llvm/trunk: include/llvm/System/Path.h lib/System/Unix/Path.inc lib/System/Win32/Path.inc
Chris Lattner
sabre at nondot.org
Mon Aug 11 16:39:51 PDT 2008
Author: lattner
Date: Mon Aug 11 18:39:47 2008
New Revision: 54655
URL: http://llvm.org/viewvc/llvm-project?rev=54655&view=rev
Log:
add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam!
Modified:
llvm/trunk/include/llvm/System/Path.h
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=54655&r1=54654&r2=54655&view=diff
==============================================================================
--- llvm/trunk/include/llvm/System/Path.h (original)
+++ llvm/trunk/include/llvm/System/Path.h Mon Aug 11 18:39:47 2008
@@ -202,6 +202,12 @@
return *this;
}
+ /// Makes a copy of \p that to \p this.
+ /// @param \p that A std::string denoting the path
+ /// @returns \p this
+ /// @brief Assignment Operator
+ Path &operator=(const std::string &that);
+
/// Compares \p this Path with \p that Path for equality.
/// @returns true if \p this and \p that refer to the same thing.
/// @brief Equality Operator
Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=54655&r1=54654&r2=54655&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Mon Aug 11 18:39:47 2008
@@ -81,6 +81,12 @@
Path::Path(const char *StrStart, unsigned StrLen)
: path(StrStart, StrLen) {}
+Path&
+Path::operator=(const std::string &that) {
+ path = that;
+ return *this;
+}
+
bool
Path::isValid() const {
// Check some obvious things
Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=54655&r1=54654&r2=54655&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Mon Aug 11 18:39:47 2008
@@ -56,6 +56,13 @@
FlipBackSlashes(path);
}
+Path&
+Path::operator=(const std::string &that) {
+ path = that;
+ FlipBackSlashes(path);
+ return *this;
+}
+
bool
Path::isValid() const {
if (path.empty())
More information about the llvm-commits
mailing list