From 715c90ba524e736190a6380695ab337eeb5148be Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Fri, 20 Aug 2004 06:00:58 +0000 Subject: Packed types, brought to you by Brad Jones git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bytecode/Writer/Writer.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/Bytecode/Writer') diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index c3fad712f2..6654fd1b02 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -243,6 +243,16 @@ void BytecodeWriter::outputType(const Type *T) { break; } + case Type::PackedTyID: { + const PackedType *PT = cast(T); + int Slot = Table.getSlot(PT->getElementType()); + assert(Slot != -1 && "Type used but not available!!"); + output_typeid((unsigned)Slot); + output_vbr(PT->getNumElements()); + break; + } + + case Type::StructTyID: { const StructType *ST = cast(T); @@ -339,6 +349,17 @@ void BytecodeWriter::outputConstant(const Constant *CPV) { break; } + case Type::PackedTyID: { + const ConstantPacked *CP = cast(CPV); + + for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) { + int Slot = Table.getSlot(CP->getOperand(i)); + assert(Slot != -1 && "Constant used but not available!!"); + output_vbr((unsigned)Slot); + } + break; + } + case Type::StructTyID: { const ConstantStruct *CPS = cast(CPV); -- cgit v1.2.3-70-g09d2