mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 22:17:23 +08:00
Form the default -fmodules-cache-path= properly.
llvm-svn: 174674
This commit is contained in:
@@ -111,7 +111,7 @@ static bool skipArg(const char *Flag, bool &SkipNextArg) {
|
||||
bool Res = llvm::StringSwitch<bool>(Flag)
|
||||
.Cases("-I", "-MF", "-MT", "-MQ", true)
|
||||
.Cases("-o", "-coverage-file", "-dependency-file", true)
|
||||
.Cases("-fdebug-compilation-dir", "-fmodule-cache-path", "-idirafter", true)
|
||||
.Cases("-fdebug-compilation-dir", "-idirafter", true)
|
||||
.Cases("-include", "-include-pch", "-internal-isystem", true)
|
||||
.Cases("-internal-externc-isystem", "-iprefix", "-iwithprefix", true)
|
||||
.Cases("-iwithprefixbefore", "-isysroot", "-isystem", "-iquote", true)
|
||||
|
||||
@@ -2714,7 +2714,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false,
|
||||
DefaultModuleCache);
|
||||
llvm::sys::path::append(DefaultModuleCache, "clang-module-cache");
|
||||
CmdArgs.push_back("-fmodules-cache-path");
|
||||
const char Arg[] = "-fmodules-cache-path=";
|
||||
DefaultModuleCache.insert(DefaultModuleCache.begin(),
|
||||
Arg, Arg + strlen(Arg));
|
||||
CmdArgs.push_back(Args.MakeArgString(DefaultModuleCache));
|
||||
}
|
||||
|
||||
|
||||
@@ -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"}}
|
||||
// CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*clang-module-cache"}}
|
||||
|
||||
// CHECK-WITH_MODULE_CACHE: {{clang.*"-fmodules-cache-path=blarg"}}
|
||||
|
||||
Reference in New Issue
Block a user