@@ -5728,15 +5728,6 @@ void Parser::consumeDecl(ParserPosition BeginParserPosition, bool IsTopLevel) {
5728
5728
}
5729
5729
}
5730
5730
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
-
5740
5731
// / Set the original declaration in `@differentiable` attributes.
5741
5732
// /
5742
5733
// / Necessary because `Parser::parseNewDeclAttribute` (which calls
@@ -7200,7 +7191,6 @@ parseDeclTypeAlias(Parser::ParseDeclOptions Flags, DeclAttributes &Attributes) {
7200
7191
7201
7192
auto *TAD = new (Context) TypeAliasDecl (TypeAliasLoc, EqualLoc, Id, IdLoc,
7202
7193
genericParams, CurDeclContext);
7203
- recordLocalType (TAD);
7204
7194
ParserResult<TypeRepr> UnderlyingTy;
7205
7195
7206
7196
if (Tok.is (tok::colon) || Tok.is (tok::equal)) {
@@ -8885,7 +8875,6 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
8885
8875
8886
8876
EnumDecl *ED = new (Context) EnumDecl (EnumLoc, EnumName, EnumNameLoc,
8887
8877
{ }, GenericParams, CurDeclContext);
8888
- recordLocalType (ED);
8889
8878
ED->getAttrs () = Attributes;
8890
8879
8891
8880
ContextChange CC (*this , ED);
@@ -9152,7 +9141,6 @@ ParserResult<StructDecl> Parser::parseDeclStruct(ParseDeclOptions Flags,
9152
9141
{ },
9153
9142
GenericParams,
9154
9143
CurDeclContext);
9155
- recordLocalType (SD);
9156
9144
SD->getAttrs () = Attributes;
9157
9145
9158
9146
ContextChange CC (*this , SD);
@@ -9246,7 +9234,6 @@ ParserResult<ClassDecl> Parser::parseDeclClass(ParseDeclOptions Flags,
9246
9234
ClassDecl *CD = new (Context) ClassDecl (ClassLoc, ClassName, ClassNameLoc,
9247
9235
{ }, GenericParams, CurDeclContext,
9248
9236
isExplicitActorDecl);
9249
- recordLocalType (CD);
9250
9237
CD->getAttrs () = Attributes;
9251
9238
9252
9239
// Parsed classes never have missing vtable entries.
@@ -9425,7 +9412,6 @@ parseDeclProtocol(ParseDeclOptions Flags, DeclAttributes &Attributes) {
9425
9412
ProtocolDecl (CurDeclContext, ProtocolLoc, NameLoc, ProtocolName,
9426
9413
Context.AllocateCopy (PrimaryAssociatedTypeNames),
9427
9414
Context.AllocateCopy (InheritedProtocols), TrailingWhere);
9428
- recordLocalType (Proto);
9429
9415
9430
9416
Proto->getAttrs () = Attributes;
9431
9417
if (whereClauseHadCodeCompletion && CodeCompletionCallbacks)
0 commit comments