@@ -285,6 +285,15 @@ class alignas(1 << TypeAlignInBits) TypeBase {
285
285
};
286
286
NUMBITS (ErrorType, NumTypeBaseBits + 1 );
287
287
288
+ struct ParenTypeBitfields {
289
+ unsigned : NumTypeBaseBits;
290
+
291
+ // / Whether there is an original type.
292
+ enum { NumFlagBits = 5 };
293
+ unsigned Flags : NumFlagBits;
294
+ };
295
+ NUMBITS (ParenType, NumTypeBaseBits + ParenTypeBitfields::NumFlagBits);
296
+
288
297
struct AnyFunctionTypeBitfields {
289
298
unsigned : NumTypeBaseBits;
290
299
@@ -353,6 +362,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
353
362
union {
354
363
TypeBaseBitfields TypeBaseBits;
355
364
ErrorTypeBitfields ErrorTypeBits;
365
+ ParenTypeBitfields ParenTypeBits;
356
366
AnyFunctionTypeBitfields AnyFunctionTypeBits;
357
367
TypeVariableTypeBitfields TypeVariableTypeBits;
358
368
ArchetypeTypeBitfields ArchetypeTypeBits;
@@ -1415,6 +1425,9 @@ class ParameterTypeFlags {
1415
1425
1416
1426
public:
1417
1427
ParameterTypeFlags () = default ;
1428
+ static ParameterTypeFlags fromRaw (uint8_t raw) {
1429
+ return ParameterTypeFlags (OptionSet<ParameterFlags>(raw));
1430
+ }
1418
1431
1419
1432
ParameterTypeFlags (bool variadic, bool autoclosure, bool escaping, bool inOut, bool shared)
1420
1433
: value((variadic ? Variadic : 0 ) |
@@ -1465,7 +1478,6 @@ class ParameterTypeFlags {
1465
1478
// / ParenType - A paren type is a type that's been written in parentheses.
1466
1479
class ParenType : public TypeBase {
1467
1480
Type UnderlyingType;
1468
- ParameterTypeFlags parameterFlags;
1469
1481
1470
1482
friend class ASTContext ;
1471
1483
@@ -1482,7 +1494,9 @@ class ParenType : public TypeBase {
1482
1494
TypeBase *getSinglyDesugaredType ();
1483
1495
1484
1496
// / Get the parameter flags
1485
- ParameterTypeFlags getParameterFlags () const { return parameterFlags; }
1497
+ ParameterTypeFlags getParameterFlags () const {
1498
+ return ParameterTypeFlags::fromRaw (ParenTypeBits.Flags );
1499
+ }
1486
1500
1487
1501
// Implement isa/cast/dyncast/etc.
1488
1502
static bool classof (const TypeBase *T) {
0 commit comments