diff options
author | Chris Lattner <sabre@nondot.org> | 2001-09-30 22:46:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-09-30 22:46:54 +0000 |
commit | 1a1cb111fe9081cab4d666338c547253c4a437c9 (patch) | |
tree | 3f63e2d30ad41c283b1eab098b0afab00bd76d6e /lib/Bytecode/Reader/ConstantReader.cpp | |
parent | 4cfb15331652f9a2f7e5f755485a2f6eb87a20c6 (diff) |
Implement constant pointers, and null specifically in the parser, bytecode writer, and
bytecode reader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/ConstantReader.cpp')
-rw-r--r-- | lib/Bytecode/Reader/ConstantReader.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Bytecode/Reader/ConstantReader.cpp b/lib/Bytecode/Reader/ConstantReader.cpp index baa367d52b..ae206daa37 100644 --- a/lib/Bytecode/Reader/ConstantReader.cpp +++ b/lib/Bytecode/Reader/ConstantReader.cpp @@ -250,7 +250,7 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf, } case Type::StructTyID: { - const StructType *ST = (const StructType*)Ty; + const StructType *ST = Ty->castStructType(); const StructType::ElementTypes &ET = ST->getElementTypes(); vector<ConstPoolVal *> Elements; @@ -267,6 +267,17 @@ bool BytecodeParser::parseConstPoolValue(const uchar *&Buf, break; } + case Type::PointerTyID: { + const PointerType *PT = Ty->castPointerType(); + unsigned SubClass; + if (read_vbr(Buf, EndBuf, SubClass)) return failure(true); + if (SubClass != 0) return failure(true); + + + V = ConstPoolPointer::getNullPointer(PT); + break; + } + default: cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to deserialize constant value of type '" |