]> granicus.if.org Git - clang/commitdiff
Form the default -fmodules-cache-path= properly.
authorDouglas Gregor <dgregor@apple.com>
Thu, 7 Feb 2013 22:59:12 +0000 (22:59 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 7 Feb 2013 22:59:12 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174674 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 86e617211f80419b34d174c24b7944e7d9d570c2..df904f06b7dae50c12219faab99b78a45d01c23a 100644 (file)
@@ -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)
index 0da8ba421d9140b562732bff7500256b2682cfa3..77c7d2270b1d6bd5cf0c15b0ebdc4fbdb6643329 100644 (file)
@@ -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));
   }
 
index 20aac0015c6ad4e7e27aa6f5e80bf011e6f83f3e..0a787b996a8116ecb6da5c1864e9034f8ab6e901 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"}}
+// CHECK-NO_MODULE_CACHE: {{clang.*"-fmodules-cache-path=.*clang-module-cache"}}
 
 // CHECK-WITH_MODULE_CACHE: {{clang.*"-fmodules-cache-path=blarg"}}