summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CompilerDriver/Main.cpp
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-07-09 08:23:38 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-07-09 08:23:38 +0000
commita383ffa219a19fa688b925210c0bd745725905ed (patch)
treedbbf48987441be562a286c14788cf3af0066600f /llvm/lib/CompilerDriver/Main.cpp
parentc378299f790dfe972a9495dd3b8ce2c3d178686f (diff)
downloadbcm5719-llvm-a383ffa219a19fa688b925210c0bd745725905ed.tar.gz
bcm5719-llvm-a383ffa219a19fa688b925210c0bd745725905ed.zip
Add a -t="dir" option to the driver. This can be used to specify the directory to be used as TempDir if somebody doesn't want to use the standard /tmp.
llvm-svn: 75121
Diffstat (limited to 'llvm/lib/CompilerDriver/Main.cpp')
-rw-r--r--llvm/lib/CompilerDriver/Main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CompilerDriver/Main.cpp b/llvm/lib/CompilerDriver/Main.cpp
index 7d1a3d8fbc4..57d2937b339 100644
--- a/llvm/lib/CompilerDriver/Main.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud