diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-01-04 07:31:24 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2018-01-04 07:31:24 +0000 |
commit | fec26b0bbba9f7c1704f021c1d830bb012578674 (patch) | |
tree | da8a037faa566951a59fa9e6f2ff9a0397d329fd /clang/lib/Lex/PPDirectives.cpp | |
parent | b8f2978bec86d1f4d04f4e1eebbfa9e7bada0c9a (diff) | |
download | bcm5719-llvm-fec26b0bbba9f7c1704f021c1d830bb012578674.tar.gz bcm5719-llvm-fec26b0bbba9f7c1704f021c1d830bb012578674.zip |
Revert "[Modules] Allow modules specified by -fmodule-map-file to shadow implicitly found ones"
This reverts r321781 until I fix the leaks pointed out by bots:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/12146
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/3741
llvm-svn: 321786
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 77ee1faf283..ca3e70fd106 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1655,18 +1655,12 @@ bool Preprocessor::checkModuleIsAvailable(const LangOptions &LangOpts, DiagnosticsEngine &Diags, Module *M) { Module::Requirement Requirement; Module::UnresolvedHeaderDirective MissingHeader; - Module *ShadowingModule = nullptr; - if (M->isAvailable(LangOpts, TargetInfo, Requirement, MissingHeader, - ShadowingModule)) + if (M->isAvailable(LangOpts, TargetInfo, Requirement, MissingHeader)) return false; if (MissingHeader.FileNameLoc.isValid()) { Diags.Report(MissingHeader.FileNameLoc, diag::err_module_header_missing) << MissingHeader.IsUmbrella << MissingHeader.FileName; - } else if (ShadowingModule) { - Diags.Report(M->DefinitionLoc, diag::err_module_shadowed) << M->Name; - Diags.Report(ShadowingModule->DefinitionLoc, - diag::note_previous_definition); } else { // FIXME: Track the location at which the requirement was specified, and // use it here. @@ -2030,15 +2024,6 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Determine if we're switching to building a new submodule, and which one. if (auto *M = SuggestedModule.getModule()) { - if (M->getTopLevelModule()->ShadowingModule) { - // We are building a submodule that belongs to a shadowed module. This - // means we find header files in the shadowed module. - Diag(M->DefinitionLoc, diag::err_module_build_shadowed_submodule) - << M->getFullModuleName(); - Diag(M->getTopLevelModule()->ShadowingModule->DefinitionLoc, - diag::note_previous_definition); - return; - } // When building a pch, -fmodule-name tells the compiler to textually // include headers in the specified module. We are not building the // specified module. |