Skip to content

Commit 3494ee9

Browse files
authored
Reapply [APInt] Enable APInt ctor assertion by default (llvm#114539)
This enables the assertion introduced in llvm#106524, which checks that the value passed to the constructor is indeed a valid N-bit signed or unsigned integer. Places that previously violated the assertion were updated in advance, e.g. in llvm#80309. It is possible to opt-out of the check and restore the previous behavior by setting implicitTrunc=true. ----- The buildbot failures from the previous attempt should be fixed by a18dd29 and e2074c6.
1 parent b74e588 commit 3494ee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class [[nodiscard]] APInt {
109109
/// \param implicitTrunc allow implicit truncation of non-zero/sign bits of
110110
/// val beyond the range of numBits
111111
APInt(unsigned numBits, uint64_t val, bool isSigned = false,
112-
bool implicitTrunc = true)
112+
bool implicitTrunc = false)
113113
: BitWidth(numBits) {
114114
if (!implicitTrunc) {
115115
if (isSigned) {

0 commit comments

Comments
 (0)