5 Commits

Author SHA1 Message Date
Timm Baeder
5b4071c755
[clang][bytecode] Explicitly truncate in IntegralAP::from() (#112683)
Add Integral::toAPInt(), which truncates to the given BitWidth, similar
to the toAPSInt() we already have.
2024-10-17 12:26:44 +02:00
Nikita Popov
255a99c29f
[APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (#80309)
This fixes all the places that hit the new assertion added in
https://github.com/llvm/llvm-project/pull/106524 in tests. That is,
cases where the value passed to the APInt constructor is not an N-bit
signed/unsigned integer, where N is the bit width and signedness is
determined by the isSigned flag.

The fixes either set the correct value for isSigned, set the
implicitTrunc flag, or perform more calculations inside APInt.

Note that the assertion is currently still disabled by default, so this
patch is mostly NFC.
2024-10-17 08:48:08 +02:00
Timm Bäder
68030f86ae [clang][bytecode][NFC] Fix printing signed IntegralAP values 2024-08-24 08:21:25 +02:00
Timm Baeder
c81d666560
[clang][bytecode] Fix IntegralAP::is{Positive,Negative} (#105924)
This depends on signed-ness.
2024-08-24 07:50:23 +02:00
Timm Baeder
a07aba5d44
[clang] Rename all AST/Interp stuff to AST/ByteCode (#104552)
"Interp" clashes with the clang interpreter and people often confuse
this.
2024-08-16 17:13:12 +02:00