diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-08-20 06:00:58 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-08-20 06:00:58 +0000 |
commit | 0220904e7ad2936d0bd4fd659c9ee7508f38dacc (patch) | |
tree | 6549bfc9d4de9d031c5395fc71fa86e4198ebd45 /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | 2b4b4a577ad5ce9a8fe862a43e2009455d99304a (diff) | |
download | bcm5719-llvm-0220904e7ad2936d0bd4fd659c9ee7508f38dacc.tar.gz bcm5719-llvm-0220904e7ad2936d0bd4fd659c9ee7508f38dacc.zip |
Packed types, brought to you by Brad Jones
llvm-svn: 15938
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index c3fad712f2b..6654fd1b023 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -243,6 +243,16 @@ void BytecodeWriter::outputType(const Type *T) { break; } + case Type::PackedTyID: { + const PackedType *PT = cast<PackedType>(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<StructType>(T); @@ -339,6 +349,17 @@ void BytecodeWriter::outputConstant(const Constant *CPV) { break; } + case Type::PackedTyID: { + const ConstantPacked *CP = cast<ConstantPacked>(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<ConstantStruct>(CPV); |