summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-06-05 14:00:36 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-06-05 14:00:36 +0000
commit5eef32ba94532ad2bf3e80af1a7518c84dfb72d8 (patch)
tree8af97df3a115ae8b9bcf16beb340874e05ac2d8f /llvm/lib
parentf9c65246dd3512d381f9f052b8b7be9459eef063 (diff)
downloadbcm5719-llvm-5eef32ba94532ad2bf3e80af1a7518c84dfb72d8.tar.gz
bcm5719-llvm-5eef32ba94532ad2bf3e80af1a7518c84dfb72d8.zip
Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates. llvm-svn: 52002
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index bfa2e6573f2..8cbb703a736 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud