<rdar://problem/13477190> Give the Clang module cache directory some structure, so it's easier to find.

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
This commit is contained in:
Douglas Gregor 2013-03-21 21:48:48 +00:00
parent a00790447e
commit 23c7d67de2
2 changed files with 3 additions and 2 deletions

View 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));

View 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"}}