summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/ConstantReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-30 22:46:54 +0000
committerChris Lattner <sabre@nondot.org>2001-09-30 22:46:54 +0000
commitfbdec250b314be0b80121654385e66f6a7650381 (patch)
treea711ca58cea2ce223104f9b485ac9ad3255912a5 /llvm/lib/Bytecode/Reader/ConstantReader.cpp
parent436248f236b13fa4816e0cb22bbaf37198433f2a (diff)
downloadbcm5719-llvm-fbdec250b314be0b80121654385e66f6a7650381.tar.gz
bcm5719-llvm-fbdec250b314be0b80121654385e66f6a7650381.zip
Implement constant pointers, and null specifically in the parser, bytecode writer, and
bytecode reader. llvm-svn: 668
Diffstat (limited to 'llvm/lib/Bytecode/Reader/ConstantReader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/ConstantReader.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp
index baa367d52b8..ae206daa370 100644
--- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/llvm/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 '"
OpenPOWER on IntegriCloud