diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-05 07:58:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-05 07:58:59 +0000 |
commit | 654695b7b5f16b651885fb223af0c91153a3ee6e (patch) | |
tree | 3e589578d15ee8abde498212d31966c5c8be5a16 /llvm | |
parent | 998fa0a2a2cdd94c567bb765f12bcf7e576e7542 (diff) | |
download | bcm5719-llvm-654695b7b5f16b651885fb223af0c91153a3ee6e.tar.gz bcm5719-llvm-654695b7b5f16b651885fb223af0c91153a3ee6e.zip |
tighten up return type check
llvm-svn: 61677
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/VMCore/Function.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index f83fe435cd0..8210350d715 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -161,12 +161,10 @@ Function::Function(const FunctionType *Ty, LinkageTypes Linkage, const std::string &name, Module *ParentModule) : GlobalValue(PointerType::getUnqual(Ty), Value::FunctionVal, 0, 0, Linkage, name) { + assert(FunctionType::isValidReturnType(getReturnType()) && + !isa<OpaqueType>(getReturnType()) && "invalid return type"); SymTab = new ValueSymbolTable(); - assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy - || isa<StructType>(getReturnType())) - && "LLVM functions cannot return aggregate values!"); - // If the function has arguments, mark them as lazily built. if (Ty->getNumParams()) SubclassData = 1; // Set the "has lazy arguments" bit. |