mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Add Verifier logic for indirectbr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a8afb2a623
commit
3768091407
@ -331,6 +331,7 @@ namespace {
|
||||
void visitBranchInst(BranchInst &BI);
|
||||
void visitReturnInst(ReturnInst &RI);
|
||||
void visitSwitchInst(SwitchInst &SI);
|
||||
void visitIndirectBrInst(IndirectBrInst &BI);
|
||||
void visitSelectInst(SelectInst &SI);
|
||||
void visitUserOp1(Instruction &I);
|
||||
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
|
||||
@ -864,6 +865,16 @@ void Verifier::visitSwitchInst(SwitchInst &SI) {
|
||||
visitTerminatorInst(SI);
|
||||
}
|
||||
|
||||
void Verifier::visitIndirectBrInst(IndirectBrInst &BI) {
|
||||
Assert1(BI.getAddress()->getType()->isPointerTy(),
|
||||
"Indirectbr operand must have pointer type!", &BI);
|
||||
for (unsigned i = 0, e = BI.getNumDestinations(); i != e; ++i)
|
||||
Assert1(BI.getDestination(i)->getType()->isLabelTy(),
|
||||
"Indirectbr destinations must all have pointer type!", &BI);
|
||||
|
||||
visitTerminatorInst(BI);
|
||||
}
|
||||
|
||||
void Verifier::visitSelectInst(SelectInst &SI) {
|
||||
Assert1(!SelectInst::areInvalidOperands(SI.getOperand(0), SI.getOperand(1),
|
||||
SI.getOperand(2)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user