@@ -2340,15 +2340,39 @@ void BridgedStmt_dump(BridgedStmt statement);
23402340// MARK: TypeAttributes
23412341// ===----------------------------------------------------------------------===//
23422342
2343- #ifdef USED_IN_CPP_SOURCE
2344- namespace swift {
2345- class TypeAttributes {
2343+ class BridgedTypeOrCustomAttr {
2344+ public:
2345+ enum Kind : uint8_t {
2346+ TypeAttr,
2347+ CustomAttr,
2348+ } kind;
2349+
2350+ private:
2351+ intptr_t opaque;
2352+
2353+ void *_Nonnull getPointer () const {
2354+ return reinterpret_cast <void *>(opaque & ~0x7 );
2355+ }
2356+
2357+ BRIDGED_INLINE BridgedTypeOrCustomAttr (void *_Nonnull pointer, Kind kind);
2358+
23462359public:
2347- SmallVector<TypeOrCustomAttr> attrs;
2348- TypeAttributes () {}
2360+ SWIFT_NAME (" typeAttr(_:)" )
2361+ static BridgedTypeOrCustomAttr createTypeAttr (BridgedTypeAttribute typeAttr) {
2362+ return BridgedTypeOrCustomAttr (typeAttr.unbridged (), Kind::TypeAttr);
2363+ }
2364+ SWIFT_NAME (" customAttr(_:)" )
2365+ static BridgedTypeOrCustomAttr
2366+ createCust0kAttr (BridgedCustomAttr customAttr) {
2367+ return BridgedTypeOrCustomAttr (customAttr.unbridged (), Kind::CustomAttr);
2368+ }
2369+
2370+ Kind getKind () const { return static_cast <Kind>(opaque & 0x7 ); }
2371+
2372+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedTypeAttribute
2373+ castToTypeAttr () const ;
2374+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCustomAttr castToCustomAttr () const ;
23492375};
2350- } // namespace swift
2351- #endif
23522376
23532377// Bridged type attribute kinds, which mirror TypeAttrKind exactly.
23542378enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedTypeAttrKind {
@@ -2360,19 +2384,6 @@ enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedTypeAttrKind {
23602384SWIFT_NAME (" BridgedTypeAttrKind.init(from:)" )
23612385BridgedTypeAttrKind BridgedTypeAttrKind_fromString(BridgedStringRef cStr);
23622386
2363- SWIFT_NAME (" BridgedTypeAttributes.new()" )
2364- BridgedTypeAttributes BridgedTypeAttributes_create();
2365-
2366- SWIFT_NAME (" BridgedTypeAttributes.delete(self:)" )
2367- void BridgedTypeAttributes_delete(BridgedTypeAttributes cAttributes);
2368-
2369- SWIFT_NAME (" BridgedTypeAttributes.add(self:_:)" )
2370- void BridgedTypeAttributes_add(BridgedTypeAttributes cAttributes,
2371- BridgedTypeAttribute cAttribute);
2372-
2373- SWIFT_NAME (" getter:BridgedTypeAttributes.isEmpty(self:)" )
2374- bool BridgedTypeAttributes_isEmpty(BridgedTypeAttributes cAttributes);
2375-
23762387SWIFT_NAME (" BridgedTypeAttribute.createSimple(_:kind:atLoc:nameLoc:)" )
23772388BridgedTypeAttribute BridgedTypeAttribute_createSimple(
23782389 BridgedASTContext cContext, BridgedTypeAttrKind cKind,
@@ -2454,12 +2465,11 @@ BridgedArrayTypeRepr BridgedArrayTypeRepr_createParsed(
24542465 BridgedASTContext cContext, BridgedTypeRepr base,
24552466 BridgedSourceLoc cLSquareLoc, BridgedSourceLoc cRSquareLoc);
24562467
2457- SWIFT_NAME (
2458- " BridgedAttributedTypeRepr.createParsed(_:base:consumingAttributes:)" )
2468+ SWIFT_NAME (" BridgedAttributedTypeRepr.createParsed(_:base:attributes:)" )
24592469BridgedAttributedTypeRepr
24602470BridgedAttributedTypeRepr_createParsed(BridgedASTContext cContext,
24612471 BridgedTypeRepr base,
2462- BridgedTypeAttributes cAttributes);
2472+ BridgedArrayRef cAttributes);
24632473
24642474SWIFT_NAME (" BridgedCompositionTypeRepr.createEmpty(_:anyKeywordLoc:)" )
24652475BridgedCompositionTypeRepr
0 commit comments