[llvm-commits] [llvm] r139755 - in /llvm/trunk: include/llvm/Support/PathV2.h lib/Support/PathV2.cpp

Douglas Gregor dgregor at apple.com
Wed Sep 14 16:21:47 PDT 2011


Author: dgregor
Date: Wed Sep 14 18:21:47 2011
New Revision: 139755

URL: http://llvm.org/viewvc/llvm-project?rev=139755&view=rev
Log:
Update the comment for system_temp_directory() to indicate when it
will ignore the erasedOnReboot option, and properly escape the
backslash in "C:\TEMP". Thanks to Aaron and Francois.

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

Modified: llvm/trunk/include/llvm/Support/PathV2.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV2.h?rev=139755&r1=139754&r2=139755&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/PathV2.h (original)
+++ llvm/trunk/include/llvm/Support/PathV2.h Wed Sep 14 18:21:47 2011
@@ -268,7 +268,10 @@
 /// "/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);
 

Modified: llvm/trunk/lib/Support/PathV2.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PathV2.cpp?rev=139755&r1=139754&r2=139755&view=diff
==============================================================================
--- llvm/trunk/lib/Support/PathV2.cpp (original)
+++ llvm/trunk/lib/Support/PathV2.cpp Wed Sep 14 18:21:47 2011
@@ -510,7 +510,7 @@
   const char *DefaultResult;
 #ifdef LLVM_ON_WIN32
   (void)erasedOnReboot;
-  DefaultResult = "C:\TEMP";
+  DefaultResult = "C:\\TEMP";
 #else
   if (erasedOnReboot)
     DefaultResult = "/tmp";





More information about the llvm-commits mailing list