Make error msg reflect what exactly went wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18478 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos
2004-12-04 01:25:06 +00:00
parent ead1b3f0bb
commit 8b42b43dc2

View File

@@ -379,9 +379,9 @@ void Verifier::visitTerminatorInst(TerminatorInst &I) {
void Verifier::visitReturnInst(ReturnInst &RI) {
Function *F = RI.getParent()->getParent();
if (RI.getNumOperands() == 0)
Assert1(F->getReturnType() == Type::VoidTy,
"Function returns no value, but ret instruction found that does!",
&RI);
Assert2(F->getReturnType() == Type::VoidTy,
"Found return instr that returns void in Function of non-void "
"return type!", &RI, F->getReturnType());
else
Assert2(F->getReturnType() == RI.getOperand(0)->getType(),
"Function return type does not match operand "