mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Add verification of union types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97889 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e765f2b5e3
commit
e20ab4a03c
@ -1525,6 +1525,15 @@ void Verifier::VerifyType(const Type *Ty) {
|
|||||||
VerifyType(ElTy);
|
VerifyType(ElTy);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case Type::UnionTyID: {
|
||||||
|
const UnionType *UTy = cast<UnionType>(Ty);
|
||||||
|
for (unsigned i = 0, e = UTy->getNumElements(); i != e; ++i) {
|
||||||
|
const Type *ElTy = UTy->getElementType(i);
|
||||||
|
Assert2(UnionType::isValidElementType(ElTy),
|
||||||
|
"Union type with invalid element type", ElTy, UTy);
|
||||||
|
VerifyType(ElTy);
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case Type::ArrayTyID: {
|
case Type::ArrayTyID: {
|
||||||
const ArrayType *ATy = cast<ArrayType>(Ty);
|
const ArrayType *ATy = cast<ArrayType>(Ty);
|
||||||
Assert1(ArrayType::isValidElementType(ATy->getElementType()),
|
Assert1(ArrayType::isValidElementType(ATy->getElementType()),
|
||||||
|
Loading…
Reference in New Issue
Block a user