@@ -2351,15 +2351,39 @@ void BridgedStmt_dump(BridgedStmt statement);
23512351// MARK: TypeAttributes
23522352// ===----------------------------------------------------------------------===//
23532353
2354- #ifdef USED_IN_CPP_SOURCE
2355- namespace swift {
2356- class TypeAttributes {
2354+ class BridgedTypeOrCustomAttr {
2355+ public:
2356+ enum Kind : uint8_t {
2357+ TypeAttr,
2358+ CustomAttr,
2359+ } kind;
2360+
2361+ private:
2362+ intptr_t opaque;
2363+
2364+ void *_Nonnull getPointer () const {
2365+ return reinterpret_cast <void *>(opaque & ~0x7 );
2366+ }
2367+
2368+ BRIDGED_INLINE BridgedTypeOrCustomAttr (void *_Nonnull pointer, Kind kind);
2369+
23572370public:
2358- SmallVector<TypeOrCustomAttr> attrs;
2359- TypeAttributes () {}
2371+ SWIFT_NAME (" typeAttr(_:)" )
2372+ static BridgedTypeOrCustomAttr createTypeAttr (BridgedTypeAttribute typeAttr) {
2373+ return BridgedTypeOrCustomAttr (typeAttr.unbridged (), Kind::TypeAttr);
2374+ }
2375+ SWIFT_NAME (" customAttr(_:)" )
2376+ static BridgedTypeOrCustomAttr
2377+ createCust0kAttr (BridgedCustomAttr customAttr) {
2378+ return BridgedTypeOrCustomAttr (customAttr.unbridged (), Kind::CustomAttr);
2379+ }
2380+
2381+ Kind getKind () const { return static_cast <Kind>(opaque & 0x7 ); }
2382+
2383+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedTypeAttribute
2384+ castToTypeAttr () const ;
2385+ SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCustomAttr castToCustomAttr () const ;
23602386};
2361- } // namespace swift
2362- #endif
23632387
23642388// Bridged type attribute kinds, which mirror TypeAttrKind exactly.
23652389enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedTypeAttrKind {
@@ -2371,19 +2395,6 @@ enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedTypeAttrKind {
23712395SWIFT_NAME (" BridgedTypeAttrKind.init(from:)" )
23722396BridgedTypeAttrKind BridgedTypeAttrKind_fromString(BridgedStringRef cStr);
23732397
2374- SWIFT_NAME (" BridgedTypeAttributes.new()" )
2375- BridgedTypeAttributes BridgedTypeAttributes_create();
2376-
2377- SWIFT_NAME (" BridgedTypeAttributes.delete(self:)" )
2378- void BridgedTypeAttributes_delete(BridgedTypeAttributes cAttributes);
2379-
2380- SWIFT_NAME (" BridgedTypeAttributes.add(self:_:)" )
2381- void BridgedTypeAttributes_add(BridgedTypeAttributes cAttributes,
2382- BridgedTypeAttribute cAttribute);
2383-
2384- SWIFT_NAME (" getter:BridgedTypeAttributes.isEmpty(self:)" )
2385- bool BridgedTypeAttributes_isEmpty(BridgedTypeAttributes cAttributes);
2386-
23872398SWIFT_NAME (" BridgedTypeAttribute.createSimple(_:kind:atLoc:nameLoc:)" )
23882399BridgedTypeAttribute BridgedTypeAttribute_createSimple(
23892400 BridgedASTContext cContext, BridgedTypeAttrKind cKind,
@@ -2465,12 +2476,11 @@ BridgedArrayTypeRepr BridgedArrayTypeRepr_createParsed(
24652476 BridgedASTContext cContext, BridgedTypeRepr base,
24662477 BridgedSourceLoc cLSquareLoc, BridgedSourceLoc cRSquareLoc);
24672478
2468- SWIFT_NAME (
2469- " BridgedAttributedTypeRepr.createParsed(_:base:consumingAttributes:)" )
2479+ SWIFT_NAME (" BridgedAttributedTypeRepr.createParsed(_:base:attributes:)" )
24702480BridgedAttributedTypeRepr
24712481BridgedAttributedTypeRepr_createParsed(BridgedASTContext cContext,
24722482 BridgedTypeRepr base,
2473- BridgedTypeAttributes cAttributes);
2483+ BridgedArrayRef cAttributes);
24742484
24752485SWIFT_NAME (" BridgedCompositionTypeRepr.createEmpty(_:anyKeywordLoc:)" )
24762486BridgedCompositionTypeRepr
0 commit comments