Skip to content

Commit 9e3d67e

Browse files
committed
Parser: Stylistic cleanup; enums are not called 'unions' anymore
1 parent aaa59a0 commit 9e3d67e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4687,17 +4687,17 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
46874687
return makeParserCodeCompletionStatus();
46884688
}
46894689

4690-
EnumDecl *UD = new (Context) EnumDecl(EnumLoc, EnumName, EnumNameLoc,
4690+
EnumDecl *ED = new (Context) EnumDecl(EnumLoc, EnumName, EnumNameLoc,
46914691
{ }, GenericParams, CurDeclContext);
4692-
setLocalDiscriminator(UD);
4693-
UD->getAttrs() = Attributes;
4692+
setLocalDiscriminator(ED);
4693+
ED->getAttrs() = Attributes;
46944694

46954695
// Parse optional inheritance clause within the context of the enum.
46964696
if (Tok.is(tok::colon)) {
4697-
ContextChange CC(*this, UD);
4697+
ContextChange CC(*this, ED);
46984698
SmallVector<TypeLoc, 2> Inherited;
46994699
Status |= parseInheritance(Inherited, /*classRequirementLoc=*/nullptr);
4700-
UD->setInherited(Context.AllocateCopy(Inherited));
4700+
ED->setInherited(Context.AllocateCopy(Inherited));
47014701
}
47024702

47034703
diagnoseWhereClauseInGenericParamList(GenericParams);
@@ -4707,7 +4707,7 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
47074707
auto whereStatus = parseFreestandingGenericWhereClause(GenericParams);
47084708
if (whereStatus.shouldStopParsing())
47094709
return whereStatus;
4710-
UD->setGenericParams(GenericParams);
4710+
ED->setGenericParams(GenericParams);
47114711
}
47124712

47134713
SourceLoc LBLoc, RBLoc;
@@ -4716,20 +4716,20 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
47164716
RBLoc = LBLoc;
47174717
Status.setIsParseError();
47184718
} else {
4719-
ContextChange CC(*this, UD);
4719+
ContextChange CC(*this, ED);
47204720
Scope S(this, ScopeKind::ClassBody);
47214721
ParseDeclOptions Options(PD_HasContainerType | PD_AllowEnumElement | PD_InEnum);
47224722
if (parseNominalDeclMembers(LBLoc, RBLoc,
47234723
diag::expected_rbrace_enum,
4724-
Options, [&] (Decl *D) { UD->addMember(D); }))
4724+
Options, [&] (Decl *D) { ED->addMember(D); }))
47254725
Status.setIsParseError();
47264726
}
47274727

4728-
UD->setBraces({LBLoc, RBLoc});
4728+
ED->setBraces({LBLoc, RBLoc});
47294729

4730-
addToScope(UD);
4730+
addToScope(ED);
47314731

4732-
return DCC.fixupParserResult(Status, UD);
4732+
return DCC.fixupParserResult(Status, ED);
47334733
}
47344734

47354735
/// \brief Parse a 'case' of an enum.

0 commit comments

Comments
 (0)