32
32
33
33
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
34
34
35
- typedef struct BridgedDeclContext {
36
- void * _Nonnull raw ;
37
- } BridgedDeclContext ;
38
-
39
35
// Define the bridging wrappers for each AST node.
40
36
#define AST_BRIDGING_WRAPPER_NONNULL (Name ) \
41
37
typedef struct { \
@@ -53,7 +49,8 @@ typedef struct BridgedDeclContext {
53
49
extern "C" {
54
50
#endif
55
51
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.
57
54
#define DECL (Id , Parent ) \
58
55
SWIFT_NAME("getter:Bridged" #Id "Decl.asDecl(self:)") \
59
56
BridgedDecl Id##Decl_asDecl(Bridged##Id##Decl decl);
@@ -69,21 +66,24 @@ extern "C" {
69
66
#define ABSTRACT_CONTEXT_DECL (Id , Parent ) CONTEXT_DECL(Id, Parent)
70
67
#include "swift/AST/DeclNodes.def"
71
68
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.
73
71
#define STMT (Id , Parent ) \
74
72
SWIFT_NAME("getter:Bridged" #Id "Stmt.asStmt(self:)") \
75
73
BridgedStmt Id##Stmt_asStmt(Bridged##Id##Stmt stmt);
76
74
#define ABSTRACT_STMT (Id , Parent ) STMT(Id, Parent)
77
75
#include "swift/AST/StmtNodes.def"
78
76
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.
80
79
#define EXPR (Id , Parent ) \
81
80
SWIFT_NAME("getter:Bridged" #Id "Expr.asExpr(self:)") \
82
81
BridgedExpr Id##Expr_asExpr(Bridged##Id##Expr expr);
83
82
#define ABSTRACT_EXPR (Id , Parent ) EXPR(Id, Parent)
84
83
#include "swift/AST/ExprNodes.def"
85
84
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.
87
87
#define TYPEREPR (Id , Parent ) \
88
88
SWIFT_NAME("getter:Bridged" #Id "TypeRepr.asTypeRepr(self:)") \
89
89
BridgedTypeRepr Id##TypeRepr_asTypeRepr(Bridged##Id##TypeRepr typeRepr);
0 commit comments