22
22
// it causes importing the "Darwin"/"Glibc" overlay module. That violates
23
23
// layering. i.e. Darwin overlay is created by Swift compiler.
24
24
25
+ #if __has_attribute (swift_name )
26
+ #define SWIFT_NAME (NAME ) __attribute__((swift_name(NAME)))
27
+ #else
28
+ #define SWIFT_NAME (NAME )
29
+ #endif
30
+
25
31
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
26
32
SWIFT_BEGIN_ASSUME_NONNULL
27
33
@@ -256,13 +262,18 @@ BridgedIdentifier ASTContext_getIdentifier(BridgedASTContext cContext,
256
262
_Bool ASTContext_langOptsHasFeature (BridgedASTContext cContext ,
257
263
BridgedFeature feature );
258
264
265
+ SWIFT_NAME ("TopLevelCodeDecl_createStmt(astContext:declContext:startLoc:"
266
+ "statement:endLoc:)" )
259
267
void * TopLevelCodeDecl_createStmt (BridgedASTContext cContext ,
260
268
BridgedDeclContext cDeclContext ,
261
- BridgedSourceLoc cStartLoc , void * element ,
269
+ BridgedSourceLoc cStartLoc , void * statement ,
262
270
BridgedSourceLoc cEndLoc );
271
+
272
+ SWIFT_NAME ("TopLevelCodeDecl_createExpr(astContext:declContext:startLoc:"
273
+ "expression:endLoc:)" )
263
274
void * TopLevelCodeDecl_createExpr (BridgedASTContext cContext ,
264
275
BridgedDeclContext cDeclContext ,
265
- BridgedSourceLoc cStartLoc , void * element ,
276
+ BridgedSourceLoc cStartLoc , void * expression ,
266
277
BridgedSourceLoc cEndLoc );
267
278
268
279
void * ReturnStmt_create (BridgedASTContext cContext , BridgedSourceLoc cLoc ,
@@ -288,13 +299,16 @@ void *IntegerLiteralExpr_create(BridgedASTContext cContext, BridgedString cStr,
288
299
void * BooleanLiteralExpr_create (BridgedASTContext cContext , _Bool value ,
289
300
BridgedSourceLoc cTokenLoc );
290
301
302
+ SWIFT_NAME ("NilLiteralExpr_create(astContext:nilKeywordLoc:)" )
291
303
void * NilLiteralExpr_create (BridgedASTContext cContext ,
292
304
BridgedSourceLoc cNilKeywordLoc );
293
305
294
306
void * ArrayExpr_create (BridgedASTContext cContext , BridgedSourceLoc cLLoc ,
295
307
BridgedArrayRef elements , BridgedArrayRef commas ,
296
308
BridgedSourceLoc cRLoc );
297
309
310
+ SWIFT_NAME ("VarDecl_create(astContext:declContext:bindingKeywordLoc:nameExpr:"
311
+ "initializer:isStatic:isLet:)" )
298
312
void * VarDecl_create (BridgedASTContext cContext ,
299
313
BridgedDeclContext cDeclContext ,
300
314
BridgedSourceLoc cBindingKeywordLoc , void * opaqueNameExpr ,
@@ -313,15 +327,21 @@ void *BraceStmt_create(BridgedASTContext cContext, BridgedSourceLoc cLBLoc,
313
327
314
328
BridgedSourceLoc SourceLoc_advanced (BridgedSourceLoc cLoc , SwiftInt len );
315
329
330
+ SWIFT_NAME ("ParamDecl_create(astContext:declContext:specifierLoc:firstName:"
331
+ "firstNameLoc:secondName:secondNameLoc:type:defaultValue:)" )
316
332
void *
317
333
ParamDecl_create (BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
318
334
BridgedSourceLoc cSpecifierLoc , BridgedIdentifier cFirstName ,
319
335
BridgedSourceLoc cFirstNameLoc , BridgedIdentifier cSecondName ,
320
336
BridgedSourceLoc cSecondNameLoc , void * _Nullable opaqueType ,
321
337
void * _Nullable opaqueDefaultValue );
322
338
339
+ SWIFT_NAME ("AbstractFunctionDecl_setBody(_:ofDecl:)" )
323
340
void AbstractFunctionDecl_setBody (void * opaqueBody , void * opaqueDecl );
324
341
342
+ SWIFT_NAME ("FuncDecl_create(astContext:declContext:staticLoc:funcKeywordLoc:"
343
+ "name:nameLoc:genericParamList:parameterList:asyncSpecifierLoc:"
344
+ "throwsSpecifierLoc:returnType:genericWhereClause:)" )
325
345
struct BridgedDeclContextAndDecl
326
346
FuncDecl_create (BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
327
347
BridgedSourceLoc cStaticLoc , BridgedSourceLoc cFuncKeywordLoc ,
@@ -331,13 +351,17 @@ FuncDecl_create(BridgedASTContext cContext, BridgedDeclContext cDeclContext,
331
351
BridgedSourceLoc cThrowsLoc , void * _Nullable opaqueReturnType ,
332
352
void * _Nullable opaqueGenericWhereClause );
333
353
354
+ SWIFT_NAME ("ConstructorDecl_create(astContext:declContext:initKeywordLoc:"
355
+ "failabilityMarkLoc:isIUO:genericParamList:parameterList:"
356
+ "asyncSpecifierLoc:throwsSpecifierLoc:genericWhereClause:)" )
334
357
BridgedDeclContextAndDecl ConstructorDecl_create (
335
358
BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
336
359
BridgedSourceLoc cInitKeywordLoc , BridgedSourceLoc cFailabilityMarkLoc ,
337
360
_Bool isIUO , void * _Nullable opaqueGenericParams , void * opaqueParameterList ,
338
361
BridgedSourceLoc cAsyncLoc , BridgedSourceLoc cThrowsLoc ,
339
362
void * _Nullable opaqueGenericWhereClause );
340
363
364
+ SWIFT_NAME ("DestructorDecl_create(astContext:declContext:deinitKeywordLoc:)" )
341
365
BridgedDeclContextAndDecl
342
366
DestructorDecl_create (BridgedASTContext cContext ,
343
367
BridgedDeclContext cDeclContext ,
@@ -353,6 +377,9 @@ void *UnresolvedDotExpr_create(BridgedASTContext cContext, void *base,
353
377
void * ClosureExpr_create (BridgedASTContext cContext , void * body ,
354
378
BridgedDeclContext cDeclContext );
355
379
380
+ SWIFT_NAME (
381
+ "TypeAliasDecl_create(astContext:declContext:typealiasKeywordLoc:name:"
382
+ "nameLoc:genericParamList:equalLoc:underlyingType:genericWhereClause:)" )
356
383
void * TypeAliasDecl_create (BridgedASTContext cContext ,
357
384
BridgedDeclContext cDeclContext ,
358
385
BridgedSourceLoc cAliasKeywordLoc ,
@@ -362,48 +389,66 @@ void *TypeAliasDecl_create(BridgedASTContext cContext,
362
389
void * opaqueUnderlyingType ,
363
390
void * _Nullable opaqueGenericWhereClause );
364
391
392
+ SWIFT_NAME ("IterableDeclContext_setParsedMembers(_:ofDecl:)" )
365
393
void IterableDeclContext_setParsedMembers (BridgedArrayRef members ,
366
394
void * opaqueDecl );
367
395
396
+ SWIFT_NAME ("EnumDecl_create(astContext:declContext:enumKeywordLoc:name:nameLoc:"
397
+ "genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
368
398
BridgedDeclContextAndDecl EnumDecl_create (
369
399
BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
370
400
BridgedSourceLoc cEnumKeywordLoc , BridgedIdentifier cName ,
371
401
BridgedSourceLoc cNameLoc , void * _Nullable opaqueGenericParamList ,
372
402
BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
373
403
BridgedSourceRange cBraceRange );
374
404
405
+ SWIFT_NAME ("EnumCaseDecl_create(declContext:caseKeywordLoc:elements:)" )
375
406
void * EnumCaseDecl_create (BridgedDeclContext cDeclContext ,
376
407
BridgedSourceLoc cCaseKeywordLoc ,
377
408
BridgedArrayRef cElements );
378
409
410
+ SWIFT_NAME ("EnumElementDecl_create(astContext:declContext:name:nameLoc:"
411
+ "parameterList:equalsLoc:rawValue:)" )
379
412
void * EnumElementDecl_create (BridgedASTContext cContext ,
380
413
BridgedDeclContext cDeclContext ,
381
414
BridgedIdentifier cName , BridgedSourceLoc cNameLoc ,
382
415
void * _Nullable opaqueParameterList ,
383
416
BridgedSourceLoc cEqualsLoc ,
384
417
void * _Nullable opaqueRawValue );
385
418
419
+ SWIFT_NAME (
420
+ "StructDecl_create(astContext:declContext:structKeywordLoc:name:nameLoc:"
421
+ "genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
386
422
BridgedDeclContextAndDecl StructDecl_create (
387
423
BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
388
424
BridgedSourceLoc cStructKeywordLoc , BridgedIdentifier cName ,
389
425
BridgedSourceLoc cNameLoc , void * _Nullable opaqueGenericParamList ,
390
426
BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
391
427
BridgedSourceRange cBraceRange );
392
428
429
+ SWIFT_NAME (
430
+ "ClassDecl_create(astContext:declContext:classKeywordLoc:name:nameLoc:"
431
+ "genericParamList:inheritedTypes:genericWhereClause:braceRange:isActor:)" )
393
432
BridgedDeclContextAndDecl ClassDecl_create (
394
433
BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
395
434
BridgedSourceLoc cClassKeywordLoc , BridgedIdentifier cName ,
396
435
BridgedSourceLoc cNameLoc , void * _Nullable opaqueGenericParamList ,
397
436
BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
398
437
BridgedSourceRange cBraceRange , _Bool isActor );
399
438
439
+ SWIFT_NAME ("ProtocolDecl_create(astContext:declContext:protocolKeywordLoc:name:"
440
+ "nameLoc:primaryAssociatedTypeNames:inheritedTypes:"
441
+ "genericWhereClause:braceRange:)" )
400
442
BridgedDeclContextAndDecl ProtocolDecl_create (
401
443
BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
402
444
BridgedSourceLoc cProtocolKeywordLoc , BridgedIdentifier cName ,
403
445
BridgedSourceLoc cNameLoc , BridgedArrayRef cPrimaryAssociatedTypeNames ,
404
446
BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
405
447
BridgedSourceRange cBraceRange );
406
448
449
+ SWIFT_NAME (
450
+ "AssociatedTypeDecl_create(astContext:declContext:associatedtypeKeywordLoc:"
451
+ "name:nameLoc:inheritedTypes:defaultType:genericWhereClause:)" )
407
452
void * AssociatedTypeDecl_create (BridgedASTContext cContext ,
408
453
BridgedDeclContext cDeclContext ,
409
454
BridgedSourceLoc cAssociatedtypeKeywordLoc ,
@@ -413,6 +458,8 @@ void *AssociatedTypeDecl_create(BridgedASTContext cContext,
413
458
void * _Nullable opaqueDefaultType ,
414
459
void * _Nullable opaqueGenericWhereClause );
415
460
461
+ SWIFT_NAME ("ExtensionDecl_create(astContext:declContext:extensionKeywordLoc:"
462
+ "extendedType:inheritedTypes:genericWhereClause:braceRange:)" )
416
463
BridgedDeclContextAndDecl ExtensionDecl_create (
417
464
BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
418
465
BridgedSourceLoc cExtensionKeywordLoc , void * opaqueExtendedType ,
@@ -425,6 +472,9 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(closed) {
425
472
BridgedOperatorFixityPostfix ,
426
473
} BridgedOperatorFixity ;
427
474
475
+ SWIFT_NAME (
476
+ "OperatorDecl_create(astContext:declContext:fixity:operatorKeywordLoc:name:"
477
+ "nameLoc:colonLoc:precedenceGroupName:PrecedenceGroupLoc:)" )
428
478
void * OperatorDecl_create (BridgedASTContext cContext ,
429
479
BridgedDeclContext cDeclContext ,
430
480
BridgedOperatorFixity cFixity ,
@@ -440,6 +490,11 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(closed) {
440
490
BridgedAssociativityRight ,
441
491
} BridgedAssociativity ;
442
492
493
+ SWIFT_NAME ("PrecedenceGroupDecl_create(declContext:precedencegroupKeywordLoc:"
494
+ "name:nameLoc:leftBraceLoc:associativityLabelLoc:"
495
+ "associativityValueLoc:associativity:assignmentLabelLoc:"
496
+ "assignmentValueLoc:isAssignment:higherThanKeywordLoc:"
497
+ "higherThanNames:lowerThanKeywordLoc:lowerThanNames:rightBraceLoc:)" )
443
498
void * PrecedenceGroupDecl_create (
444
499
BridgedDeclContext cDeclContext ,
445
500
BridgedSourceLoc cPrecedencegroupKeywordLoc , BridgedIdentifier cName ,
@@ -463,19 +518,25 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(open) {
463
518
BridgedImportKindFunc ,
464
519
} BridgedImportKind ;
465
520
521
+ SWIFT_NAME ("ImportDecl_create(astContext:declContext:importKeywordLoc:"
522
+ "importKind:importKindLoc:path:)" )
466
523
void * ImportDecl_create (BridgedASTContext cContext ,
467
524
BridgedDeclContext cDeclContext ,
468
525
BridgedSourceLoc cImportKeywordLoc ,
469
526
BridgedImportKind cImportKind ,
470
527
BridgedSourceLoc cImportKindLoc ,
471
528
BridgedArrayRef cImportPathElements );
472
529
530
+ SWIFT_NAME ("GenericParamList_create(astContext:leftAngleLoc:parameters:"
531
+ "genericWhereClause:rightAngleLoc:)" )
473
532
void * GenericParamList_create (BridgedASTContext cContext ,
474
533
BridgedSourceLoc cLeftAngleLoc ,
475
534
BridgedArrayRef cParameters ,
476
535
void * _Nullable opaqueGenericWhereClause ,
477
536
BridgedSourceLoc cRightAngleLoc );
478
537
538
+ SWIFT_NAME ("GenericTypeParamDecl_create(astContext:declContext:eachKeywordLoc:"
539
+ "name:nameLoc:inheritedType:index:)" )
479
540
void * GenericTypeParamDecl_create (BridgedASTContext cContext ,
480
541
BridgedDeclContext cDeclContext ,
481
542
BridgedSourceLoc cEachLoc ,
@@ -484,10 +545,14 @@ void *GenericTypeParamDecl_create(BridgedASTContext cContext,
484
545
void * _Nullable opaqueInheritedType ,
485
546
SwiftInt index );
486
547
548
+ SWIFT_NAME (
549
+ "TrailingWhereClause_create(astContext:whereKeywordLoc:requirements:)" )
487
550
void * TrailingWhereClause_create (BridgedASTContext cContext ,
488
551
BridgedSourceLoc cWhereKeywordLoc ,
489
552
BridgedArrayRef cRequirements );
490
553
554
+ SWIFT_NAME (
555
+ "ParameterList_create(astContext:leftParenLoc:parameters:rightParenLoc:)" )
491
556
void * ParameterList_create (BridgedASTContext cContext ,
492
557
BridgedSourceLoc cLeftParenLoc ,
493
558
BridgedArrayRef cParameters ,
@@ -600,4 +665,6 @@ _Bool Plugin_waitForNextMessage(PluginHandle handle, BridgedData *data);
600
665
SWIFT_END_ASSUME_NONNULL
601
666
SWIFT_END_NULLABILITY_ANNOTATIONS
602
667
668
+ #undef SWIFT_NAME
669
+
603
670
#endif // SWIFT_C_AST_ASTBRIDGING_H
0 commit comments