@@ -2892,7 +2892,7 @@ class AnyFunctionType : public TypeBase {
2892
2892
protected:
2893
2893
AnyFunctionType (TypeKind Kind, const ASTContext *CanTypeContext,
2894
2894
Type Input, Type Output, RecursiveTypeProperties properties,
2895
- unsigned NumParams, const ExtInfo & Info)
2895
+ unsigned NumParams, ExtInfo Info)
2896
2896
: TypeBase(Kind, CanTypeContext, properties), Input(Input), Output(Output) {
2897
2897
Bits.AnyFunctionType .ExtInfo = Info.Bits ;
2898
2898
Bits.AnyFunctionType .NumParams = NumParams;
@@ -2906,7 +2906,7 @@ class AnyFunctionType : public TypeBase {
2906
2906
public:
2907
2907
// / \brief Break an input type into an array of \c AnyFunctionType::Params.
2908
2908
static void decomposeInput (Type type,
2909
- SmallVectorImpl<AnyFunctionType:: Param> &result);
2909
+ SmallVectorImpl<Param> &result);
2910
2910
2911
2911
// / \brief Take an array of parameters and turn it into an input type.
2912
2912
// /
@@ -2920,15 +2920,14 @@ class AnyFunctionType : public TypeBase {
2920
2920
}
2921
2921
2922
2922
// / \brief Given two arrays of parameters determine if they are equal.
2923
- static bool equalParams (ArrayRef<AnyFunctionType::Param> a,
2924
- ArrayRef<AnyFunctionType::Param> b);
2923
+ static bool equalParams (ArrayRef<Param> a, ArrayRef<Param> b);
2925
2924
2926
2925
// / \brief Given two arrays of parameters determine if they are equal.
2927
2926
static bool equalParams (CanParamArrayRef a, CanParamArrayRef b);
2928
2927
2929
2928
Type getInput () const { return Input; }
2930
2929
Type getResult () const { return Output; }
2931
- ArrayRef<AnyFunctionType:: Param> getParams () const ;
2930
+ ArrayRef<Param> getParams () const ;
2932
2931
unsigned getNumParams () const { return Bits.AnyFunctionType .NumParams ; }
2933
2932
2934
2933
GenericSignature *getOptGenericSignature () const ;
@@ -2980,14 +2979,13 @@ BEGIN_CAN_TYPE_WRAPPER(AnyFunctionType, Type)
2980
2979
using ExtInfo = AnyFunctionType::ExtInfo;
2981
2980
using CanParamArrayRef = AnyFunctionType::CanParamArrayRef;
2982
2981
2983
- static CanAnyFunctionType get (CanGenericSignature signature,
2984
- CanType input, CanType result);
2985
2982
static CanAnyFunctionType get (CanGenericSignature signature,
2986
2983
CanType input, CanType result,
2987
- const ExtInfo & extInfo);
2984
+ ExtInfo extInfo = ExtInfo() );
2988
2985
static CanAnyFunctionType get (CanGenericSignature signature,
2989
2986
CanParamArrayRef params,
2990
- CanType result, const ExtInfo &info);
2987
+ CanType result,
2988
+ ExtInfo info = ExtInfo());
2991
2989
2992
2990
CanGenericSignature getOptGenericSignature () const ;
2993
2991
@@ -3020,19 +3018,17 @@ class FunctionType final : public AnyFunctionType,
3020
3018
3021
3019
public:
3022
3020
// / 'Constructor' Factory Function
3023
- static FunctionType *get (Type Input, Type Result) {
3024
- return get (Input, Result, ExtInfo ());
3025
- }
3026
-
3027
- static FunctionType *get (Type Input, Type Result, const ExtInfo &Info);
3021
+ static FunctionType *get (Type Input, Type Result,
3022
+ ExtInfo Info = ExtInfo());
3028
3023
3029
- static FunctionType *get (ArrayRef<AnyFunctionType::Param> params,
3030
- Type result, const ExtInfo &info,
3024
+ static FunctionType *get (ArrayRef<Param> params,
3025
+ Type result,
3026
+ ExtInfo info = ExtInfo(),
3031
3027
bool canonicalVararg = false);
3032
3028
3033
3029
// Retrieve the input parameters of this function type.
3034
- ArrayRef<AnyFunctionType:: Param> getParams () const {
3035
- return {getTrailingObjects<AnyFunctionType:: Param>(), getNumParams ()};
3030
+ ArrayRef<Param> getParams () const {
3031
+ return {getTrailingObjects<Param>(), getNumParams ()};
3036
3032
}
3037
3033
3038
3034
// Implement isa/cast/dyncast/etc.
@@ -3041,23 +3037,19 @@ class FunctionType final : public AnyFunctionType,
3041
3037
}
3042
3038
3043
3039
private:
3044
- FunctionType (ArrayRef<AnyFunctionType:: Param> params,
3040
+ FunctionType (ArrayRef<Param> params,
3045
3041
Type Input, Type Result,
3046
3042
RecursiveTypeProperties properties,
3047
- const ExtInfo & Info);
3043
+ ExtInfo Info);
3048
3044
};
3049
3045
BEGIN_CAN_TYPE_WRAPPER (FunctionType, AnyFunctionType)
3050
- static CanFunctionType get(CanType input, CanType result) {
3051
- auto fnType = FunctionType::get (input, result);
3052
- return cast<FunctionType>(fnType->getCanonicalType ());
3053
- }
3054
3046
static CanFunctionType get(CanType input, CanType result,
3055
- const ExtInfo & info) {
3047
+ ExtInfo info = ExtInfo() ) {
3056
3048
auto fnType = FunctionType::get (input, result, info);
3057
3049
return cast<FunctionType>(fnType->getCanonicalType ());
3058
3050
}
3059
3051
static CanFunctionType get (CanParamArrayRef params, CanType result,
3060
- const ExtInfo & info) {
3052
+ ExtInfo info = ExtInfo() ) {
3061
3053
auto fnType = FunctionType::get (params.getOriginalArray (),
3062
3054
result, info, /* canonicalVararg=*/ true );
3063
3055
return cast<FunctionType>(fnType->getCanonicalType ());
@@ -3102,10 +3094,10 @@ class GenericFunctionType final : public AnyFunctionType,
3102
3094
3103
3095
// / Construct a new generic function type.
3104
3096
GenericFunctionType (GenericSignature *sig,
3105
- ArrayRef<AnyFunctionType:: Param> params,
3097
+ ArrayRef<Param> params,
3106
3098
Type input,
3107
3099
Type result,
3108
- const ExtInfo & info,
3100
+ ExtInfo info,
3109
3101
const ASTContext *ctx,
3110
3102
RecursiveTypeProperties properties);
3111
3103
@@ -3114,18 +3106,18 @@ class GenericFunctionType final : public AnyFunctionType,
3114
3106
static GenericFunctionType *get (GenericSignature *sig,
3115
3107
Type input,
3116
3108
Type result,
3117
- const ExtInfo & info);
3109
+ ExtInfo info = ExtInfo() );
3118
3110
3119
3111
// / Create a new generic function type.
3120
3112
static GenericFunctionType *get (GenericSignature *sig,
3121
3113
ArrayRef<Param> params,
3122
3114
Type result,
3123
- const ExtInfo & info,
3115
+ ExtInfo info = ExtInfo() ,
3124
3116
bool canonicalVararg = false);
3125
3117
3126
3118
// Retrieve the input parameters of this function type.
3127
- ArrayRef<AnyFunctionType:: Param> getParams () const {
3128
- return {getTrailingObjects<AnyFunctionType:: Param>(), getNumParams ()};
3119
+ ArrayRef<Param> getParams () const {
3120
+ return {getTrailingObjects<Param>(), getNumParams ()};
3129
3121
}
3130
3122
3131
3123
// / Retrieve the generic signature of this function type.
@@ -3151,7 +3143,7 @@ class GenericFunctionType final : public AnyFunctionType,
3151
3143
GenericSignature *sig,
3152
3144
Type input,
3153
3145
Type result,
3154
- const ExtInfo & info);
3146
+ ExtInfo info);
3155
3147
3156
3148
// Implement isa/cast/dyncast/etc.
3157
3149
static bool classof (const TypeBase *T) {
@@ -3162,7 +3154,7 @@ class GenericFunctionType final : public AnyFunctionType,
3162
3154
BEGIN_CAN_TYPE_WRAPPER (GenericFunctionType, AnyFunctionType)
3163
3155
static CanGenericFunctionType get(CanGenericSignature sig,
3164
3156
CanType input, CanType result,
3165
- const ExtInfo & info) {
3157
+ ExtInfo info = ExtInfo() ) {
3166
3158
// Knowing that the argument types are independently canonical is
3167
3159
// not sufficient to guarantee that the function type will be canonical.
3168
3160
auto fnType = GenericFunctionType::get (sig, input, result, info);
@@ -3171,8 +3163,9 @@ BEGIN_CAN_TYPE_WRAPPER(GenericFunctionType, AnyFunctionType)
3171
3163
3172
3164
// / Create a new generic function type.
3173
3165
static CanGenericFunctionType get (CanGenericSignature sig,
3174
- CanParamArrayRef params, CanType result,
3175
- const ExtInfo &info) {
3166
+ CanParamArrayRef params,
3167
+ CanType result,
3168
+ ExtInfo info = ExtInfo()) {
3176
3169
// Knowing that the argument types are independently canonical is
3177
3170
// not sufficient to guarantee that the function type will be canonical.
3178
3171
auto fnType = GenericFunctionType::get (sig, params.getOriginalArray (),
@@ -3197,13 +3190,7 @@ END_CAN_TYPE_WRAPPER(GenericFunctionType, AnyFunctionType)
3197
3190
3198
3191
inline CanAnyFunctionType
3199
3192
CanAnyFunctionType::get(CanGenericSignature signature,
3200
- CanType input, CanType result) {
3201
- return get (signature, input, result, ExtInfo ());
3202
- }
3203
-
3204
- inline CanAnyFunctionType
3205
- CanAnyFunctionType::get (CanGenericSignature signature,
3206
- CanType input, CanType result, const ExtInfo &extInfo) {
3193
+ CanType input, CanType result, ExtInfo extInfo) {
3207
3194
if (signature) {
3208
3195
return CanGenericFunctionType::get (signature, input, result, extInfo);
3209
3196
} else {
@@ -3213,7 +3200,7 @@ CanAnyFunctionType::get(CanGenericSignature signature,
3213
3200
3214
3201
inline CanAnyFunctionType
3215
3202
CanAnyFunctionType::get (CanGenericSignature signature, CanParamArrayRef params,
3216
- CanType result, const ExtInfo & extInfo) {
3203
+ CanType result, ExtInfo extInfo) {
3217
3204
if (signature) {
3218
3205
return CanGenericFunctionType::get (signature, params, result, extInfo);
3219
3206
} else {
0 commit comments