@@ -1142,10 +1142,11 @@ IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc,
11421142 return ::new (buf) IntegerLiteralInst (Loc, Ty, Value);
11431143}
11441144
1145- static APInt getAPInt (AnyBuiltinIntegerType *anyIntTy, intmax_t value) {
1145+ static APInt getAPInt (AnyBuiltinIntegerType *anyIntTy, intmax_t value,
1146+ bool treatAsSigned) {
11461147 // If we're forming a fixed-width type, build using the greatest width.
11471148 if (auto intTy = dyn_cast<BuiltinIntegerType>(anyIntTy))
1148- return APInt (intTy->getGreatestWidth (), value);
1149+ return APInt (intTy->getGreatestWidth (), value, treatAsSigned );
11491150
11501151 // Otherwise, build using the size of the type and then truncate to the
11511152 // minimum width necessary.
@@ -1154,11 +1155,12 @@ static APInt getAPInt(AnyBuiltinIntegerType *anyIntTy, intmax_t value) {
11541155 return result;
11551156}
11561157
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,
11591161 SILModule &M) {
11601162 auto intTy = Ty.castTo <AnyBuiltinIntegerType>();
1161- return create (Loc, Ty, getAPInt (intTy, Value), M);
1163+ return create (Loc, Ty, getAPInt (intTy, Value, treatAsSigned ), M);
11621164}
11631165
11641166static SILType getGreatestIntegerType (Type type, SILModule &M) {
0 commit comments