@@ -536,8 +536,7 @@ makeEnumRawValueConstructor(ClangImporter::Implementation &Impl,
536
536
auto body = BraceStmt::create (C, SourceLoc (), {assign, ret}, SourceLoc (),
537
537
/* implicit*/ true );
538
538
539
- ctorDecl->setBody (body);
540
- ctorDecl->setBodyTypeCheckedIfPresent ();
539
+ ctorDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
541
540
542
541
return ctorDecl;
543
542
}
@@ -612,8 +611,7 @@ static AccessorDecl *makeEnumRawValueGetter(ClangImporter::Implementation &Impl,
612
611
auto body = BraceStmt::create (C, SourceLoc (), ASTNode (ret), SourceLoc (),
613
612
/* implicit*/ true );
614
613
615
- getterDecl->setBody (body);
616
- getterDecl->setBodyTypeCheckedIfPresent ();
614
+ getterDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
617
615
618
616
return getterDecl;
619
617
}
@@ -689,8 +687,7 @@ static AccessorDecl *makeStructRawValueGetter(
689
687
auto body = BraceStmt::create (C, SourceLoc (), ASTNode (ret), SourceLoc (),
690
688
/* implicit*/ true );
691
689
692
- getterDecl->setBody (body);
693
- getterDecl->setBodyTypeCheckedIfPresent ();
690
+ getterDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
694
691
695
692
return getterDecl;
696
693
}
@@ -848,8 +845,7 @@ makeIndirectFieldAccessors(ClangImporter::Implementation &Impl,
848
845
auto ret = new (C) ReturnStmt (SourceLoc (), expr);
849
846
auto body = BraceStmt::create (C, SourceLoc (), ASTNode (ret), SourceLoc (),
850
847
/* implicit*/ true );
851
- getterDecl->setBody (body);
852
- getterDecl->setBodyTypeCheckedIfPresent ();
848
+ getterDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
853
849
getterDecl->getAttrs ().add (new (C) TransparentAttr (/* implicit*/ true ));
854
850
}
855
851
@@ -879,8 +875,7 @@ makeIndirectFieldAccessors(ClangImporter::Implementation &Impl,
879
875
880
876
auto body = BraceStmt::create (C, SourceLoc (), { assign }, SourceLoc (),
881
877
/* implicit*/ true );
882
- setterDecl->setBody (body);
883
- setterDecl->setBodyTypeCheckedIfPresent ();
878
+ setterDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
884
879
setterDecl->getAttrs ().add (new (C) TransparentAttr (/* implicit*/ true ));
885
880
}
886
881
@@ -956,8 +951,7 @@ makeUnionFieldAccessors(ClangImporter::Implementation &Impl,
956
951
auto ret = new (C) ReturnStmt (SourceLoc (), reinterpreted);
957
952
auto body = BraceStmt::create (C, SourceLoc (), ASTNode (ret), SourceLoc (),
958
953
/* implicit*/ true );
959
- getterDecl->setBody (body);
960
- getterDecl->setBodyTypeCheckedIfPresent ();
954
+ getterDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
961
955
getterDecl->getAttrs ().add (new (C) TransparentAttr (/* implicit*/ true ));
962
956
}
963
957
@@ -1017,8 +1011,7 @@ makeUnionFieldAccessors(ClangImporter::Implementation &Impl,
1017
1011
1018
1012
auto body = BraceStmt::create (C, SourceLoc (), { initialize }, SourceLoc (),
1019
1013
/* implicit*/ true );
1020
- setterDecl->setBody (body);
1021
- setterDecl->setBodyTypeCheckedIfPresent ();
1014
+ setterDecl->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
1022
1015
setterDecl->getAttrs ().add (new (C) TransparentAttr (/* implicit*/ true ));
1023
1016
}
1024
1017
@@ -1282,8 +1275,7 @@ createDefaultConstructor(ClangImporter::Implementation &Impl,
1282
1275
// Create the function body.
1283
1276
auto body = BraceStmt::create (context, SourceLoc (), {assign, ret},
1284
1277
SourceLoc ());
1285
- constructor->setBody (body);
1286
- constructor->setBodyTypeCheckedIfPresent ();
1278
+ constructor->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
1287
1279
1288
1280
// We're done.
1289
1281
return constructor;
@@ -1401,8 +1393,7 @@ createValueConstructor(ClangImporter::Implementation &Impl,
1401
1393
1402
1394
// Create the function body.
1403
1395
auto body = BraceStmt::create (context, SourceLoc (), stmts, SourceLoc ());
1404
- constructor->setBody (body);
1405
- constructor->setBodyTypeCheckedIfPresent ();
1396
+ constructor->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
1406
1397
}
1407
1398
1408
1399
// We're done.
@@ -1552,8 +1543,7 @@ static ConstructorDecl *createRawValueBridgingConstructor(
1552
1543
auto ret = new (ctx) ReturnStmt (SourceLoc (), result, /* Implicit=*/ true );
1553
1544
1554
1545
auto body = BraceStmt::create (ctx, SourceLoc (), {assign, ret}, SourceLoc ());
1555
- init->setBody (body);
1556
- init->setBodyTypeCheckedIfPresent ();
1546
+ init->setBody (body, AbstractFunctionDecl::BodyKind::TypeChecked);
1557
1547
}
1558
1548
1559
1549
return init;
@@ -1911,8 +1901,8 @@ static bool addErrorDomain(NominalTypeDecl *swiftDecl,
1911
1901
1912
1902
auto ret = new (C) ReturnStmt (SourceLoc (), domainDeclRef);
1913
1903
getterDecl->setBody (
1914
- BraceStmt::create (C, SourceLoc (), {ret}, SourceLoc (), isImplicit));
1915
- getterDecl-> setBodyTypeCheckedIfPresent ( );
1904
+ BraceStmt::create (C, SourceLoc (), {ret}, SourceLoc (), isImplicit),
1905
+ AbstractFunctionDecl::BodyKind::TypeChecked );
1916
1906
1917
1907
return true ;
1918
1908
}
@@ -8268,8 +8258,8 @@ ClangImporter::Implementation::createConstant(Identifier name, DeclContext *dc,
8268
8258
// Finally, set the body.
8269
8259
func->setBody (BraceStmt::create (C, SourceLoc (),
8270
8260
ASTNode (ret),
8271
- SourceLoc ()));
8272
- func-> setBodyTypeCheckedIfPresent ( );
8261
+ SourceLoc ()),
8262
+ AbstractFunctionDecl::BodyKind::TypeChecked );
8273
8263
}
8274
8264
8275
8265
// Mark the function transparent so that we inline it away completely.
0 commit comments