diff options
| author | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-05 14:00:36 +0000 |
|---|---|---|
| committer | Matthijs Kooijman <matthijs@stdin.nl> | 2008-06-05 14:00:36 +0000 |
| commit | 310e960e71c9f64b9e5610611cf703722dfe9216 (patch) | |
| tree | b3dc24c3bdad6d56fcf2a30ec71da8f6b85bc77e /lib/VMCore | |
| parent | 11aa6a415e3d02bddf5bb8fb65b7d0bf3608b6cf (diff) | |
| download | external_llvm-310e960e71c9f64b9e5610611cf703722dfe9216.zip external_llvm-310e960e71c9f64b9e5610611cf703722dfe9216.tar.gz external_llvm-310e960e71c9f64b9e5610611cf703722dfe9216.tar.bz2 | |
Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
| -rw-r--r-- | lib/VMCore/Verifier.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index bfa2e65..8cbb703 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -594,7 +594,10 @@ void Verifier::visitReturnInst(ReturnInst &RI) { Assert2(N == 0, "Found return instr that returns void in Function of non-void " "return type!", &RI, F->getReturnType()); - else if (const StructType *STy = dyn_cast<StructType>(F->getReturnType())) { + else if (N > 1) { + const StructType *STy = dyn_cast<StructType>(F->getReturnType()); + Assert2(STy, "Return instr with multiple values, but return type is not " + "a struct", &RI, F->getReturnType()); Assert2(STy->getNumElements() == N, "Incorrect number of return values in ret instruction!", &RI, F->getReturnType()); |
