Update the comment for system_temp_directory() to indicate when it
authorDouglas Gregor <dgregor@apple.com>
Wed, 14 Sep 2011 23:21:47 +0000 (23:21 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 14 Sep 2011 23:21:47 +0000 (23:21 +0000)
will ignore the erasedOnReboot option, and properly escape the
backslash in "C:\TEMP". Thanks to Aaron and Francois.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139755 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/PathV2.h
lib/Support/PathV2.cpp

index 8dfbd77840596da6a7d9fed7c1a83ad2968307f7..6d38c95715589b9656240e358e89b7e49aaaa7e2 100644 (file)
@@ -268,7 +268,10 @@ bool is_separator(char value);
 /// "/var/tmp" or "C:/TEMP"
 ///
 /// @param erasedOnReboot Whether to favor a path that is erased on reboot
-/// rather than one that potentially persists longer.
+/// rather than one that potentially persists longer. This parameter will be
+/// ignored if the user or system has set the typical environment variable
+/// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
+///
 /// @param Result Holds the resulting path name.
 void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
 
index 4d969fe25f96284def9ac4bbce0c520a504d54e2..b7dfe4f9a5f17932e12378f4c432ed818a001bf3 100644 (file)
@@ -510,7 +510,7 @@ void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result) {
   const char *DefaultResult;
 #ifdef LLVM_ON_WIN32
   (void)erasedOnReboot;
-  DefaultResult = "C:\TEMP";
+  DefaultResult = "C:\\TEMP";
 #else
   if (erasedOnReboot)
     DefaultResult = "/tmp";