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 | a67e4d32544dc26393a54619b5fe2b63f581773e (patch) | |
tree | ce711aac46c8b30f73d0d91e3e1bd7333e27e251 /clang/lib/Lex/ModuleMap.cpp | |
parent | da9c56299b7c43c89c320ea72d0379e7debe7475 (diff) | |
download | bcm5719-llvm-a67e4d32544dc26393a54619b5fe2b63f581773e.tar.gz bcm5719-llvm-a67e4d32544dc26393a54619b5fe2b63f581773e.zip |
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
llvm-svn: 279838
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 50eb6f82c27..4b49083bbb6 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/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; |