diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-04-04 07:44:02 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-04-04 07:44:02 +0000 |
commit | 3e2f74e6d6dbc07563ba8ee9ffd2a230514929fb (patch) | |
tree | b7bb4321e8005fe01d6b6fe1684e19a6ffafcbfb /lib/VMCore | |
parent | cc5d992bc167ded99b039ed8fdde190a586a1562 (diff) | |
download | external_llvm-3e2f74e6d6dbc07563ba8ee9ffd2a230514929fb.zip external_llvm-3e2f74e6d6dbc07563ba8ee9ffd2a230514929fb.tar.gz external_llvm-3e2f74e6d6dbc07563ba8ee9ffd2a230514929fb.tar.bz2 |
Remove some support for ReturnInsts with multiple operands, and for
returning a scalar value in a function whose return type is a single-
element structure or array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128810 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 58ec6fe..1143151 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -826,30 +826,10 @@ void Verifier::visitReturnInst(ReturnInst &RI) { Assert2(N == 0, "Found return instr that returns non-void in Function of void " "return type!", &RI, F->getReturnType()); - else if (N == 1 && F->getReturnType() == RI.getOperand(0)->getType()) { - // Exactly one return value and it matches the return type. Good. - } else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) { - // The return type is a struct; check for multiple return values. - Assert2(STy->getNumElements() == N, - "Incorrect number of return values in ret instruction!", - &RI, 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 if (const ArrayType *ATy = dyn_cast<ArrayType>(F->getReturnType())) { - // The return type is an array; check for multiple return values. - Assert2(ATy->getNumElements() == N, - "Incorrect number of return values in ret instruction!", - &RI, F->getReturnType()); - for (unsigned i = 0; i != N; ++i) - Assert2(ATy->getElementType() == RI.getOperand(i)->getType(), - "Function return type does not match operand " - "type of return inst!", &RI, F->getReturnType()); - } else { - CheckFailed("Function return type does not match operand " - "type of return inst!", &RI, F->getReturnType()); - } + else + Assert2(N == 1 && F->getReturnType() == RI.getOperand(0)->getType(), + "Function return type does not match operand " + "type of return inst!", &RI, F->getReturnType()); // Check to make sure that the return value has necessary properties for // terminators... |