@@ -2340,15 +2340,39 @@ void BridgedStmt_dump(BridgedStmt statement);
2340
2340
// MARK: TypeAttributes
2341
2341
// ===----------------------------------------------------------------------===//
2342
2342
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
+
2346
2359
public:
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 ;
2349
2375
};
2350
- } // namespace swift
2351
- #endif
2352
2376
2353
2377
// Bridged type attribute kinds, which mirror TypeAttrKind exactly.
2354
2378
enum ENUM_EXTENSIBILITY_ATTR (closed) BridgedTypeAttrKind {
@@ -2360,19 +2384,6 @@ enum ENUM_EXTENSIBILITY_ATTR(closed) BridgedTypeAttrKind {
2360
2384
SWIFT_NAME (" BridgedTypeAttrKind.init(from:)" )
2361
2385
BridgedTypeAttrKind BridgedTypeAttrKind_fromString(BridgedStringRef cStr);
2362
2386
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
-
2376
2387
SWIFT_NAME (" BridgedTypeAttribute.createSimple(_:kind:atLoc:nameLoc:)" )
2377
2388
BridgedTypeAttribute BridgedTypeAttribute_createSimple(
2378
2389
BridgedASTContext cContext, BridgedTypeAttrKind cKind,
@@ -2454,12 +2465,11 @@ BridgedArrayTypeRepr BridgedArrayTypeRepr_createParsed(
2454
2465
BridgedASTContext cContext, BridgedTypeRepr base,
2455
2466
BridgedSourceLoc cLSquareLoc, BridgedSourceLoc cRSquareLoc);
2456
2467
2457
- SWIFT_NAME (
2458
- " BridgedAttributedTypeRepr.createParsed(_:base:consumingAttributes:)" )
2468
+ SWIFT_NAME (" BridgedAttributedTypeRepr.createParsed(_:base:attributes:)" )
2459
2469
BridgedAttributedTypeRepr
2460
2470
BridgedAttributedTypeRepr_createParsed(BridgedASTContext cContext,
2461
2471
BridgedTypeRepr base,
2462
- BridgedTypeAttributes cAttributes);
2472
+ BridgedArrayRef cAttributes);
2463
2473
2464
2474
SWIFT_NAME (" BridgedCompositionTypeRepr.createEmpty(_:anyKeywordLoc:)" )
2465
2475
BridgedCompositionTypeRepr
0 commit comments