diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-02-29 00:20:37 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-02-29 00:20:37 +0000 |
commit | d1d721660edf3f4e76ea69fd5579f857b97a3150 (patch) | |
tree | b6779d00ffbec5fc778143fb18cc1c436d164215 /lib/Support | |
parent | b6f0625de2d4a733dab2b63f6c54f59c84cefee0 (diff) | |
download | external_llvm-d1d721660edf3f4e76ea69fd5579f857b97a3150.zip external_llvm-d1d721660edf3f4e76ea69fd5579f857b97a3150.tar.gz external_llvm-d1d721660edf3f4e76ea69fd5579f857b97a3150.tar.bz2 |
Support/PathV2: Fix make_absolute() to match is_absolute() and not expect to
find root names on Unix.
- This fixes make_absolute to not basically always call current_path() on
Unix systems.
- I think the API probably needs cleanup in this area, but I'll let Michael
handle that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/PathV2.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp index bf8672b..ce97b7f 100644 --- a/lib/Support/PathV2.cpp +++ b/lib/Support/PathV2.cpp @@ -600,8 +600,12 @@ namespace fs { error_code make_absolute(SmallVectorImpl<char> &path) { StringRef p(path.data(), path.size()); - bool rootName = path::has_root_name(p), - rootDirectory = path::has_root_directory(p); + bool rootDirectory = path::has_root_directory(p), +#ifdef LLVM_ON_WIN32 + rootName = has_root_name(p); +#else + rootName = true; +#endif // Already absolute. if (rootName && rootDirectory) |