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 | c8e222b9a48a84e98a5fc4ccd6b015197b09bed4 (patch) | |
tree | 1270dd9e0c83a4e8f21d240c1a4b53acb0639fd8 /lib/VMCore/Function.cpp | |
parent | 081b505f77b183b7b029818218245cf4986e8948 (diff) |
tighten up return type check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Function.cpp')
-rw-r--r-- | lib/VMCore/Function.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index f83fe435cd..8210350d71 100644 --- a/lib/VMCore/Function.cpp +++ b/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. |