@@ -5728,15 +5728,6 @@ void Parser::consumeDecl(ParserPosition BeginParserPosition, bool IsTopLevel) {
57285728 }
57295729}
57305730
5731- void Parser::recordLocalType (TypeDecl *TD) {
5732- // If we're not in a local context, this is unnecessary.
5733- if (!TD->getDeclContext ()->isLocalContext ())
5734- return ;
5735-
5736- if (!InInactiveClauseEnvironment && !InFreestandingMacroArgument)
5737- SF.getOutermostParentSourceFile ()->LocalTypeDecls .insert (TD);
5738- }
5739-
57405731// / Set the original declaration in `@differentiable` attributes.
57415732// /
57425733// / Necessary because `Parser::parseNewDeclAttribute` (which calls
@@ -7200,7 +7191,6 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
72007191
72017192 auto *TAD = new (Context) TypeAliasDecl (TypeAliasLoc, EqualLoc, Id, IdLoc,
72027193 genericParams, CurDeclContext);
7203- recordLocalType (TAD);
72047194 ParserResult<TypeRepr> UnderlyingTy;
72057195
72067196 if (Tok.is (tok::colon) || Tok.is (tok::equal)) {
@@ -8885,7 +8875,6 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
88858875
88868876 EnumDecl *ED = new (Context) EnumDecl (EnumLoc, EnumName, EnumNameLoc,
88878877 { }, GenericParams, CurDeclContext);
8888- recordLocalType (ED);
88898878 ED->getAttrs () = Attributes;
88908879
88918880 ContextChange CC (*this , ED);
@@ -9152,7 +9141,6 @@ ParserResult<StructDecl> Parser::parseDeclStruct(ParseDeclOptions Flags,
91529141 { },
91539142 GenericParams,
91549143 CurDeclContext);
9155- recordLocalType (SD);
91569144 SD->getAttrs () = Attributes;
91579145
91589146 ContextChange CC (*this , SD);
@@ -9246,7 +9234,6 @@ ParserResult<ClassDecl> Parser::parseDeclClass(ParseDeclOptions Flags,
92469234 ClassDecl *CD = new (Context) ClassDecl (ClassLoc, ClassName, ClassNameLoc,
92479235 { }, GenericParams, CurDeclContext,
92489236 isExplicitActorDecl);
9249- recordLocalType (CD);
92509237 CD->getAttrs () = Attributes;
92519238
92529239 // Parsed classes never have missing vtable entries.
@@ -9425,7 +9412,6 @@ parseDeclProtocol(ParseDeclOptions Flags, DeclAttributes &Attributes) {
94259412 ProtocolDecl (CurDeclContext, ProtocolLoc, NameLoc, ProtocolName,
94269413 Context.AllocateCopy (PrimaryAssociatedTypeNames),
94279414 Context.AllocateCopy (InheritedProtocols), TrailingWhere);
9428- recordLocalType (Proto);
94299415
94309416 Proto->getAttrs () = Attributes;
94319417 if (whereClauseHadCodeCompletion && CodeCompletionCallbacks)
0 commit comments