Support/PathV1: Deprecate GetRootDirectory.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Mon, 27 Dec 2010 03:21:41 +0000 (03:21 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Mon, 27 Dec 2010 03:21:41 +0000 (03:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122580 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV1.h
lib/Support/Unix/Path.inc

index a22c40f51b375b489fe01d489565bf48a89d1608..fdf9084b5b3059a97110aad4f315d88110a16c9d 100644 (file)
@@ -98,7 +98,8 @@ namespace sys {
       /// it is file:///. Other operating systems may have different notions of
       /// what the root directory is or none at all. In that case, a consistent
       /// default root directory will be used.
-      static Path GetRootDirectory();
+      LLVM_ATTRIBUTE_DEPRECATED(static Path GetRootDirectory(),
+        LLVMV_PATH_DEPRECATED_MSG(NOTHING));
 
       /// Construct a path to a unique temporary directory that is created in
       /// a "standard" place for the operating system. The directory is
index b21245c82079e6156cee938076dfd7d9f6a0607e..886ba6bf6d418e9374e29f244d2cffe4d77a2305 100644 (file)
@@ -242,12 +242,11 @@ Path::GetLLVMDefaultConfigDir() {
 Path
 Path::GetUserHomeDirectory() {
   const char* home = getenv("HOME");
-  if (home) {
-    Path result;
-    if (result.set(home))
-      return result;
-  }
-  return GetRootDirectory();
+  Path result;
+  if (home && result.set(home))
+    return result;
+  result.set("/");
+  return result;
 }
 
 Path