mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Check struct return type first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b5fab67c1
commit
45e99e4f29
@ -581,18 +581,19 @@ void Verifier::visitReturnInst(ReturnInst &RI) {
|
||||
Assert2(F->getReturnType() == Type::VoidTy,
|
||||
"Found return instr that returns void in Function of non-void "
|
||||
"return type!", &RI, F->getReturnType());
|
||||
else if (N == 1)
|
||||
Assert2(F->getReturnType() == RI.getOperand(0)->getType(),
|
||||
"Function return type does not match operand "
|
||||
"type of return inst!", &RI, F->getReturnType());
|
||||
else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) {
|
||||
for (unsigned i = 0; i < N; i++)
|
||||
Assert2(STy->getElementType(i) == RI.getOperand(i)->getType(),
|
||||
"Function return type does not match operand "
|
||||
"type of return inst!", &RI, F->getReturnType());
|
||||
} else
|
||||
}
|
||||
else if (N == 1)
|
||||
Assert2(F->getReturnType() == RI.getOperand(0)->getType(),
|
||||
"Function return type does not match operand "
|
||||
"type of return inst!", &RI, F->getReturnType());
|
||||
else
|
||||
Assert1(0, "Invalid return type!", &RI);
|
||||
|
||||
|
||||
// Check to make sure that the return value has necessary properties for
|
||||
// terminators...
|
||||
visitTerminatorInst(RI);
|
||||
|
Loading…
Reference in New Issue
Block a user