<rdar://problem/13477190> Give the Clang module cache directory some structure, so...
authorDouglas Gregor <dgregor@apple.com>
Thu, 21 Mar 2013 21:48:48 +0000 (21:48 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 21 Mar 2013 21:48:48 +0000 (21:48 +0000)
We now put the Clang module cache in
<system-temp-directory>/org.llvm.clang/ModuleCache. Perhaps some day
there will be other caches under <system-temp-directory>/org.llvm.clang>.

llvm-svn: 177671

clang/lib/Driver/Tools.cpp
clang/test/Modules/driver.c

index e0e167a..cb84e0a 100644 (file)
@@ -2803,7 +2803,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     SmallString<128> DefaultModuleCache;
     llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false,
                                            DefaultModuleCache);
-    llvm::sys::path::append(DefaultModuleCache, "clang-module-cache");
+    llvm::sys::path::append(DefaultModuleCache, "org.llvm.clang");
+    llvm::sys::path::append(DefaultModuleCache, "ModuleCache");
     const char Arg[] = "-fmodules-cache-path=";
     DefaultModuleCache.insert(DefaultModuleCache.begin(),
                               Arg, Arg + strlen(Arg));
index 0a787b9..08fdaab 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: %clang -fmodules %s -### 2>&1 | FileCheck -check-prefix NO_MODULE_CACHE %s
 // RUN: %clang -fmodules -fmodules-cache-path=blarg %s -### 2>&1 | FileCheck -check-prefix WITH_MODULE_CACHE %s
 
-// CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*clang-module-cache"}}
+// CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*ModuleCache"}}
 
 // CHECK-WITH_MODULE_CACHE: {{clang.*"-fmodules-cache-path=blarg"}}