mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user