aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-21 22:32:23 +0000
committerChris Lattner <sabre@nondot.org>2003-11-21 22:32:23 +0000
commitc282f5a380b0b1f46d270a608dc513a51792f552 (patch)
treeb057db3a3ab692fc0ff03f8dc302de08940b27e2 /lib/VMCore/Function.cpp
parent1f254d50eb7db4460ecc10e8ea3839cc4a4eb923 (diff)
Check return types of functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r--lib/VMCore/Function.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index 9a4ac6711c..b5586721e8 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -95,6 +95,9 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
ArgumentList.setParent(this);
SymTab = new SymbolTable();
+ assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy)
+ && "LLVM functions cannot return aggregate values!");
+
// Create the arguments vector, all arguments start out unnamed.
for (unsigned i = 0, e = Ty->getNumParams(); i != e; ++i) {
assert(Ty->getParamType(i) != Type::VoidTy &&