diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-11-21 22:32:23 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-11-21 22:32:23 +0000 |
| commit | 3ae303cc8c8d58d7e4d97515c23e1aead6ede13a (patch) | |
| tree | 70c867e5b7febf17ccf10f2b0519a8b4007c9f0a /llvm/lib/VMCore/Verifier.cpp | |
| parent | bc2d3308fef3d4e67e7703148fae6ceb86d57fbf (diff) | |
| download | bcm5719-llvm-3ae303cc8c8d58d7e4d97515c23e1aead6ede13a.tar.gz bcm5719-llvm-3ae303cc8c8d58d7e4d97515c23e1aead6ede13a.zip | |
Check return types of functions
llvm-svn: 10146
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; |

