aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CompilerDriver/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CompilerDriver/Main.cpp')
-rw-r--r--lib/CompilerDriver/Main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CompilerDriver/Main.cpp b/lib/CompilerDriver/Main.cpp
index 7d1a3d8..57d2937 100644
--- a/lib/CompilerDriver/Main.cpp
+++ b/lib/CompilerDriver/Main.cpp
@@ -31,6 +31,15 @@ namespace {
sys::Path getTempDir() {
sys::Path tempDir;
+ if (! TempDirname.empty() {
+ tempDir = TempDirname;
+ if (!tempDir.exists()) {
+ std::string ErrMsg;
+ if (tempDir.createDirectoryOnDisk(true, &ErrMsg))
+ throw std::runtime_error(ErrMsg);
+ }
+ }
+
// GCC 4.5-style -save-temps handling.
if (SaveTemps == SaveTempsEnum::Unset) {
tempDir = sys::Path::GetTemporaryDirectory();