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
This commit is contained in:
Chris Lattner
2001-09-30 22:46:54 +00:00
parent 4cfb153316
commit 1a1cb111fe
5 changed files with 81 additions and 36 deletions

View File

@@ -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 '"