r174674 - Form the default -fmodules-cache-path= properly.

Douglas Gregor dgregor at apple.com
Thu Feb 7 14:59:12 PST 2013


Author: dgregor
Date: Thu Feb  7 16:59:12 2013
New Revision: 174674

URL: http://llvm.org/viewvc/llvm-project?rev=174674&view=rev
Log:
Form the default -fmodules-cache-path= properly.

Modified:
    cfe/trunk/lib/Driver/Compilation.cpp
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Modules/driver.c

Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=174674&r1=174673&r2=174674&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Thu Feb  7 16:59:12 2013
@@ -111,7 +111,7 @@ static bool skipArg(const char *Flag, bo
   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)

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=174674&r1=174673&r2=174674&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Feb  7 16:59:12 2013
@@ -2714,7 +2714,9 @@ void Clang::ConstructJob(Compilation &C,
     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));
   }
 

Modified: cfe/trunk/test/Modules/driver.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/driver.c?rev=174674&r1=174673&r2=174674&view=diff
==============================================================================
--- cfe/trunk/test/Modules/driver.c (original)
+++ cfe/trunk/test/Modules/driver.c Thu Feb  7 16:59:12 2013
@@ -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"}}





More information about the cfe-commits mailing list