@@ -79,9 +79,8 @@ deriveBodyEquatable_enum_uninhabited_eq(AbstractFunctionDecl *eqDecl, void *) {
7979 SourceLoc (), /* HasTrailingClosure*/ false ,
8080 /* implicit*/ true ,
8181 TupleType::get (abTupleElts, C));
82- auto switchStmt = SwitchStmt::create (LabeledStmtInfo (), SourceLoc (), abExpr,
83- SourceLoc (), cases, SourceLoc (),
84- SourceLoc (), C);
82+ auto switchStmt =
83+ SwitchStmt::createImplicit (LabeledStmtInfo (), abExpr, cases, C);
8584 statements.push_back (switchStmt);
8685
8786 auto body = BraceStmt::create (C, SourceLoc (), statements, SourceLoc ());
@@ -277,9 +276,8 @@ deriveBodyEquatable_enum_hasAssociatedValues_eq(AbstractFunctionDecl *eqDecl,
277276 auto abExpr = TupleExpr::create (C, SourceLoc (), { aRef, bRef }, {}, {},
278277 SourceLoc (), /* HasTrailingClosure*/ false ,
279278 /* implicit*/ true );
280- auto switchStmt = SwitchStmt::create (LabeledStmtInfo (), SourceLoc (), abExpr,
281- SourceLoc (), cases, SourceLoc (),
282- SourceLoc (), C);
279+ auto switchStmt =
280+ SwitchStmt::createImplicit (LabeledStmtInfo (), abExpr, cases, C);
283281 statements.push_back (switchStmt);
284282
285283 auto body = BraceStmt::create (C, SourceLoc (), statements, SourceLoc ());
@@ -752,9 +750,8 @@ deriveBodyHashable_enum_hasAssociatedValues_hashInto(
752750 // generate: switch enumVar { }
753751 auto enumRef = new (C) DeclRefExpr (selfDecl, DeclNameLoc (),
754752 /* implicit*/ true );
755- auto switchStmt = SwitchStmt::create (LabeledStmtInfo (), SourceLoc (), enumRef,
756- SourceLoc (), cases, SourceLoc (),
757- SourceLoc (), C);
753+ auto switchStmt =
754+ SwitchStmt::createImplicit (LabeledStmtInfo (), enumRef, cases, C);
758755
759756 auto body = BraceStmt::create (C, SourceLoc (), {ASTNode (switchStmt)},
760757 SourceLoc ());
0 commit comments