diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-08-26 17:16:46 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-08-26 17:16:46 +0000 |
commit | 5423d8c4fc3b8ba5756f2e16479552191d59e992 (patch) | |
tree | d63d1c4d4ea7b00b33a8776b3f5d815b79135975 /lib/Lex/ModuleMap.cpp | |
parent | 216f66475925c7338f67bb87ba613d87884a18e0 (diff) |
Don't diagnose non-modular includes when we are not compiling a module.
This is triggered when we are compiling an implementation of a module,
it has relative includes to a VFS-mapped module with umbrella headers.
Currently we will find the real path to headers under the umbrella directory,
but the umbrella directories are using virtual path.
rdar://27951255
Thanks Ben and Richard for reviewing the patch!
Differential Revision: http://reviews.llvm.org/D23858
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/ModuleMap.cpp')
-rw-r--r-- | lib/Lex/ModuleMap.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index 50eb6f82c2..4b49083bbb 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/lib/Lex/ModuleMap.cpp @@ -297,7 +297,9 @@ void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule, if (LangOpts.ModulesStrictDeclUse) { Diags.Report(FilenameLoc, diag::err_undeclared_use_of_module) << RequestingModule->getFullModuleName() << Filename; - } else if (RequestingModule && RequestingModuleIsModuleInterface) { + } else if (RequestingModule && RequestingModuleIsModuleInterface && + LangOpts.isCompilingModule()) { + // Do not diagnose when we are not compiling a module. diag::kind DiagID = RequestingModule->getTopLevelModule()->IsFramework ? diag::warn_non_modular_include_in_framework_module : diag::warn_non_modular_include_in_module; |