2222// it causes importing the "Darwin"/"Glibc" overlay module. That violates
2323// layering. i.e. Darwin overlay is created by Swift compiler.
2424
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+
2531SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
2632SWIFT_BEGIN_ASSUME_NONNULL
2733
@@ -256,13 +262,18 @@ BridgedIdentifier ASTContext_getIdentifier(BridgedASTContext cContext,
256262_Bool ASTContext_langOptsHasFeature (BridgedASTContext cContext ,
257263 BridgedFeature feature );
258264
265+ SWIFT_NAME ("TopLevelCodeDecl_createStmt(astContext:declContext:startLoc:"
266+ "statement:endLoc:)" )
259267void * TopLevelCodeDecl_createStmt (BridgedASTContext cContext ,
260268 BridgedDeclContext cDeclContext ,
261- BridgedSourceLoc cStartLoc , void * element ,
269+ BridgedSourceLoc cStartLoc , void * statement ,
262270 BridgedSourceLoc cEndLoc );
271+
272+ SWIFT_NAME ("TopLevelCodeDecl_createExpr(astContext:declContext:startLoc:"
273+ "expression:endLoc:)" )
263274void * TopLevelCodeDecl_createExpr (BridgedASTContext cContext ,
264275 BridgedDeclContext cDeclContext ,
265- BridgedSourceLoc cStartLoc , void * element ,
276+ BridgedSourceLoc cStartLoc , void * expression ,
266277 BridgedSourceLoc cEndLoc );
267278
268279void * ReturnStmt_create (BridgedASTContext cContext , BridgedSourceLoc cLoc ,
@@ -288,13 +299,16 @@ void *IntegerLiteralExpr_create(BridgedASTContext cContext, BridgedString cStr,
288299void * BooleanLiteralExpr_create (BridgedASTContext cContext , _Bool value ,
289300 BridgedSourceLoc cTokenLoc );
290301
302+ SWIFT_NAME ("NilLiteralExpr_create(astContext:nilKeywordLoc:)" )
291303void * NilLiteralExpr_create (BridgedASTContext cContext ,
292304 BridgedSourceLoc cNilKeywordLoc );
293305
294306void * ArrayExpr_create (BridgedASTContext cContext , BridgedSourceLoc cLLoc ,
295307 BridgedArrayRef elements , BridgedArrayRef commas ,
296308 BridgedSourceLoc cRLoc );
297309
310+ SWIFT_NAME ("VarDecl_create(astContext:declContext:bindingKeywordLoc:nameExpr:"
311+ "initializer:isStatic:isLet:)" )
298312void * VarDecl_create (BridgedASTContext cContext ,
299313 BridgedDeclContext cDeclContext ,
300314 BridgedSourceLoc cBindingKeywordLoc , void * opaqueNameExpr ,
@@ -313,15 +327,21 @@ void *BraceStmt_create(BridgedASTContext cContext, BridgedSourceLoc cLBLoc,
313327
314328BridgedSourceLoc SourceLoc_advanced (BridgedSourceLoc cLoc , SwiftInt len );
315329
330+ SWIFT_NAME ("ParamDecl_create(astContext:declContext:specifierLoc:firstName:"
331+ "firstNameLoc:secondName:secondNameLoc:type:defaultValue:)" )
316332void *
317333ParamDecl_create (BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
318334 BridgedSourceLoc cSpecifierLoc , BridgedIdentifier cFirstName ,
319335 BridgedSourceLoc cFirstNameLoc , BridgedIdentifier cSecondName ,
320336 BridgedSourceLoc cSecondNameLoc , void * _Nullable opaqueType ,
321337 void * _Nullable opaqueDefaultValue );
322338
339+ SWIFT_NAME ("AbstractFunctionDecl_setBody(_:ofDecl:)" )
323340void AbstractFunctionDecl_setBody (void * opaqueBody , void * opaqueDecl );
324341
342+ SWIFT_NAME ("FuncDecl_create(astContext:declContext:staticLoc:funcKeywordLoc:"
343+ "name:nameLoc:genericParamList:parameterList:asyncSpecifierLoc:"
344+ "throwsSpecifierLoc:returnType:genericWhereClause:)" )
325345struct BridgedDeclContextAndDecl
326346FuncDecl_create (BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
327347 BridgedSourceLoc cStaticLoc , BridgedSourceLoc cFuncKeywordLoc ,
@@ -331,13 +351,17 @@ FuncDecl_create(BridgedASTContext cContext, BridgedDeclContext cDeclContext,
331351 BridgedSourceLoc cThrowsLoc , void * _Nullable opaqueReturnType ,
332352 void * _Nullable opaqueGenericWhereClause );
333353
354+ SWIFT_NAME ("ConstructorDecl_create(astContext:declContext:initKeywordLoc:"
355+ "failabilityMarkLoc:isIUO:genericParamList:parameterList:"
356+ "asyncSpecifierLoc:throwsSpecifierLoc:genericWhereClause:)" )
334357BridgedDeclContextAndDecl ConstructorDecl_create (
335358 BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
336359 BridgedSourceLoc cInitKeywordLoc , BridgedSourceLoc cFailabilityMarkLoc ,
337360 _Bool isIUO , void * _Nullable opaqueGenericParams , void * opaqueParameterList ,
338361 BridgedSourceLoc cAsyncLoc , BridgedSourceLoc cThrowsLoc ,
339362 void * _Nullable opaqueGenericWhereClause );
340363
364+ SWIFT_NAME ("DestructorDecl_create(astContext:declContext:deinitKeywordLoc:)" )
341365BridgedDeclContextAndDecl
342366DestructorDecl_create (BridgedASTContext cContext ,
343367 BridgedDeclContext cDeclContext ,
@@ -353,6 +377,9 @@ void *UnresolvedDotExpr_create(BridgedASTContext cContext, void *base,
353377void * ClosureExpr_create (BridgedASTContext cContext , void * body ,
354378 BridgedDeclContext cDeclContext );
355379
380+ SWIFT_NAME (
381+ "TypeAliasDecl_create(astContext:declContext:typealiasKeywordLoc:name:"
382+ "nameLoc:genericParamList:equalLoc:underlyingType:genericWhereClause:)" )
356383void * TypeAliasDecl_create (BridgedASTContext cContext ,
357384 BridgedDeclContext cDeclContext ,
358385 BridgedSourceLoc cAliasKeywordLoc ,
@@ -362,48 +389,66 @@ void *TypeAliasDecl_create(BridgedASTContext cContext,
362389 void * opaqueUnderlyingType ,
363390 void * _Nullable opaqueGenericWhereClause );
364391
392+ SWIFT_NAME ("IterableDeclContext_setParsedMembers(_:ofDecl:)" )
365393void IterableDeclContext_setParsedMembers (BridgedArrayRef members ,
366394 void * opaqueDecl );
367395
396+ SWIFT_NAME ("EnumDecl_create(astContext:declContext:enumKeywordLoc:name:nameLoc:"
397+ "genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
368398BridgedDeclContextAndDecl EnumDecl_create (
369399 BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
370400 BridgedSourceLoc cEnumKeywordLoc , BridgedIdentifier cName ,
371401 BridgedSourceLoc cNameLoc , void * _Nullable opaqueGenericParamList ,
372402 BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
373403 BridgedSourceRange cBraceRange );
374404
405+ SWIFT_NAME ("EnumCaseDecl_create(declContext:caseKeywordLoc:elements:)" )
375406void * EnumCaseDecl_create (BridgedDeclContext cDeclContext ,
376407 BridgedSourceLoc cCaseKeywordLoc ,
377408 BridgedArrayRef cElements );
378409
410+ SWIFT_NAME ("EnumElementDecl_create(astContext:declContext:name:nameLoc:"
411+ "parameterList:equalsLoc:rawValue:)" )
379412void * EnumElementDecl_create (BridgedASTContext cContext ,
380413 BridgedDeclContext cDeclContext ,
381414 BridgedIdentifier cName , BridgedSourceLoc cNameLoc ,
382415 void * _Nullable opaqueParameterList ,
383416 BridgedSourceLoc cEqualsLoc ,
384417 void * _Nullable opaqueRawValue );
385418
419+ SWIFT_NAME (
420+ "StructDecl_create(astContext:declContext:structKeywordLoc:name:nameLoc:"
421+ "genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
386422BridgedDeclContextAndDecl StructDecl_create (
387423 BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
388424 BridgedSourceLoc cStructKeywordLoc , BridgedIdentifier cName ,
389425 BridgedSourceLoc cNameLoc , void * _Nullable opaqueGenericParamList ,
390426 BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
391427 BridgedSourceRange cBraceRange );
392428
429+ SWIFT_NAME (
430+ "ClassDecl_create(astContext:declContext:classKeywordLoc:name:nameLoc:"
431+ "genericParamList:inheritedTypes:genericWhereClause:braceRange:isActor:)" )
393432BridgedDeclContextAndDecl ClassDecl_create (
394433 BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
395434 BridgedSourceLoc cClassKeywordLoc , BridgedIdentifier cName ,
396435 BridgedSourceLoc cNameLoc , void * _Nullable opaqueGenericParamList ,
397436 BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
398437 BridgedSourceRange cBraceRange , _Bool isActor );
399438
439+ SWIFT_NAME ("ProtocolDecl_create(astContext:declContext:protocolKeywordLoc:name:"
440+ "nameLoc:primaryAssociatedTypeNames:inheritedTypes:"
441+ "genericWhereClause:braceRange:)" )
400442BridgedDeclContextAndDecl ProtocolDecl_create (
401443 BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
402444 BridgedSourceLoc cProtocolKeywordLoc , BridgedIdentifier cName ,
403445 BridgedSourceLoc cNameLoc , BridgedArrayRef cPrimaryAssociatedTypeNames ,
404446 BridgedArrayRef cInheritedTypes , void * _Nullable opaqueGenericWhereClause ,
405447 BridgedSourceRange cBraceRange );
406448
449+ SWIFT_NAME (
450+ "AssociatedTypeDecl_create(astContext:declContext:associatedtypeKeywordLoc:"
451+ "name:nameLoc:inheritedTypes:defaultType:genericWhereClause:)" )
407452void * AssociatedTypeDecl_create (BridgedASTContext cContext ,
408453 BridgedDeclContext cDeclContext ,
409454 BridgedSourceLoc cAssociatedtypeKeywordLoc ,
@@ -413,6 +458,8 @@ void *AssociatedTypeDecl_create(BridgedASTContext cContext,
413458 void * _Nullable opaqueDefaultType ,
414459 void * _Nullable opaqueGenericWhereClause );
415460
461+ SWIFT_NAME ("ExtensionDecl_create(astContext:declContext:extensionKeywordLoc:"
462+ "extendedType:inheritedTypes:genericWhereClause:braceRange:)" )
416463BridgedDeclContextAndDecl ExtensionDecl_create (
417464 BridgedASTContext cContext , BridgedDeclContext cDeclContext ,
418465 BridgedSourceLoc cExtensionKeywordLoc , void * opaqueExtendedType ,
@@ -425,6 +472,9 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(closed) {
425472 BridgedOperatorFixityPostfix ,
426473} BridgedOperatorFixity ;
427474
475+ SWIFT_NAME (
476+ "OperatorDecl_create(astContext:declContext:fixity:operatorKeywordLoc:name:"
477+ "nameLoc:colonLoc:precedenceGroupName:PrecedenceGroupLoc:)" )
428478void * OperatorDecl_create (BridgedASTContext cContext ,
429479 BridgedDeclContext cDeclContext ,
430480 BridgedOperatorFixity cFixity ,
@@ -440,6 +490,11 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(closed) {
440490 BridgedAssociativityRight ,
441491} BridgedAssociativity ;
442492
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:)" )
443498void * PrecedenceGroupDecl_create (
444499 BridgedDeclContext cDeclContext ,
445500 BridgedSourceLoc cPrecedencegroupKeywordLoc , BridgedIdentifier cName ,
@@ -463,19 +518,25 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(open) {
463518 BridgedImportKindFunc ,
464519} BridgedImportKind ;
465520
521+ SWIFT_NAME ("ImportDecl_create(astContext:declContext:importKeywordLoc:"
522+ "importKind:importKindLoc:path:)" )
466523void * ImportDecl_create (BridgedASTContext cContext ,
467524 BridgedDeclContext cDeclContext ,
468525 BridgedSourceLoc cImportKeywordLoc ,
469526 BridgedImportKind cImportKind ,
470527 BridgedSourceLoc cImportKindLoc ,
471528 BridgedArrayRef cImportPathElements );
472529
530+ SWIFT_NAME ("GenericParamList_create(astContext:leftAngleLoc:parameters:"
531+ "genericWhereClause:rightAngleLoc:)" )
473532void * GenericParamList_create (BridgedASTContext cContext ,
474533 BridgedSourceLoc cLeftAngleLoc ,
475534 BridgedArrayRef cParameters ,
476535 void * _Nullable opaqueGenericWhereClause ,
477536 BridgedSourceLoc cRightAngleLoc );
478537
538+ SWIFT_NAME ("GenericTypeParamDecl_create(astContext:declContext:eachKeywordLoc:"
539+ "name:nameLoc:inheritedType:index:)" )
479540void * GenericTypeParamDecl_create (BridgedASTContext cContext ,
480541 BridgedDeclContext cDeclContext ,
481542 BridgedSourceLoc cEachLoc ,
@@ -484,10 +545,14 @@ void *GenericTypeParamDecl_create(BridgedASTContext cContext,
484545 void * _Nullable opaqueInheritedType ,
485546 SwiftInt index );
486547
548+ SWIFT_NAME (
549+ "TrailingWhereClause_create(astContext:whereKeywordLoc:requirements:)" )
487550void * TrailingWhereClause_create (BridgedASTContext cContext ,
488551 BridgedSourceLoc cWhereKeywordLoc ,
489552 BridgedArrayRef cRequirements );
490553
554+ SWIFT_NAME (
555+ "ParameterList_create(astContext:leftParenLoc:parameters:rightParenLoc:)" )
491556void * ParameterList_create (BridgedASTContext cContext ,
492557 BridgedSourceLoc cLeftParenLoc ,
493558 BridgedArrayRef cParameters ,
@@ -600,4 +665,6 @@ _Bool Plugin_waitForNextMessage(PluginHandle handle, BridgedData *data);
600665SWIFT_END_ASSUME_NONNULL
601666SWIFT_END_NULLABILITY_ANNOTATIONS
602667
668+ #undef SWIFT_NAME
669+
603670#endif // SWIFT_C_AST_ASTBRIDGING_H
0 commit comments