@@ -119,7 +119,7 @@ struct ModuleMapFileParser {
119119 std::optional<UmbrellaDirDecl>
120120 parseUmbrellaDirDecl (SourceLocation UmbrellaLoc);
121121 std::optional<LinkDecl>
122- parseLinkDecl (llvm::StringMap<SourceLocation> &SeenLinkDecl, bool Allowed );
122+ parseLinkDecl (llvm::StringMap<SourceLocation> &SeenLinkDecl);
123123
124124 SourceLocation consumeToken ();
125125 void skipUntil (MMToken::TokenKind K);
@@ -409,7 +409,7 @@ std::optional<ModuleDecl> ModuleMapFileParser::parseModuleDecl(bool TopLevel) {
409409 case MMToken::LinkKeyword:
410410 // Link decls are only allowed in top level modules or explicit
411411 // submodules.
412- SubDecl = parseLinkDecl (SeenLinkDecl, TopLevel || MDecl. Explicit );
412+ SubDecl = parseLinkDecl (SeenLinkDecl);
413413 break ;
414414
415415 default :
@@ -827,7 +827,7 @@ ModuleMapFileParser::parseUmbrellaDirDecl(clang::SourceLocation UmbrellaLoc) {
827827// / module-declaration:
828828// / 'link' 'framework'[opt] string-literal
829829std::optional<LinkDecl> ModuleMapFileParser::parseLinkDecl (
830- llvm::StringMap<SourceLocation> &SeenLinkDecl, bool Allowed ) {
830+ llvm::StringMap<SourceLocation> &SeenLinkDecl) {
831831 assert (Tok.is (MMToken::LinkKeyword));
832832 LinkDecl LD;
833833 LD.Location = consumeToken ();
@@ -853,12 +853,8 @@ std::optional<LinkDecl> ModuleMapFileParser::parseLinkDecl(
853853 LD.Library = Library;
854854 consumeToken ();
855855
856- // Make sure we eat all the tokens when we report the errors so parsing
856+ // Make sure we eat all the token when we report the errors so parsing
857857 // can continue.
858- if (!Allowed) {
859- Diags.Report (LD.Location , diag::warn_mmap_submodule_link_decl);
860- }
861-
862858 auto [It, Inserted] =
863859 SeenLinkDecl.insert (std::make_pair (Library, LD.Location ));
864860 if (!Inserted) {
0 commit comments