aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-02-07 22:59:12 +0000
committerDouglas Gregor <dgregor@apple.com>2013-02-07 22:59:12 +0000
commit250172a851a886c0763b5fd61c20bf21791c21e9 (patch)
tree8386e4b531c1ac09dbd2e41591f3269b6f29e381
parent31c4a4b0171aac01d2a6aedb4960ade7ee7d998a (diff)
Form the default -fmodules-cache-path= properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174674 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Driver/Compilation.cpp2
-rw-r--r--lib/Driver/Tools.cpp4
-rw-r--r--test/Modules/driver.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp
index 86e617211f..df904f06b7 100644
--- a/lib/Driver/Compilation.cpp
+++ b/lib/Driver/Compilation.cpp
@@ -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)
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 0da8ba421d..77c7d2270b 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -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));
}
diff --git a/test/Modules/driver.c b/test/Modules/driver.c
index 20aac0015c..0a787b996a 100644
--- a/test/Modules/driver.c
+++ b/test/Modules/driver.c
@@ -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"}}