[cfe-commits] r69609 - /cfe/trunk/lib/Driver/Driver.cpp
Daniel Dunbar
daniel at zuster.org
Mon Apr 20 10:32:50 PDT 2009
Author: ddunbar
Date: Mon Apr 20 12:32:49 2009
New Revision: 69609
URL: http://llvm.org/viewvc/llvm-project?rev=69609&view=rev
Log:
If defined, use TMPDIR environment variable as location for temporary files.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=69609&r1=69608&r2=69609&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Apr 20 12:32:49 2009
@@ -1110,7 +1110,12 @@
// FIXME: This is lame; sys::Path should provide this function (in
// particular, it should know how to find the temporary files dir).
std::string Error;
- llvm::sys::Path P("/tmp/cc");
+ llvm::sys::Path P;
+ if (const char *TmpDir = ::getenv("TMPDIR"))
+ P = TmpDir;
+ else
+ P = "/tmp";
+ P.appendComponent("cc");
if (P.makeUnique(false, &Error)) {
Diag(clang::diag::err_drv_unable_to_make_temp) << Error;
return "";
More information about the cfe-commits
mailing list