13
13
#ifndef SWIFT_C_AST_ASTBRIDGING_H
14
14
#define SWIFT_C_AST_ASTBRIDGING_H
15
15
16
- #include <inttypes.h>
17
16
#include "swift/Basic/Compiler.h"
17
+ #include <inttypes.h>
18
18
19
19
#if __clang__
20
20
// Provide macros to temporarily suppress warning about the use of
@@ -93,9 +93,9 @@ extern "C" {
93
93
94
94
#endif
95
95
96
- BridgedIdentifier
97
- SwiftASTContext_getIdentifier (
98
- void * ctx , const uint8_t * _Nullable str , long len );
96
+ BridgedIdentifier SwiftASTContext_getIdentifier ( void * ctx ,
97
+ const uint8_t * _Nullable str ,
98
+ long len );
99
99
100
100
void * SwiftImportDecl_create (void * , void * , void * , char , void * ,
101
101
BridgedArrayRef , BridgedArrayRef );
@@ -107,7 +107,6 @@ void *SwiftTopLevelCodeDecl_createExpr(void *ctx, void *DC, void *startLoc,
107
107
108
108
void * ReturnStmt_create (void * ctx , void * loc , void * _Nullable expr );
109
109
110
-
111
110
void * SwiftSequenceExpr_create (void * ctx , BridgedArrayRef exprs );
112
111
113
112
void * SwiftTupleExpr_create (void * ctx , void * lparen , BridgedArrayRef subs ,
@@ -117,46 +116,48 @@ void *SwiftFunctionCallExpr_create(void *ctx, void *fn, void *args);
117
116
118
117
void * SwiftIdentifierExpr_create (void * ctx , BridgedIdentifier base , void * loc );
119
118
120
- void * SwiftStringLiteralExpr_create (void * ctx , const uint8_t * _Nullable string ,
119
+ void * SwiftStringLiteralExpr_create (void * ctx , const uint8_t * _Nullable string ,
121
120
long len , void * TokenLoc );
122
121
123
- void * SwiftIntegerLiteralExpr_create (void * ctx , const uint8_t * _Nullable string ,
124
- long len , void * TokenLoc );
122
+ void * SwiftIntegerLiteralExpr_create (void * ctx , const uint8_t * _Nullable string ,
123
+ long len , void * TokenLoc );
125
124
126
125
void * SwiftBooleanLiteralExpr_create (void * ctx , _Bool value , void * TokenLoc );
127
126
128
127
void * SwiftVarDecl_create (void * ctx , BridgedIdentifier _Nullable name ,
129
128
void * loc , _Bool isStatic , _Bool isLet , void * dc );
130
129
131
- void * IfStmt_create (void * ctx , void * ifLoc , void * cond , void * _Nullable then , void * _Nullable elseLoc ,
132
- void * _Nullable elseStmt );
130
+ void * IfStmt_create (void * ctx , void * ifLoc , void * cond , void * _Nullable then ,
131
+ void * _Nullable elseLoc , void * _Nullable elseStmt );
133
132
134
133
struct ASTNodeBridged {
135
134
void * ptr ;
136
135
_Bool isExpr ; // Must be expr or stmt.
137
136
};
138
137
139
- void * BraceStmt_create (void * ctx , void * lbloc , BridgedArrayRef elements , void * rbloc );
140
- void * BraceStmt_create (void * ctx , void * lbloc , BridgedArrayRef elements , void * rbloc );
138
+ void * BraceStmt_create (void * ctx , void * lbloc , BridgedArrayRef elements ,
139
+ void * rbloc );
140
+ void * BraceStmt_create (void * ctx , void * lbloc , BridgedArrayRef elements ,
141
+ void * rbloc );
141
142
142
143
void * BridgedSourceLoc_advanced (void * loc , long len );
143
144
144
- void * ParamDecl_create (void * ctx , void * loc ,
145
- void * _Nullable argLoc , void * _Nullable argName ,
146
- void * _Nullable paramLoc , void * _Nullable paramName ,
147
- void * declContext );
145
+ void * ParamDecl_create (void * ctx , void * loc , void * _Nullable argLoc ,
146
+ void * _Nullable argName , void * _Nullable paramLoc ,
147
+ void * _Nullable paramName , void * declContext );
148
148
149
149
void * FuncDecl_create (void * ctx , void * staticLoc , _Bool isStatic , void * funcLoc ,
150
- BridgedIdentifier name , void * nameLoc ,
151
- _Bool isAsync , void * _Nullable asyncLoc ,
152
- _Bool throws , void * _Nullable throwsLoc ,
153
- void * paramLLoc , BridgedArrayRef params , void * paramRLoc ,
150
+ BridgedIdentifier name , void * nameLoc , _Bool isAsync ,
151
+ void * _Nullable asyncLoc , _Bool throws ,
152
+ void * _Nullable throwsLoc , void * paramLLoc ,
153
+ BridgedArrayRef params , void * paramRLoc ,
154
154
void * _Nullable body , void * _Nullable returnType ,
155
155
void * declContext );
156
156
157
157
void * SimpleIdentTypeRepr_create (void * ctx , void * loc , BridgedIdentifier id );
158
158
159
- void * UnresolvedDotExpr_create (void * ctx , void * base , void * dotLoc , BridgedIdentifier name , void * nameLoc );
159
+ void * UnresolvedDotExpr_create (void * ctx , void * base , void * dotLoc ,
160
+ BridgedIdentifier name , void * nameLoc );
160
161
161
162
void * ClosureExpr_create (void * ctx , void * body , void * dc );
162
163
@@ -168,34 +169,54 @@ struct DeclContextAndDecl {
168
169
void * decl ;
169
170
};
170
171
171
- struct DeclContextAndDecl StructDecl_create (
172
- void * ctx , void * loc , BridgedIdentifier name , void * nameLoc , void * _Nullable genericParams , void * dc );
173
- struct DeclContextAndDecl ClassDecl_create (
174
- void * ctx , void * loc , BridgedIdentifier name , void * nameLoc , void * dc );
175
-
176
- void * ArrayTypeRepr_create (void * ctx , void * base , void * lsquareLoc , void * rsquareLoc );
177
- void * DictionaryTypeRepr_create (void * ctx , void * keyType , void * valueType , void * lsquareLoc , void * colonloc , void * rsquareLoc );
172
+ struct DeclContextAndDecl
173
+ StructDecl_create (void * ctx , void * loc , BridgedIdentifier name , void * nameLoc ,
174
+ void * _Nullable genericParams , void * dc );
175
+ struct DeclContextAndDecl ClassDecl_create (void * ctx , void * loc ,
176
+ BridgedIdentifier name ,
177
+ void * nameLoc , void * dc );
178
+
179
+ void * ArrayTypeRepr_create (void * ctx , void * base , void * lsquareLoc ,
180
+ void * rsquareLoc );
181
+ void * DictionaryTypeRepr_create (void * ctx , void * keyType , void * valueType ,
182
+ void * lsquareLoc , void * colonloc ,
183
+ void * rsquareLoc );
178
184
void * OptionalTypeRepr_create (void * ctx , void * base , void * questionLoc );
179
- void * ImplicitlyUnwrappedOptionalTypeRepr_create (void * ctx , void * base , void * exclamationLoc );
185
+ void * ImplicitlyUnwrappedOptionalTypeRepr_create (void * ctx , void * base ,
186
+ void * exclamationLoc );
180
187
void * MetatypeTypeRepr_create (void * ctx , void * baseType , void * typeLoc );
181
188
void * ProtocolTypeRepr_create (void * ctx , void * baseType , void * protoLoc );
182
189
void * PackExpansionTypeRepr_create (void * ctx , void * base , void * ellipsisLoc );
183
- void * TupleTypeRepr_create (void * ctx , BridgedArrayRef elements , void * lParenLoc , void * rParenLoc );
190
+ void * TupleTypeRepr_create (void * ctx , BridgedArrayRef elements , void * lParenLoc ,
191
+ void * rParenLoc );
184
192
void * IdentTypeRepr_create (void * ctx , BridgedArrayRef components );
185
- void * GenericIdentTypeRepr_create (void * ctx , BridgedIdentifier name , void * nameLoc , BridgedArrayRef genericArgs , void * lAngle , void * rAngle );
186
- void * CompositionTypeRepr_create (void * ctx , BridgedArrayRef types , void * firstTypeLoc );
187
- void * FunctionTypeRepr_create (void * ctx , void * argsTy , void * _Nullable asyncLoc , void * _Nullable throwsLoc , void * arrowLoc , void * returnType );
193
+ void * GenericIdentTypeRepr_create (void * ctx , BridgedIdentifier name ,
194
+ void * nameLoc , BridgedArrayRef genericArgs ,
195
+ void * lAngle , void * rAngle );
196
+ void * CompositionTypeRepr_create (void * ctx , BridgedArrayRef types ,
197
+ void * firstTypeLoc );
198
+ void * FunctionTypeRepr_create (void * ctx , void * argsTy , void * _Nullable asyncLoc ,
199
+ void * _Nullable throwsLoc , void * arrowLoc ,
200
+ void * returnType );
188
201
void * NamedOpaqueReturnTypeRepr_create (void * ctx , void * baseTy );
189
202
void * OpaqueReturnTypeRepr_create (void * ctx , void * opaqueLoc , void * baseTy );
190
203
void * ExistentialTypeRepr_create (void * ctx , void * anyLoc , void * baseTy );
191
- void * GenericParamList_create (void * ctx , void * lAngleLoc , BridgedArrayRef params , void * _Nullable whereLoc , BridgedArrayRef reqs , void * rAngleLoc );
192
- void * GenericTypeParamDecl_create (void * ctx , void * declContext , BridgedIdentifier name , void * nameLoc , void * _Nullable ellipsisLoc , long index , _Bool isParameterPack );
204
+ void * GenericParamList_create (void * ctx , void * lAngleLoc ,
205
+ BridgedArrayRef params , void * _Nullable whereLoc ,
206
+ BridgedArrayRef reqs , void * rAngleLoc );
207
+ void * GenericTypeParamDecl_create (void * ctx , void * declContext ,
208
+ BridgedIdentifier name , void * nameLoc ,
209
+ void * _Nullable ellipsisLoc , long index ,
210
+ _Bool isParameterPack );
193
211
void GenericTypeParamDecl_setInheritedType (void * ctx , void * Param , void * ty );
194
212
195
- struct DeclContextAndDecl TypeAliasDecl_create (void * ctx , void * declContext , void * aliasLoc , void * equalLoc , BridgedIdentifier name , void * nameLoc , void * _Nullable genericParams );
213
+ struct DeclContextAndDecl TypeAliasDecl_create (void * ctx , void * declContext ,
214
+ void * aliasLoc , void * equalLoc ,
215
+ BridgedIdentifier name ,
216
+ void * nameLoc ,
217
+ void * _Nullable genericParams );
196
218
void TypeAliasDecl_setUnderlyingTypeRepr (void * decl , void * underlyingType );
197
219
198
-
199
220
void TopLevelCodeDecl_dump (void * );
200
221
void Expr_dump (void * );
201
222
void Decl_dump (void * );
0 commit comments