Make sure people don't make functiontypes with an invalid return type

llvm-svn: 14654
This commit is contained in:
Chris Lattner 2004-07-06 23:25:19 +00:00
parent 4556d889f4
commit 8f23abebfc
1 changed files with 2 additions and 0 deletions

View File

@ -402,6 +402,8 @@ FunctionType::FunctionType(const Type *Result,
const std::vector<const Type*> &Params,
bool IsVarArgs) : DerivedType(FunctionTyID),
isVarArgs(IsVarArgs) {
assert((Result->isFirstClassType() || Result == Type::VoidTy) &&
"LLVM functions cannot return aggregates");
bool isAbstract = Result->isAbstract();
ContainedTys.reserve(Params.size()+1);
ContainedTys.push_back(PATypeHandle(Result, this));