Skip to content

Commit 73c70ee

Browse files
committed
[rebranch] SIL: Restore old behavior in llvm::APInt ctor call
See llvm/llvm-project#114539.
1 parent ff8fbf1 commit 73c70ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/SIL/IR/SILInstructions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,9 @@ IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc,
11451145
static APInt getAPInt(AnyBuiltinIntegerType *anyIntTy, intmax_t value) {
11461146
// If we're forming a fixed-width type, build using the greatest width.
11471147
if (auto intTy = dyn_cast<BuiltinIntegerType>(anyIntTy))
1148-
return APInt(intTy->getGreatestWidth(), value);
1148+
// TODO: Avoid implicit trunc?
1149+
return APInt(intTy->getGreatestWidth(), value, /*isSigned=*/false,
1150+
/*implicitTrunc=*/true);
11491151

11501152
// Otherwise, build using the size of the type and then truncate to the
11511153
// minimum width necessary.

0 commit comments

Comments
 (0)