Author: dgregor
Date: Sat Sep 11 12:51:16 2010
New Revision: 113695

URL: http://llvm.org/viewvc/llvm-project?rev=113695&view=rev
Log:
Tweak GetPreamblePCHPath() to more closely match the behavior of the
Windows GetTempPath() function, and be sure to create the directory in
which the precompiled preamble will reside before creating the
temporary file itself.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp
    cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=113695&r1=113694&r2=113695&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Sat Sep 11 12:51:16 2010
@@ -809,9 +809,14 @@
     TmpDir = ::getenv("TEMP");
   if (!TmpDir)
     TmpDir = ::getenv("TMP");
+#ifdef LLVM_ON_WIN32
+  if (!TmpDir)
+    TmpDir = ::getenv("USERPROFILE");
+#endif
   if (!TmpDir)
     TmpDir = "/tmp";
   llvm::sys::Path P(TmpDir);
+  P.createDirectoryOnDisk(true);
   P.appendComponent("preamble");
   P.appendSuffix("pch");
   if (P.createTemporaryFileOnDisk())

Modified: cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp?rev=113695&r1=113694&r2=113695&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp (original)
+++ cfe/trunk/test/SemaTemplate/default-expr-arguments-2.cpp Sat Sep 11 
12:51:16 2010
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -ast-dump %s 2>&1 | FileCheck %s
 
 // This is a wacky test to ensure that we're actually instantiating
-// the default rguments of the constructor when the function type is
+// the default arguments of the constructor when the function type is
 // otherwise non-dependent.
 namespace PR6733 {
   template <class T>


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to