@@ -369,6 +369,7 @@ struct BridgedDeclObj {
369369 BRIDGED_INLINE bool AbstractStorage_isConst () const ;
370370 BRIDGED_INLINE bool GenericType_isGenericAtAnyLevel () const ;
371371 BRIDGED_INLINE bool NominalType_isGlobalActor () const ;
372+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType NominalType_getDeclaredInterfaceType () const ;
372373 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE OptionalBridgedDeclObj NominalType_getValueTypeDestructor () const ;
373374 BRIDGED_INLINE bool Enum_hasRawType () const ;
374375 BRIDGED_INLINE bool Struct_hasUnreferenceableStorage () 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);
@@ -1337,6 +1373,9 @@ SWIFT_NAME("BridgedDecl.forEachDeclToHoist(self:_:)")
13371373void BridgedDecl_forEachDeclToHoist(BridgedDecl decl,
13381374 BridgedSwiftClosure closure);
13391375
1376+ SWIFT_NAME (" BridgedDecl.getDeclContext(self:)" )
1377+ BridgedDeclContext BridgedDecl_getDeclContext(BridgedDecl decl);
1378+
13401379enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedStaticSpelling {
13411380 BridgedStaticSpellingNone,
13421381 BridgedStaticSpellingStatic,
@@ -1384,10 +1423,18 @@ BridgedParamDecl BridgedParamDecl_createParsed(
13841423 swift::SourceLoc paramNameLoc, BridgedNullableExpr defaultValue,
13851424 BridgedNullableDefaultArgumentInitializer cDefaultArgumentInitContext);
13861425
1426+ SWIFT_NAME (" BridgedParamDecl.cloneWithoutType(self:)" )
1427+ BRIDGED_INLINE BridgedParamDecl
1428+ BridgedParamDecl_cloneWithoutType(BridgedParamDecl cDecl);
1429+
13871430SWIFT_NAME (" BridgedParamDecl.setTypeRepr(self:_:)" )
13881431BRIDGED_INLINE void BridgedParamDecl_setTypeRepr(BridgedParamDecl cDecl,
13891432 BridgedTypeRepr cType);
13901433
1434+ SWIFT_NAME (" BridgedParamDecl.setInterfaceType(self:_:)" )
1435+ BRIDGED_INLINE void BridgedParamDecl_setInterfaceType(BridgedParamDecl cDecl,
1436+ BridgedASTType cType);
1437+
13911438// / The various spellings of ownership modifier that can be used in source.
13921439enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedParamSpecifier {
13931440 BridgedParamSpecifierDefault,
@@ -1406,8 +1453,13 @@ BRIDGED_INLINE void
14061453BridgedParamDecl_setSpecifier(BridgedParamDecl cDecl,
14071454 BridgedParamSpecifier cSpecifier);
14081455
1409- SWIFT_NAME (" BridgedParamDecl.setImplicit(self:)" )
1410- BRIDGED_INLINE void BridgedParamDecl_setImplicit(BridgedParamDecl cDecl);
1456+ SWIFT_NAME (" BridgedDecl.setImplicit(self:)" )
1457+ BRIDGED_INLINE void BridgedDecl_setImplicit(BridgedDecl cDecl);
1458+
1459+ SWIFT_NAME (" BridgedGenericContext.setGenericSignature(self:_:)" )
1460+ BRIDGED_INLINE void
1461+ BridgedGenericContext_setGenericSignature(BridgedGenericContext cDecl,
1462+ BridgedGenericSignature cGenSig);
14111463
14121464SWIFT_NAME (" BridgedConstructorDecl.setParsedBody(self:_:)" )
14131465void BridgedConstructorDecl_setParsedBody(BridgedConstructorDecl decl,
@@ -1471,14 +1523,20 @@ void BridgedExtensionDecl_setParsedMembers(BridgedExtensionDecl decl,
14711523SWIFT_NAME (
14721524 " BridgedEnumDecl.createParsed(_:declContext:enumKeywordLoc:name:nameLoc:"
14731525 " genericParamList:inheritedTypes:genericWhereClause:braceRange:)" )
1474- BridgedNominalTypeDecl BridgedEnumDecl_createParsed(
1526+ BridgedEnumDecl BridgedEnumDecl_createParsed(
14751527 BridgedASTContext cContext, BridgedDeclContext cDeclContext,
14761528 swift::SourceLoc enumKeywordLoc, swift::Identifier name,
14771529 swift::SourceLoc nameLoc, BridgedNullableGenericParamList genericParamList,
14781530 BridgedArrayRef cInheritedTypes,
14791531 BridgedNullableTrailingWhereClause genericWhereClause,
14801532 swift::SourceRange braceRange);
14811533
1534+ SWIFT_NAME (" BridgedEnumDecl.create(_:declContext:name:genericParamList:)" )
1535+ BridgedEnumDecl
1536+ BridgedEnumDecl_create(BridgedASTContext cContext,
1537+ BridgedDeclContext cDeclContext, BridgedStringRef name,
1538+ BridgedNullableGenericParamList genericParamList);
1539+
14821540SWIFT_NAME (
14831541 " BridgedEnumCaseDecl.createParsed(declContext:caseKeywordLoc:elements:)" )
14841542BridgedEnumCaseDecl
@@ -1494,6 +1552,12 @@ BridgedEnumElementDecl BridgedEnumElementDecl_createParsed(
14941552 BridgedNullableParameterList parameterList, swift::SourceLoc equalsLoc,
14951553 BridgedNullableExpr opaqueRawValue);
14961554
1555+ SWIFT_NAME (" BridgedEnumElementDecl.create(_:declContext:name:"
1556+ " parameterList:)" )
1557+ BridgedEnumElementDecl BridgedEnumElementDecl_create(
1558+ BridgedASTContext cContext, BridgedDeclContext cDeclContext,
1559+ BridgedStringRef name, BridgedParameterList parameterList);
1560+
14971561SWIFT_NAME (" BridgedStructDecl.createParsed(_:declContext:structKeywordLoc:name:"
14981562 " nameLoc:genericParamList:inheritedTypes:genericWhereClause:"
14991563 " braceRange:)" )
@@ -1662,6 +1726,9 @@ void BridgedTopLevelCodeDecl_dump(BridgedTopLevelCodeDecl decl);
16621726SWIFT_NAME (" BridgedDecl.dump(self:)" )
16631727void BridgedDecl_dump(BridgedDecl decl);
16641728
1729+ SWIFT_NAME (" BridgedValueDecl.setAccess(self:_:)" )
1730+ void BridgedValueDecl_setAccess(BridgedValueDecl decl, swift::AccessLevel accessLevel);
1731+
16651732// ===----------------------------------------------------------------------===//
16661733// MARK: AbstractStorageDecl
16671734// ===----------------------------------------------------------------------===//
@@ -1711,6 +1778,11 @@ SWIFT_NAME("BridgedNominalTypeDecl.getSourceLocation(self:)")
17111778BRIDGED_INLINE swift::SourceLoc
17121779BridgedNominalTypeDecl_getSourceLocation(BridgedNominalTypeDecl decl);
17131780
1781+ SWIFT_NAME (" BridgedNominalTypeDecl.addMember(self:_:)" )
1782+ BRIDGED_INLINE void
1783+ BridgedNominalTypeDecl_addMember(BridgedNominalTypeDecl cDecl,
1784+ BridgedDecl member);
1785+
17141786// ===----------------------------------------------------------------------===//
17151787// MARK: SubscriptDecl
17161788// ===----------------------------------------------------------------------===//
@@ -2913,6 +2985,10 @@ BridgedParameterList BridgedParameterList_createParsed(
29132985 BridgedASTContext cContext, swift::SourceLoc leftParenLoc,
29142986 BridgedArrayRef cParameters, swift::SourceLoc rightParenLoc);
29152987
2988+ SWIFT_NAME (" BridgedParameterList.create(_:parameters:)" )
2989+ BridgedParameterList BridgedParameterList_create(BridgedASTContext cContext,
2990+ BridgedArrayRef cParameters);
2991+
29162992SWIFT_NAME (" getter:BridgedParameterList.size(self:)" )
29172993size_t BridgedParameterList_size(BridgedParameterList cParameterList);
29182994
@@ -3017,6 +3093,7 @@ struct BridgedASTType {
30173093 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGenericSignature getInvocationGenericSignatureOfFunctionType () const ;
30183094 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType subst (BridgedSubstitutionMap substMap) const ;
30193095 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformance checkConformance (BridgedDeclObj proto) const ;
3096+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeOutOfContext () const ;
30203097};
30213098
30223099class BridgedCanType {
@@ -3084,13 +3161,23 @@ struct BridgedSubstitutionMap {
30843161 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTTypeArray getReplacementTypes () const ;
30853162};
30863163
3164+ struct BridgedCanGenericSignature ;
3165+
30873166struct BridgedGenericSignature {
30883167 const swift::GenericSignatureImpl * _Nullable impl;
30893168
30903169 BRIDGED_INLINE swift::GenericSignature unbridged () const ;
30913170 BridgedOwnedString getDebugDescription () const ;
30923171 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTTypeArray getGenericParams () const ;
30933172 SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeIntoContext (BridgedASTType type) const ;
3173+ BRIDGED_INLINE BridgedCanGenericSignature getCanonicalSignature () const ;
3174+ };
3175+
3176+ struct BridgedCanGenericSignature {
3177+ const swift::GenericSignatureImpl *_Nullable impl;
3178+
3179+ BRIDGED_INLINE swift::CanGenericSignature unbridged () const ;
3180+ BRIDGED_INLINE BridgedGenericSignature getGenericSignature () const ;
30943181};
30953182
30963183struct BridgedFingerprint {
0 commit comments