@@ -1142,10 +1142,11 @@ IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc,
1142
1142
return ::new (buf) IntegerLiteralInst (Loc, Ty, Value);
1143
1143
}
1144
1144
1145
- static APInt getAPInt (AnyBuiltinIntegerType *anyIntTy, intmax_t value) {
1145
+ static APInt getAPInt (AnyBuiltinIntegerType *anyIntTy, intmax_t value,
1146
+ bool treatAsSigned) {
1146
1147
// If we're forming a fixed-width type, build using the greatest width.
1147
1148
if (auto intTy = dyn_cast<BuiltinIntegerType>(anyIntTy))
1148
- return APInt (intTy->getGreatestWidth (), value);
1149
+ return APInt (intTy->getGreatestWidth (), value, treatAsSigned );
1149
1150
1150
1151
// Otherwise, build using the size of the type and then truncate to the
1151
1152
// minimum width necessary.
@@ -1154,11 +1155,12 @@ static APInt getAPInt(AnyBuiltinIntegerType *anyIntTy, intmax_t value) {
1154
1155
return result;
1155
1156
}
1156
1157
1157
- IntegerLiteralInst *IntegerLiteralInst::create (SILDebugLocation Loc,
1158
- SILType Ty, intmax_t Value,
1158
+ IntegerLiteralInst *IntegerLiteralInst::create (SILDebugLocation Loc, SILType Ty,
1159
+ intmax_t Value,
1160
+ bool treatAsSigned,
1159
1161
SILModule &M) {
1160
1162
auto intTy = Ty.castTo <AnyBuiltinIntegerType>();
1161
- return create (Loc, Ty, getAPInt (intTy, Value), M);
1163
+ return create (Loc, Ty, getAPInt (intTy, Value, treatAsSigned ), M);
1162
1164
}
1163
1165
1164
1166
static SILType getGreatestIntegerType (Type type, SILModule &M) {
0 commit comments