mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-05 11:17:53 +00:00
Implement reading of arbitrary precision integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34718 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1264,8 +1264,14 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
|
|||||||
error("Invalid constant integer read.");
|
error("Invalid constant integer read.");
|
||||||
Result = ConstantInt::get(IT, Val);
|
Result = ConstantInt::get(IT, Val);
|
||||||
if (Handler) Handler->handleConstantValue(Result);
|
if (Handler) Handler->handleConstantValue(Result);
|
||||||
} else
|
} else {
|
||||||
assert(0 && "Integer types > 64 bits not supported");
|
uint32_t numWords = read_vbr_uint();
|
||||||
|
uint64_t *data = new uint64_t[numWords];
|
||||||
|
for (uint32_t i = 0; i < numWords; ++i)
|
||||||
|
data[i] = read_vbr_uint64();
|
||||||
|
Result = ConstantInt::get(IT, APInt(IT->getBitWidth(), numWords, data));
|
||||||
|
if (Handler) Handler->handleConstantValue(Result);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Type::FloatTyID: {
|
case Type::FloatTyID: {
|
||||||
@@ -1356,8 +1362,7 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
|
|||||||
// to a null value in a way that isn't predicted when a .bc file is initially
|
// to a null value in a way that isn't predicted when a .bc file is initially
|
||||||
// produced.
|
// produced.
|
||||||
assert((!isa<Constant>(Result) || !cast<Constant>(Result)->isNullValue()) ||
|
assert((!isa<Constant>(Result) || !cast<Constant>(Result)->isNullValue()) ||
|
||||||
!hasImplicitNull(TypeID) &&
|
!hasImplicitNull(TypeID) && "Cannot read null values from bytecode!");
|
||||||
"Cannot read null values from bytecode!");
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user