summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-03-03 08:12:05 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-03-03 08:12:05 +0000
commit977d67c59b37da172304bcda668101152324e8cb (patch)
tree61de27a504a7ed38138ef86cd77d7dae63ba6ef9 /lib/Frontend/CompilerInvocation.cpp
parentfe52454d1c9a93e746b10ab01bb996652d9cffb3 (diff)
downloadclang-977d67c59b37da172304bcda668101152324e8cb.tar.gz
clang-977d67c59b37da172304bcda668101152324e8cb.tar.bz2
clang-977d67c59b37da172304bcda668101152324e8cb.tar.xz
Introduce '-fmodules-user-build-path' which accepts the "canonical" path to a user workspace build.
This is used to avoid conflicts with user modules with the same name from different workspaces. rdar://16042513 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 85aae236b8..f8cb938866 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -918,6 +918,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
Opts.UseLibcxx = (strcmp(A->getValue(), "libc++") == 0);
Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir);
Opts.ModuleCachePath = Args.getLastArgValue(OPT_fmodules_cache_path);
+ Opts.ModuleUserBuildPath = Args.getLastArgValue(OPT_fmodules_user_build_path);
Opts.DisableModuleHash = Args.hasArg(OPT_fdisable_module_hash);
// -fmodules implies -fmodule-maps
Opts.ModuleMaps = Args.hasArg(OPT_fmodule_maps) || Args.hasArg(OPT_fmodules);
@@ -1821,6 +1822,9 @@ std::string CompilerInvocation::getModuleHash() const {
hsOpts.UseStandardCXXIncludes,
hsOpts.UseLibcxx);
+ // Extend the signature with the user build path.
+ code = hash_combine(code, hsOpts.ModuleUserBuildPath);
+
// Darwin-specific hack: if we have a sysroot, use the contents and
// modification time of
// $sysroot/System/Library/CoreServices/SystemVersion.plist