diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-01-05 02:33:18 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-01-05 02:33:18 +0000 |
commit | 0b1c4572180545492c8054f21904e38bc3e5f575 (patch) | |
tree | ed7f670972811ad82cb062662c41ebf7e2ddafb7 /include/clang/Basic/DiagnosticCommonKinds.td | |
parent | 30940fe1ee6e7de897e4f8353561e1fe41a0e3e9 (diff) |
Reapply r321781: [Modules] Allow modules specified by -fmodule-map-file to shadow implicitly found ones
When modules come from module map files explicitly specified by
-fmodule-map-file= arguments, allow those to override/shadow modules
with the same name that are found implicitly by header search. If such a
module is looked up by name (e.g. @import), we will always find the one
from -fmodule-map-file. If we try to use a shadowed module by including
one of its headers report an error.
This enables developers to force use of a specific copy of their module
to be used if there are multiple copies that would otherwise be visible,
for example if they develop modules that are installed in the default
search paths.
Patch originally by Ben Langmuir,
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20151116/143425.html
Based on cfe-dev discussion:
http://lists.llvm.org/pipermail/cfe-dev/2015-November/046164.html
Differential Revision: https://reviews.llvm.org/D31269
rdar://problem/23612102
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticCommonKinds.td')
-rw-r--r-- | include/clang/Basic/DiagnosticCommonKinds.td | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 82ca27b734..711204a790 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -94,6 +94,9 @@ def remark_module_lock_failure : Remark< "could not acquire lock file for module '%0': %1">, InGroup<ModuleBuild>; def remark_module_lock_timeout : Remark< "timed out waiting to acquire lock file for module '%0'">, InGroup<ModuleBuild>; +def err_module_shadowed : Error<"import of shadowed module '%0'">, DefaultFatal; +def err_module_build_shadowed_submodule : Error< + "build a shadowed submodule '%0'">, DefaultFatal; def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, DefaultFatal; def err_module_prebuilt : Error< |