summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-28 02:25:48 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-28 02:25:48 +0000
commitb5cf20c9397b177605e692f204f6562f210c6733 (patch)
tree3f2c0b3dfa33f95858d6e3e087d180d291a35bb1 /llvm/lib/Bytecode/Reader
parent90c26a31acab7067ec71fae5aa2c4282977e2671 (diff)
downloadbcm5719-llvm-b5cf20c9397b177605e692f204f6562f210c6733.tar.gz
bcm5719-llvm-b5cf20c9397b177605e692f204f6562f210c6733.zip
Implement reading of arbitrary precision integers.
llvm-svn: 34718
Diffstat (limited to 'llvm/lib/Bytecode/Reader')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 200f0d7a2fe..0e02c6baba9 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -1264,8 +1264,14 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
error("Invalid constant integer read.");
Result = ConstantInt::get(IT, Val);
if (Handler) Handler->handleConstantValue(Result);
- } else
- assert(0 && "Integer types > 64 bits not supported");
+ } else {
+ 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;
}
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
// produced.
assert((!isa<Constant>(Result) || !cast<Constant>(Result)->isNullValue()) ||
- !hasImplicitNull(TypeID) &&
- "Cannot read null values from bytecode!");
+ !hasImplicitNull(TypeID) && "Cannot read null values from bytecode!");
return Result;
}
OpenPOWER on IntegriCloud