@@ -361,6 +361,7 @@ struct BridgedDeclObj {
361361 BRIDGED_INLINE swift::SourceLoc getLoc () const ;
362362 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj getModuleContext () const ;
363363 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE OptionalBridgedDeclObj getParent () const ;
364+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclContext getDeclContext () const ;
364365 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef Type_getName () const ;
365366 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef Value_getUserFacingName () const ;
366367 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE swift::SourceLoc Value_getNameLoc () const ;
@@ -378,6 +379,10 @@ struct BridgedDeclObj {
378379 BRIDGED_INLINE bool AbstractFunction_isOverridden () const ;
379380 BRIDGED_INLINE bool Destructor_isIsolated () const ;
380381 BRIDGED_INLINE bool EnumElementDecl_hasAssociatedValues () const ;
382+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedParameterList
383+ EnumElementDecl_getParameterList () const ;
384+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef
385+ EnumElementDecl_getNameStr () const ;
381386 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef AccessorDecl_getKindName () const ;
382387};
383388
@@ -431,6 +436,23 @@ class BridgedASTNode {
431436#define ABSTRACT_DECL (Id, Parent ) DECL(Id, Parent)
432437#include " swift/AST/DeclNodes.def"
433438
439+ // Declare `.asValueDecl` on each BridgedXXXDecl type that's also a
440+ // ValueDecl.
441+ #define DECL (Id, Parent )
442+ #define VALUE_DECL (Id, Parent ) \
443+ SWIFT_NAME (" getter:Bridged" #Id " Decl.asValueDecl(self:)" ) \
444+ BridgedValueDecl Bridged##Id##Decl_asValueDecl(Bridged##Id##Decl decl);
445+ #include " swift/AST/DeclNodes.def"
446+
447+ // Declare `.asNominalTypeDecl` on each BridgedXXXDecl type that's also a
448+ // NominalTypeDecl.
449+ #define DECL (Id, Parent )
450+ #define NOMINAL_TYPE_DECL (Id, Parent ) \
451+ SWIFT_NAME (" getter:Bridged" #Id " Decl.asNominalTypeDecl(self:)" ) \
452+ BridgedNominalTypeDecl Bridged##Id##Decl_asNominalTypeDecl( \
453+ Bridged##Id##Decl decl);
454+ #include " swift/AST/DeclNodes.def"
455+
434456// Declare `.asDeclContext` on each BridgedXXXDecl type that's also a
435457// DeclContext.
436458#define DECL (Id, Parent )
@@ -440,6 +462,16 @@ class BridgedASTNode {
440462#define ABSTRACT_CONTEXT_DECL (Id, Parent ) CONTEXT_DECL(Id, Parent)
441463#include " swift/AST/DeclNodes.def"
442464
465+ // Declare `.asGenericContext` on each BridgedXXXDecl type that's also a
466+ // GenericContext.
467+ #define DECL (Id, Parent )
468+ #define GENERIC_DECL (Id, Parent ) \
469+ SWIFT_NAME (" getter:Bridged" #Id " Decl.asGenericContext(self:)" ) \
470+ BridgedGenericContext Bridged##Id##Decl_asGenericContext( \
471+ Bridged##Id##Decl decl);
472+ #define ITERABLE_GENERIC_DECL (Id, Parent ) GENERIC_DECL(Id, Parent)
473+ #include " swift/AST/DeclNodes.def"
474+
443475// Declare `.asStmt` on each BridgedXXXStmt type, which upcasts a wrapper for
444476// a Stmt subclass to a BridgedStmt.
445477#define STMT (Id, Parent ) \
@@ -617,6 +649,10 @@ BridgedDeclContext_getParentSourceFile(BridgedDeclContext dc);
617649SWIFT_NAME (" getter:BridgedSourceFile.isScriptMode(self:)" )
618650BRIDGED_INLINE bool BridgedSourceFile_isScriptMode(BridgedSourceFile sf);
619651
652+ SWIFT_NAME (" BridgedSourceFile.addTopLevelDecl(self:_:)" )
653+ BRIDGED_INLINE void BridgedSourceFile_addTopLevelDecl(BridgedSourceFile sf,
654+ BridgedDecl decl);
655+
620656SWIFT_NAME (" BridgedPatternBindingInitializer.create(declContext:)" )
621657BridgedPatternBindingInitializer
622658BridgedPatternBindingInitializer_create(BridgedDeclContext cDeclContext);
@@ -1384,10 +1420,18 @@ BridgedParamDecl BridgedParamDecl_createParsed(
13841420 swift::SourceLoc paramNameLoc, BridgedNullableExpr defaultValue,
13851421 BridgedNullableDefaultArgumentInitializer cDefaultArgumentInitContext);
13861422
1423+ SWIFT_NAME (" BridgedParamDecl.cloneWithoutType(self:)" )
1424+ BRIDGED_INLINE BridgedParamDecl
1425+ BridgedParamDecl_cloneWithoutType(BridgedParamDecl cDecl);
1426+
13871427SWIFT_NAME (" BridgedParamDecl.setTypeRepr(self:_:)" )
13881428BRIDGED_INLINE void BridgedParamDecl_setTypeRepr(BridgedParamDecl cDecl,
13891429 BridgedTypeRepr cType);
13901430
1431+ SWIFT_NAME (" BridgedParamDecl.setInterfaceType(self:_:)" )
1432+ BRIDGED_INLINE void BridgedParamDecl_setInterfaceType(BridgedParamDecl cDecl,
1433+ BridgedASTType cType);
1434+
13911435// / The various spellings of ownership modifier that can be used in source.
13921436enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedParamSpecifier {
13931437 BridgedParamSpecifierDefault,
@@ -1406,8 +1450,18 @@ BRIDGED_INLINE void
14061450BridgedParamDecl_setSpecifier(BridgedParamDecl cDecl,
14071451 BridgedParamSpecifier cSpecifier);
14081452
1409- SWIFT_NAME (" BridgedParamDecl.setImplicit(self:)" )
1410- BRIDGED_INLINE void BridgedParamDecl_setImplicit(BridgedParamDecl cDecl);
1453+ SWIFT_NAME (" BridgedDecl.setImplicit(self:)" )
1454+ BRIDGED_INLINE void BridgedDecl_setImplicit(BridgedDecl cDecl);
1455+
1456+ SWIFT_NAME (" BridgedGenericContext.setGenericSignature(self:_:)" )
1457+ BRIDGED_INLINE void
1458+ BridgedGenericContext_setGenericSignature(BridgedGenericContext cDecl,
1459+ BridgedGenericSignature cGenSig);
1460+
1461+ SWIFT_NAME (" BridgedNominalTypeDecl.addMember(self:_:)" )
1462+ BRIDGED_INLINE void
1463+ BridgedNominalTypeDecl_addMember(BridgedNominalTypeDecl cDecl,
1464+ BridgedDecl member);
14111465
14121466SWIFT_NAME (" BridgedConstructorDecl.setParsedBody(self:_:)" )
14131467void BridgedConstructorDecl_setParsedBody(BridgedConstructorDecl decl,
@@ -1471,14 +1525,20 @@ void BridgedExtensionDecl_setParsedMembers(BridgedExtensionDecl decl,
14711525SWIFT_NAME (
14721526 " BridgedEnumDecl.createParsed(_:declContext:enumKeywordLoc:name:nameLoc:"
14731527 " genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
1474- BridgedNominalTypeDecl BridgedEnumDecl_createParsed(
1528+ BridgedEnumDecl BridgedEnumDecl_createParsed(
14751529 BridgedASTContext cContext, BridgedDeclContext cDeclContext,
14761530 swift::SourceLoc enumKeywordLoc, swift::Identifier name,
14771531 swift::SourceLoc nameLoc, BridgedNullableGenericParamList genericParamList,
14781532 BridgedArrayRef cInheritedTypes,
14791533 BridgedNullableTrailingWhereClause genericWhereClause,
14801534 swift::SourceRange braceRange);
14811535
1536+ SWIFT_NAME (" BridgedEnumDecl.create(_:declContext:name:genericParamList:)" )
1537+ BridgedEnumDecl
1538+ BridgedEnumDecl_create(BridgedASTContext cContext,
1539+ BridgedDeclContext cDeclContext, BridgedStringRef name,
1540+ BridgedNullableGenericParamList genericParamList);
1541+
14821542SWIFT_NAME (
14831543 " BridgedEnumCaseDecl.createParsed(declContext:caseKeywordLoc:elements:)" )
14841544BridgedEnumCaseDecl
@@ -1494,6 +1554,12 @@ BridgedEnumElementDecl BridgedEnumElementDecl_createParsed(
14941554 BridgedNullableParameterList parameterList, swift::SourceLoc equalsLoc,
14951555 BridgedNullableExpr opaqueRawValue);
14961556
1557+ SWIFT_NAME (" BridgedEnumElementDecl.create(_:declContext:name:"
1558+ " parameterList:)" )
1559+ BridgedEnumElementDecl BridgedEnumElementDecl_create(
1560+ BridgedASTContext cContext, BridgedDeclContext cDeclContext,
1561+ BridgedStringRef name, BridgedParameterList parameterList);
1562+
14971563SWIFT_NAME (" BridgedStructDecl.createParsed(_:declContext:structKeywordLoc:name:"
14981564 " nameLoc:genericParamList:inheritedTypes:genericWhereClause:"
14991565 " braceRange:)" )
@@ -1662,6 +1728,9 @@ void BridgedTopLevelCodeDecl_dump(BridgedTopLevelCodeDecl decl);
16621728SWIFT_NAME (" BridgedDecl.dump(self:)" )
16631729void BridgedDecl_dump(BridgedDecl decl);
16641730
1731+ SWIFT_NAME (" BridgedValueDecl.setAccessPublic(self:)" )
1732+ void BridgedValueDecl_setAccessPublic(BridgedValueDecl decl);
1733+
16651734// ===----------------------------------------------------------------------===//
16661735// MARK: AbstractStorageDecl
16671736// ===----------------------------------------------------------------------===//
@@ -2913,6 +2982,10 @@ BridgedParameterList BridgedParameterList_createParsed(
29132982 BridgedASTContext cContext, swift::SourceLoc leftParenLoc,
29142983 BridgedArrayRef cParameters, swift::SourceLoc rightParenLoc);
29152984
2985+ SWIFT_NAME (" BridgedParameterList.create(_:parameters:)" )
2986+ BridgedParameterList BridgedParameterList_create(BridgedASTContext cContext,
2987+ BridgedArrayRef cParameters);
2988+
29162989SWIFT_NAME (" getter:BridgedParameterList.size(self:)" )
29172990size_t BridgedParameterList_size(BridgedParameterList cParameterList);
29182991
@@ -3017,6 +3090,7 @@ struct BridgedASTType {
30173090 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGenericSignature getInvocationGenericSignatureOfFunctionType () const ;
30183091 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType subst (BridgedSubstitutionMap substMap) const ;
30193092 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformance checkConformance (BridgedDeclObj proto) const ;
3093+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeOutOfContext () const ;
30203094};
30213095
30223096class BridgedCanType {
@@ -3084,13 +3158,23 @@ struct BridgedSubstitutionMap {
30843158 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTTypeArray getReplacementTypes () const ;
30853159};
30863160
3161+ struct BridgedCanGenericSignature ;
3162+
30873163struct BridgedGenericSignature {
30883164 const swift::GenericSignatureImpl * _Nullable impl;
30893165
30903166 BRIDGED_INLINE swift::GenericSignature unbridged () const ;
30913167 BridgedOwnedString getDebugDescription () const ;
30923168 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTTypeArray getGenericParams () const ;
30933169 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeIntoContext (BridgedASTType type) const ;
3170+ BRIDGED_INLINE BridgedCanGenericSignature getCanonicalSignature () const ;
3171+ };
3172+
3173+ struct BridgedCanGenericSignature {
3174+ const swift::GenericSignatureImpl *_Nullable impl;
3175+
3176+ BRIDGED_INLINE swift::CanGenericSignature unbridged () const ;
3177+ BRIDGED_INLINE BridgedGenericSignature getGenericSignature () const ;
30943178};
30953179
30963180struct BridgedFingerprint {
0 commit comments