From 3ae303cc8c8d58d7e4d97515c23e1aead6ede13a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 21 Nov 2003 22:32:23 +0000 Subject: Check return types of functions llvm-svn: 10146 --- llvm/lib/VMCore/Verifier.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/VMCore/Verifier.cpp') diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 1d441d1dd5e..98288f41427 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/lib/VMCore/Verifier.cpp @@ -241,6 +241,9 @@ void Verifier::visitFunction(Function &F) { Assert2(FT->getNumParams() == NumArgs, "# formal arguments must match # of arguments for function type!", &F, FT); + Assert1(F.getReturnType()->isFirstClassType() || + F.getReturnType() == Type::VoidTy, + "Functions cannot return aggregate values!", &F); // Check that the argument values match the function type for this function... unsigned i = 0; -- cgit v1.2.3