mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
Add support for a union type in LLVM IR. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -585,6 +585,13 @@ bool BitcodeReader::ParseTypeTable() {
|
||||
ResultTy = StructType::get(Context, EltTys, Record[0]);
|
||||
break;
|
||||
}
|
||||
case bitc::TYPE_CODE_UNION: { // UNION: [eltty x N]
|
||||
SmallVector<const Type*, 8> EltTys;
|
||||
for (unsigned i = 0, e = Record.size(); i != e; ++i)
|
||||
EltTys.push_back(getTypeByID(Record[i], true));
|
||||
ResultTy = UnionType::get(&EltTys[0], EltTys.size());
|
||||
break;
|
||||
}
|
||||
case bitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty]
|
||||
if (Record.size() < 2)
|
||||
return Error("Invalid ARRAY type record");
|
||||
|
Reference in New Issue
Block a user