@@ -2955,7 +2955,7 @@ enum class ParameterConvention {
2955
2955
};
2956
2956
// Check that the enum values fit inside SILFunctionTypeBits.
2957
2957
static_assert (unsigned (ParameterConvention::Direct_Guaranteed) < (1 <<3 ),
2958
- "fits in SILFunctionTypeBits");
2958
+ "fits in SILFunctionTypeBits and SILParameterInfo ");
2959
2959
2960
2960
// Does this parameter convention require indirect storage? This reflects a
2961
2961
// SILFunctionType's formal (immutable) conventions, as opposed to the transient
@@ -3015,20 +3015,19 @@ inline bool isGuaranteedParameter(ParameterConvention conv) {
3015
3015
3016
3016
// / A parameter type and the rules for passing it.
3017
3017
class SILParameterInfo {
3018
- CanType Ty;
3019
- ParameterConvention Convention;
3018
+ llvm::PointerIntPair<CanType, 3 , ParameterConvention> TypeAndConvention;
3020
3019
public:
3021
- SILParameterInfo () : Ty(), Convention((ParameterConvention)0 ) {}
3020
+ SILParameterInfo () = default ; // : Ty(), Convention((ParameterConvention)0) {}
3022
3021
SILParameterInfo (CanType type, ParameterConvention conv)
3023
- : Ty (type), Convention( conv) {
3022
+ : TypeAndConvention (type, conv) {
3024
3023
assert (type->isLegalSILType () && " SILParameterInfo has illegal SIL type" );
3025
3024
}
3026
3025
3027
3026
CanType getType () const {
3028
- return Ty ;
3027
+ return TypeAndConvention. getPointer () ;
3029
3028
}
3030
3029
ParameterConvention getConvention () const {
3031
- return Convention ;
3030
+ return TypeAndConvention. getInt () ;
3032
3031
}
3033
3032
// Does this parameter convention require indirect storage? This reflects a
3034
3033
// SILFunctionType's formal (immutable) conventions, as opposed to the
@@ -3089,8 +3088,8 @@ class SILParameterInfo {
3089
3088
}
3090
3089
3091
3090
void profile (llvm::FoldingSetNodeID &id) {
3092
- id.AddPointer (Ty .getPointer ());
3093
- id.AddInteger ((unsigned )Convention );
3091
+ id.AddPointer (getType () .getPointer ());
3092
+ id.AddInteger ((unsigned )getConvention () );
3094
3093
}
3095
3094
3096
3095
void dump () const ;
@@ -3104,7 +3103,7 @@ class SILParameterInfo {
3104
3103
}
3105
3104
3106
3105
bool operator ==(SILParameterInfo rhs) const {
3107
- return Ty == rhs.Ty && Convention == rhs.Convention ;
3106
+ return getType () == rhs.getType () && getConvention () == rhs.getConvention () ;
3108
3107
}
3109
3108
bool operator !=(SILParameterInfo rhs) const {
3110
3109
return !(*this == rhs);
0 commit comments