mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Adjust the API of CaseLabelItem for unknown
Get these simple changes out of the way first. No functionality change.
This commit is contained in:
@@ -268,8 +268,7 @@ deriveBodyCodingKey_enum_stringValue(AbstractFunctionDecl *strValDecl) {
|
||||
Identifier(), elt, nullptr);
|
||||
pat->setImplicit();
|
||||
|
||||
auto labelItem = CaseLabelItem(/*IsDefault=*/false, pat, SourceLoc(),
|
||||
nullptr);
|
||||
auto labelItem = CaseLabelItem(pat);
|
||||
|
||||
auto *caseValue = new (C) StringLiteralExpr(elt->getNameStr(),
|
||||
SourceRange(),
|
||||
@@ -334,8 +333,7 @@ deriveBodyCodingKey_init_stringValue(AbstractFunctionDecl *initDecl) {
|
||||
nullptr);
|
||||
litPat->setImplicit();
|
||||
|
||||
auto labelItem = CaseLabelItem(/*IsDefault=*/false, litPat, SourceLoc(),
|
||||
nullptr);
|
||||
auto labelItem = CaseLabelItem(litPat);
|
||||
|
||||
auto *eltRef = new (C) DeclRefExpr(elt, DeclNameLoc(), /*Implicit=*/true);
|
||||
auto *metaTyRef = TypeExpr::createImplicit(enumType, C);
|
||||
@@ -353,8 +351,7 @@ deriveBodyCodingKey_init_stringValue(AbstractFunctionDecl *initDecl) {
|
||||
|
||||
auto *anyPat = new (C) AnyPattern(SourceLoc());
|
||||
anyPat->setImplicit();
|
||||
auto dfltLabelItem = CaseLabelItem(/*IsDefault=*/true, anyPat, SourceLoc(),
|
||||
nullptr);
|
||||
auto dfltLabelItem = CaseLabelItem::getDefault(anyPat);
|
||||
|
||||
auto *dfltReturnStmt = new (C) FailStmt(SourceLoc(), SourceLoc());
|
||||
auto *dfltBody = BraceStmt::create(C, SourceLoc(), ASTNode(dfltReturnStmt),
|
||||
|
||||
Reference in New Issue
Block a user