@@ -2351,15 +2351,39 @@ void BridgedStmt_dump(BridgedStmt statement);
2351
2351
// MARK: TypeAttributes
2352
2352
// ===----------------------------------------------------------------------===//
2353
2353
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
+
2357
2370
public:
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 ;
2360
2386
};
2361
- } // namespace swift
2362
- #endif
2363
2387
2364
2388
// Bridged type attribute kinds, which mirror TypeAttrKind exactly.
2365
2389
enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedTypeAttrKind {
@@ -2371,19 +2395,6 @@ enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedTypeAttrKind {
2371
2395
SWIFT_NAME (" BridgedTypeAttrKind.init(from:)" )
2372
2396
BridgedTypeAttrKind BridgedTypeAttrKind_fromString(BridgedStringRef cStr);
2373
2397
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
-
2387
2398
SWIFT_NAME (" BridgedTypeAttribute.createSimple(_:kind:atLoc:nameLoc:)" )
2388
2399
BridgedTypeAttribute BridgedTypeAttribute_createSimple(
2389
2400
BridgedASTContext cContext, BridgedTypeAttrKind cKind,
@@ -2465,12 +2476,11 @@ BridgedArrayTypeRepr BridgedArrayTypeRepr_createParsed(
2465
2476
BridgedASTContext cContext, BridgedTypeRepr base,
2466
2477
BridgedSourceLoc cLSquareLoc, BridgedSourceLoc cRSquareLoc);
2467
2478
2468
- SWIFT_NAME (
2469
- " BridgedAttributedTypeRepr.createParsed(_:base:consumingAttributes:)" )
2479
+ SWIFT_NAME (" BridgedAttributedTypeRepr.createParsed(_:base:attributes:)" )
2470
2480
BridgedAttributedTypeRepr
2471
2481
BridgedAttributedTypeRepr_createParsed(BridgedASTContext cContext,
2472
2482
BridgedTypeRepr base,
2473
- BridgedTypeAttributes cAttributes);
2483
+ BridgedArrayRef cAttributes);
2474
2484
2475
2485
SWIFT_NAME (" BridgedCompositionTypeRepr.createEmpty(_:anyKeywordLoc:)" )
2476
2486
BridgedCompositionTypeRepr
0 commit comments