3232
3333SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
3434
35- typedef struct BridgedDeclContext {
36- void * _Nonnull raw ;
37- } BridgedDeclContext ;
38-
3935// Define the bridging wrappers for each AST node.
4036#define AST_BRIDGING_WRAPPER_NONNULL (Name ) \
4137 typedef struct { \
@@ -53,7 +49,8 @@ typedef struct BridgedDeclContext {
5349extern "C" {
5450#endif
5551
56- // Declare `.asDecl` on each BridgedXXXDecl type.
52+ // Declare `.asDecl` on each BridgedXXXDecl type, which upcasts a wrapper for
53+ // a Decl subclass to a BridgedDecl.
5754#define DECL (Id , Parent ) \
5855 SWIFT_NAME("getter:Bridged" #Id "Decl.asDecl(self:)") \
5956 BridgedDecl Id##Decl_asDecl(Bridged##Id##Decl decl);
@@ -69,21 +66,24 @@ extern "C" {
6966#define ABSTRACT_CONTEXT_DECL (Id , Parent ) CONTEXT_DECL(Id, Parent)
7067#include "swift/AST/DeclNodes.def"
7168
72- // Declare `.asStmt` on each BridgedXXXStmt type.
69+ // Declare `.asStmt` on each BridgedXXXStmt type, which upcasts a wrapper for
70+ // a Stmt subclass to a BridgedStmt.
7371#define STMT (Id , Parent ) \
7472 SWIFT_NAME("getter:Bridged" #Id "Stmt.asStmt(self:)") \
7573 BridgedStmt Id##Stmt_asStmt(Bridged##Id##Stmt stmt);
7674#define ABSTRACT_STMT (Id , Parent ) STMT(Id, Parent)
7775#include "swift/AST/StmtNodes.def"
7876
79- // Declare `.asExpr` on each BridgedXXXExpr type.
77+ // Declare `.asExpr` on each BridgedXXXExpr type, which upcasts a wrapper for
78+ // a Expr subclass to a BridgedExpr.
8079#define EXPR (Id , Parent ) \
8180 SWIFT_NAME("getter:Bridged" #Id "Expr.asExpr(self:)") \
8281 BridgedExpr Id##Expr_asExpr(Bridged##Id##Expr expr);
8382#define ABSTRACT_EXPR (Id , Parent ) EXPR(Id, Parent)
8483#include "swift/AST/ExprNodes.def"
8584
86- // Declare `.asTypeRepr` on each BridgedXXXTypeRepr type.
85+ // Declare `.asTypeRepr` on each BridgedXXXTypeRepr type, which upcasts a
86+ // wrapper for a TypeRepr subclass to a BridgedTypeRepr.
8787#define TYPEREPR (Id , Parent ) \
8888 SWIFT_NAME("getter:Bridged" #Id "TypeRepr.asTypeRepr(self:)") \
8989 BridgedTypeRepr Id##TypeRepr_asTypeRepr(Bridged##Id##TypeRepr typeRepr);
0 commit comments