aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/llvmc/CompilerDriver.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/llvmc/CompilerDriver.cpp b/tools/llvmc/CompilerDriver.cpp
index c1c9b98..82dc547 100644
--- a/tools/llvmc/CompilerDriver.cpp
+++ b/tools/llvmc/CompilerDriver.cpp
@@ -187,7 +187,8 @@ private:
void cleanup() {
if (!isSet(KEEP_TEMPS_FLAG)) {
- if (TempDir.isDirectory() && TempDir.canWrite())
+ sys::FileStatus Status;
+ if (!TempDir.getFileStatus(Status) && Status.isDir)
TempDir.eraseFromDisk(/*remove_contents=*/true);
} else {
std::cout << "Temporary files are in " << TempDir << "\n";