@@ -84,6 +84,7 @@ class BridgedCanType;
8484class BridgedASTContext ;
8585struct BridgedSubstitutionMap ;
8686struct BridgedGenericSignature ;
87+ struct BridgedCanGenericSignature ;
8788struct BridgedConformance ;
8889class BridgedParameterList ;
8990
@@ -369,6 +370,7 @@ struct BridgedDeclObj {
369370 BRIDGED_INLINE bool AbstractStorage_isConst () const ;
370371 BRIDGED_INLINE bool GenericType_isGenericAtAnyLevel () const ;
371372 BRIDGED_INLINE bool NominalType_isGlobalActor () const ;
373+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType NominalType_getDeclaredInterfaceType () const ;
372374 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE OptionalBridgedDeclObj NominalType_getValueTypeDestructor () const ;
373375 BRIDGED_INLINE bool Enum_hasRawType () const ;
374376 BRIDGED_INLINE bool Struct_hasUnreferenceableStorage () const ;
@@ -378,6 +380,10 @@ struct BridgedDeclObj {
378380 BRIDGED_INLINE bool AbstractFunction_isOverridden () const ;
379381 BRIDGED_INLINE bool Destructor_isIsolated () const ;
380382 BRIDGED_INLINE bool EnumElementDecl_hasAssociatedValues () const ;
383+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedParameterList
384+ EnumElementDecl_getParameterList () const ;
385+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef
386+ EnumElementDecl_getNameStr () const ;
381387 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedStringRef AccessorDecl_getKindName () const ;
382388};
383389
@@ -431,6 +437,23 @@ class BridgedASTNode {
431437#define ABSTRACT_DECL (Id, Parent ) DECL(Id, Parent)
432438#include " swift/AST/DeclNodes.def"
433439
440+ // Declare `.asValueDecl` on each BridgedXXXDecl type that's also a
441+ // ValueDecl.
442+ #define DECL (Id, Parent )
443+ #define VALUE_DECL (Id, Parent ) \
444+ SWIFT_NAME (" getter:Bridged" #Id " Decl.asValueDecl(self:)" ) \
445+ BridgedValueDecl Bridged##Id##Decl_asValueDecl(Bridged##Id##Decl decl);
446+ #include " swift/AST/DeclNodes.def"
447+
448+ // Declare `.asNominalTypeDecl` on each BridgedXXXDecl type that's also a
449+ // NominalTypeDecl.
450+ #define DECL (Id, Parent )
451+ #define NOMINAL_TYPE_DECL (Id, Parent ) \
452+ SWIFT_NAME (" getter:Bridged" #Id " Decl.asNominalTypeDecl(self:)" ) \
453+ BridgedNominalTypeDecl Bridged##Id##Decl_asNominalTypeDecl( \
454+ Bridged##Id##Decl decl);
455+ #include " swift/AST/DeclNodes.def"
456+
434457// Declare `.asDeclContext` on each BridgedXXXDecl type that's also a
435458// DeclContext.
436459#define DECL (Id, Parent )
@@ -440,6 +463,16 @@ class BridgedASTNode {
440463#define ABSTRACT_CONTEXT_DECL (Id, Parent ) CONTEXT_DECL(Id, Parent)
441464#include " swift/AST/DeclNodes.def"
442465
466+ // Declare `.asGenericContext` on each BridgedXXXDecl type that's also a
467+ // GenericContext.
468+ #define DECL (Id, Parent )
469+ #define GENERIC_DECL (Id, Parent ) \
470+ SWIFT_NAME (" getter:Bridged" #Id " Decl.asGenericContext(self:)" ) \
471+ BridgedGenericContext Bridged##Id##Decl_asGenericContext( \
472+ Bridged##Id##Decl decl);
473+ #define ITERABLE_GENERIC_DECL (Id, Parent ) GENERIC_DECL(Id, Parent)
474+ #include " swift/AST/DeclNodes.def"
475+
443476// Declare `.asStmt` on each BridgedXXXStmt type, which upcasts a wrapper for
444477// a Stmt subclass to a BridgedStmt.
445478#define STMT (Id, Parent ) \
@@ -617,6 +650,10 @@ BridgedDeclContext_getParentSourceFile(BridgedDeclContext dc);
617650SWIFT_NAME (" getter:BridgedSourceFile.isScriptMode(self:)" )
618651BRIDGED_INLINE bool BridgedSourceFile_isScriptMode(BridgedSourceFile sf);
619652
653+ SWIFT_NAME (" BridgedSourceFile.addTopLevelDecl(self:_:)" )
654+ BRIDGED_INLINE void BridgedSourceFile_addTopLevelDecl(BridgedSourceFile sf,
655+ BridgedDecl decl);
656+
620657SWIFT_NAME (" BridgedPatternBindingInitializer.create(declContext:)" )
621658BridgedPatternBindingInitializer
622659BridgedPatternBindingInitializer_create(BridgedDeclContext cDeclContext);
@@ -1337,6 +1374,9 @@ SWIFT_NAME("BridgedDecl.forEachDeclToHoist(self:_:)")
13371374void BridgedDecl_forEachDeclToHoist(BridgedDecl decl,
13381375 BridgedSwiftClosure closure);
13391376
1377+ SWIFT_NAME (" BridgedDecl.getDeclContext(self:)" )
1378+ BridgedDeclContext BridgedDecl_getDeclContext(BridgedDecl decl);
1379+
13401380enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedStaticSpelling {
13411381 BridgedStaticSpellingNone,
13421382 BridgedStaticSpellingStatic,
@@ -1384,10 +1424,18 @@ BridgedParamDecl BridgedParamDecl_createParsed(
13841424 swift::SourceLoc paramNameLoc, BridgedNullableExpr defaultValue,
13851425 BridgedNullableDefaultArgumentInitializer cDefaultArgumentInitContext);
13861426
1427+ SWIFT_NAME (" BridgedParamDecl.cloneWithoutType(self:)" )
1428+ BRIDGED_INLINE BridgedParamDecl
1429+ BridgedParamDecl_cloneWithoutType(BridgedParamDecl cDecl);
1430+
13871431SWIFT_NAME (" BridgedParamDecl.setTypeRepr(self:_:)" )
13881432BRIDGED_INLINE void BridgedParamDecl_setTypeRepr(BridgedParamDecl cDecl,
13891433 BridgedTypeRepr cType);
13901434
1435+ SWIFT_NAME (" BridgedParamDecl.setInterfaceType(self:_:)" )
1436+ BRIDGED_INLINE void BridgedParamDecl_setInterfaceType(BridgedParamDecl cDecl,
1437+ BridgedASTType cType);
1438+
13911439// / The various spellings of ownership modifier that can be used in source.
13921440enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedParamSpecifier {
13931441 BridgedParamSpecifierDefault,
@@ -1406,8 +1454,13 @@ BRIDGED_INLINE void
14061454BridgedParamDecl_setSpecifier(BridgedParamDecl cDecl,
14071455 BridgedParamSpecifier cSpecifier);
14081456
1409- SWIFT_NAME (" BridgedParamDecl.setImplicit(self:)" )
1410- BRIDGED_INLINE void BridgedParamDecl_setImplicit(BridgedParamDecl cDecl);
1457+ SWIFT_NAME (" BridgedDecl.setImplicit(self:)" )
1458+ BRIDGED_INLINE void BridgedDecl_setImplicit(BridgedDecl cDecl);
1459+
1460+ SWIFT_NAME (" BridgedGenericContext.setGenericSignature(self:_:)" )
1461+ BRIDGED_INLINE void
1462+ BridgedGenericContext_setGenericSignature(BridgedGenericContext cDecl,
1463+ BridgedGenericSignature cGenSig);
14111464
14121465SWIFT_NAME (" BridgedConstructorDecl.setParsedBody(self:_:)" )
14131466void BridgedConstructorDecl_setParsedBody(BridgedConstructorDecl decl,
@@ -1471,14 +1524,20 @@ void BridgedExtensionDecl_setParsedMembers(BridgedExtensionDecl decl,
14711524SWIFT_NAME (
14721525 " BridgedEnumDecl.createParsed(_:declContext:enumKeywordLoc:name:nameLoc:"
14731526 " genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
1474- BridgedNominalTypeDecl BridgedEnumDecl_createParsed(
1527+ BridgedEnumDecl BridgedEnumDecl_createParsed(
14751528 BridgedASTContext cContext, BridgedDeclContext cDeclContext,
14761529 swift::SourceLoc enumKeywordLoc, swift::Identifier name,
14771530 swift::SourceLoc nameLoc, BridgedNullableGenericParamList genericParamList,
14781531 BridgedArrayRef cInheritedTypes,
14791532 BridgedNullableTrailingWhereClause genericWhereClause,
14801533 swift::SourceRange braceRange);
14811534
1535+ SWIFT_NAME (" BridgedEnumDecl.create(_:declContext:name:genericParamList:)" )
1536+ BridgedEnumDecl
1537+ BridgedEnumDecl_create(BridgedASTContext cContext,
1538+ BridgedDeclContext cDeclContext, BridgedStringRef name,
1539+ BridgedNullableGenericParamList genericParamList);
1540+
14821541SWIFT_NAME (
14831542 " BridgedEnumCaseDecl.createParsed(declContext:caseKeywordLoc:elements:)" )
14841543BridgedEnumCaseDecl
@@ -1494,6 +1553,12 @@ BridgedEnumElementDecl BridgedEnumElementDecl_createParsed(
14941553 BridgedNullableParameterList parameterList, swift::SourceLoc equalsLoc,
14951554 BridgedNullableExpr opaqueRawValue);
14961555
1556+ SWIFT_NAME (" BridgedEnumElementDecl.create(_:declContext:name:"
1557+ " parameterList:)" )
1558+ BridgedEnumElementDecl BridgedEnumElementDecl_create(
1559+ BridgedASTContext cContext, BridgedDeclContext cDeclContext,
1560+ BridgedStringRef name, BridgedParameterList parameterList);
1561+
14971562SWIFT_NAME (" BridgedStructDecl.createParsed(_:declContext:structKeywordLoc:name:"
14981563 " nameLoc:genericParamList:inheritedTypes:genericWhereClause:"
14991564 " braceRange:)" )
@@ -1662,6 +1727,9 @@ void BridgedTopLevelCodeDecl_dump(BridgedTopLevelCodeDecl decl);
16621727SWIFT_NAME (" BridgedDecl.dump(self:)" )
16631728void BridgedDecl_dump(BridgedDecl decl);
16641729
1730+ SWIFT_NAME (" BridgedValueDecl.setAccess(self:_:)" )
1731+ void BridgedValueDecl_setAccess(BridgedValueDecl decl, swift::AccessLevel accessLevel);
1732+
16651733// ===----------------------------------------------------------------------===//
16661734// MARK: AbstractStorageDecl
16671735// ===----------------------------------------------------------------------===//
@@ -1711,6 +1779,11 @@ SWIFT_NAME("BridgedNominalTypeDecl.getSourceLocation(self:)")
17111779BRIDGED_INLINE swift::SourceLoc
17121780BridgedNominalTypeDecl_getSourceLocation(BridgedNominalTypeDecl decl);
17131781
1782+ SWIFT_NAME (" BridgedNominalTypeDecl.addMember(self:_:)" )
1783+ BRIDGED_INLINE void
1784+ BridgedNominalTypeDecl_addMember(BridgedNominalTypeDecl cDecl,
1785+ BridgedDecl member);
1786+
17141787// ===----------------------------------------------------------------------===//
17151788// MARK: SubscriptDecl
17161789// ===----------------------------------------------------------------------===//
@@ -2913,6 +2986,10 @@ BridgedParameterList BridgedParameterList_createParsed(
29132986 BridgedASTContext cContext, swift::SourceLoc leftParenLoc,
29142987 BridgedArrayRef cParameters, swift::SourceLoc rightParenLoc);
29152988
2989+ SWIFT_NAME (" BridgedParameterList.create(_:parameters:)" )
2990+ BridgedParameterList BridgedParameterList_create(BridgedASTContext cContext,
2991+ BridgedArrayRef cParameters);
2992+
29162993SWIFT_NAME (" getter:BridgedParameterList.size(self:)" )
29172994size_t BridgedParameterList_size(BridgedParameterList cParameterList);
29182995
@@ -3017,6 +3094,8 @@ struct BridgedASTType {
30173094 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGenericSignature getInvocationGenericSignatureOfFunctionType () const ;
30183095 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType subst (BridgedSubstitutionMap substMap) const ;
30193096 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformance checkConformance (BridgedDeclObj proto) const ;
3097+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeOutOfContext () const ;
3098+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanType getReducedType (BridgedGenericSignature sig) const ;
30203099};
30213100
30223101class BridgedCanType {
@@ -3027,6 +3106,7 @@ class BridgedCanType {
30273106 BRIDGED_INLINE BridgedCanType (swift::CanType ty);
30283107 BRIDGED_INLINE swift::CanType unbridged () const ;
30293108 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType getRawType () const ;
3109+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanGenericSignature SILFunctionType_getSubstGenericSignature () const ;
30303110};
30313111
30323112struct BridgedASTTypeArray {
@@ -3091,6 +3171,14 @@ struct BridgedGenericSignature {
30913171 BridgedOwnedString getDebugDescription () const ;
30923172 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTTypeArray getGenericParams () const ;
30933173 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeIntoContext (BridgedASTType type) const ;
3174+ BRIDGED_INLINE BridgedCanGenericSignature getCanonicalSignature () const ;
3175+ };
3176+
3177+ struct BridgedCanGenericSignature {
3178+ const swift::GenericSignatureImpl *_Nullable impl;
3179+
3180+ BRIDGED_INLINE swift::CanGenericSignature unbridged () const ;
3181+ BRIDGED_INLINE BridgedGenericSignature getGenericSignature () const ;
30943182};
30953183
30963184struct BridgedFingerprint {
0 commit comments