/// \param val the initial value of the APInt
/// \param isSigned how to treat signedness of val
APInt(unsigned numBits, uint64_t val, bool isSigned = false)
- : BitWidth(numBits), VAL(0) {
+ : BitWidth(numBits) {
assert(BitWidth && "bitwidth too small");
if (isSingleWord()) {
VAL = val;
/// Simply makes *this a copy of that.
/// @brief Copy Constructor.
- APInt(const APInt &that) : BitWidth(that.BitWidth), VAL(0) {
+ APInt(const APInt &that) : BitWidth(that.BitWidth) {
if (isSingleWord())
VAL = that.VAL;
else
void APInt::initSlowCase(uint64_t val, bool isSigned) {
+ VAL = 0;
pVal = getClearedMemory(getNumWords());
pVal[0] = val;
if (isSigned && int64_t(val) < 0)
}
void APInt::initSlowCase(const APInt& that) {
+ VAL = 0;
pVal = getMemory(getNumWords());
memcpy(pVal, that.pVal, getNumWords() * APINT_WORD_SIZE);
}
VAL = bigVal[0];
else {
// Get memory, cleared to 0
+ VAL = 0;
pVal = getClearedMemory(getNumWords());
// Calculate the number of words to copy
unsigned words = std::min<unsigned>(bigVal.size(), getNumWords());
}
APInt::APInt(unsigned numBits, ArrayRef<uint64_t> bigVal)
- : BitWidth(numBits), VAL(0) {
+ : BitWidth(numBits) {
initFromArray(bigVal);
}
APInt::APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[])
- : BitWidth(numBits), VAL(0) {
+ : BitWidth(numBits) {
initFromArray(makeArrayRef(bigVal, numWords));
}