This patch incapsulates some commonly used hacks in a (hopefully) UB-free manner.
Some existing LibCall implementations contain constants like this one:
const di_int MIN = (di_int)1 << ((int)(sizeof(di_int) * CHAR_BIT) - 1);
UBSan complains on such expressions and that seems to be true positive.
This patch is expected to be NFC except for eliminating some UB. It consists of the following parts:
- implementing helpers in int_types.h
- replacing some typedefs with #defines so these type alises can be handled by the above machinery
- replacing some constants with these common helper invocations
- this is expected to be unable to cause any performance regressions as these are actually compile-time constants
- fixing a couple of UBs in __neg?i2 LibCalls
clang-tidy: error: unknown type name 'fixint_t' [clang-diagnostic-error]
not useful
clang-tidy: error: unknown type name 'fp_t' [clang-diagnostic-error]
not useful