@@ -301,8 +301,10 @@ class alignas(1 << TypeAlignInBits) TypeBase {
301
301
// / regparm and the calling convention.
302
302
enum { NumExtInfoBits = 7 };
303
303
unsigned ExtInfo : NumExtInfoBits;
304
+
305
+ unsigned NumParams : 10 ;
304
306
};
305
- NUMBITS (AnyFunctionType, NumTypeBaseBits + 7 );
307
+ NUMBITS (AnyFunctionType, NumTypeBaseBits + 17 );
306
308
307
309
struct ArchetypeTypeBitfields {
308
310
unsigned : NumTypeBaseBits;
@@ -2397,7 +2399,6 @@ getSILFunctionLanguage(SILFunctionTypeRepresentation rep) {
2397
2399
class AnyFunctionType : public TypeBase {
2398
2400
const Type Input;
2399
2401
const Type Output;
2400
- const unsigned NumParams;
2401
2402
2402
2403
public:
2403
2404
using Representation = FunctionTypeRepresentation;
@@ -2609,9 +2610,10 @@ class AnyFunctionType : public TypeBase {
2609
2610
AnyFunctionType (TypeKind Kind, const ASTContext *CanTypeContext,
2610
2611
Type Input, Type Output, RecursiveTypeProperties properties,
2611
2612
unsigned NumParams, const ExtInfo &Info)
2612
- : TypeBase(Kind, CanTypeContext, properties), Input(Input), Output(Output),
2613
- NumParams (NumParams) {
2613
+ : TypeBase(Kind, CanTypeContext, properties), Input(Input), Output(Output) {
2614
2614
AnyFunctionTypeBits.ExtInfo = Info.Bits ;
2615
+ AnyFunctionTypeBits.NumParams = NumParams;
2616
+ assert (AnyFunctionTypeBits.NumParams == NumParams && " Params dropped!" );
2615
2617
// The use of both assert() and static_assert() is intentional.
2616
2618
assert (AnyFunctionTypeBits.ExtInfo == Info.Bits && " Bits were dropped!" );
2617
2619
static_assert (ExtInfo::NumMaskBits ==
@@ -2638,7 +2640,7 @@ class AnyFunctionType : public TypeBase {
2638
2640
Type getInput () const { return Input; }
2639
2641
Type getResult () const { return Output; }
2640
2642
ArrayRef<AnyFunctionType::Param> getParams () const ;
2641
- unsigned getNumParams () const { return NumParams; }
2643
+ unsigned getNumParams () const { return AnyFunctionTypeBits. NumParams ; }
2642
2644
2643
2645
GenericSignature *getOptGenericSignature () const ;
2644
2646
0 commit comments