[llvm-commits] [llvm] r151681 - /llvm/trunk/lib/Support/PathV2.cpp

Daniel Dunbar daniel at zuster.org
Tue Feb 28 16:20:37 PST 2012


Author: ddunbar
Date: Tue Feb 28 18:20:37 2012
New Revision: 151681

URL: http://llvm.org/viewvc/llvm-project?rev=151681&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Support/PathV2.cpp

Modified: llvm/trunk/lib/Support/PathV2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PathV2.cpp?rev=151681&r1=151680&r2=151681&view=diff
==============================================================================
--- llvm/trunk/lib/Support/PathV2.cpp (original)
+++ llvm/trunk/lib/Support/PathV2.cpp Tue Feb 28 18:20:37 2012
@@ -600,8 +600,12 @@
 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)





More information about the llvm-commits mailing list