Windows GetTempPath() function, and be sure to create the directory in
which the precompiled preamble will reside before creating the
temporary file itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113695
91177308-0d34-0410-b5e6-
96231b3b80d8
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())
// 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>