summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-11 23:39:47 +0000
committerChris Lattner <sabre@nondot.org>2008-08-11 23:39:47 +0000
commitb56e07e73689ee9edd918d01918640539382dab8 (patch)
treee1f427b4d203e2e575476fc71be9ecbcbb720933 /llvm/lib
parent52f026058260893a505186cd18c31c8ad5257680 (diff)
downloadbcm5719-llvm-b56e07e73689ee9edd918d01918640539382dab8.tar.gz
bcm5719-llvm-b56e07e73689ee9edd918d01918640539382dab8.zip
add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam! llvm-svn: 54655
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/System/Unix/Path.inc6
-rw-r--r--llvm/lib/System/Win32/Path.inc7
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 73ccbfbbbf6..cdb574fc01a 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -81,6 +81,12 @@ Path::Path(const std::string& p)
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
diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc
index bb1252cfdd2..ff96e33dfad 100644
--- a/llvm/lib/System/Win32/Path.inc
+++ b/llvm/lib/System/Win32/Path.inc
@@ -56,6 +56,13 @@ Path::Path(const char *StrStart, unsigned StrLen)
FlipBackSlashes(path);
}
+Path&
+Path::operator=(const std::string &that) {
+ path = that;
+ FlipBackSlashes(path);
+ return *this;
+}
+
bool
Path::isValid() const {
if (path.empty())
OpenPOWER on IntegriCloud