summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-05-11 17:37:40 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-05-11 17:37:40 +0000
commitfff116fd58783879812198abdda2fc33d4bc1cac (patch)
treec98a8355080e18bcc45f48f0c75192f07c2608fd /lib
parent64d69102a115fff25d01662e62389da4fa56fa30 (diff)
downloadllvm-fff116fd58783879812198abdda2fc33d4bc1cac.tar.gz
llvm-fff116fd58783879812198abdda2fc33d4bc1cac.tar.bz2
llvm-fff116fd58783879812198abdda2fc33d4bc1cac.tar.xz
Make constructors target-specific. This fixes problems where the path would
include backslashes on Windows. This should fix llvm-ld problems on win32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/System/Unix/Path.inc6
-rw-r--r--lib/System/Win32/Path.inc12
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 9f4b5914ce..6035a14d27 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -75,6 +75,12 @@ using namespace sys;
extern const char sys::PathSeparator = ':';
+Path::Path(const std::string& p)
+ : path(p) {}
+
+Path::Path(const char *StrStart, unsigned StrLen)
+ : path(StrStart, StrLen) {}
+
bool
Path::isValid() const {
// Check some obvious things
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index ce5fe2a3a5..b5897053b3 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -46,6 +46,16 @@ namespace llvm {
namespace sys {
const char PathSeparator = ';';
+Path::Path(const std::string& p)
+ : path(p) {
+ FlipBackSlashes(path);
+}
+
+Path::Path(const char *StrStart, unsigned StrLen)
+ : path(StrStart, StrLen) {
+ FlipBackSlashes(path);
+}
+
bool
Path::isValid() const {
if (path.empty())
@@ -230,7 +240,7 @@ Path::isRootDirectory() const {
}
std::string Path::getDirname() const {
- return getDirnameCharSep(path, '\\');
+ return getDirnameCharSep(path, '/');
}
std::string