PR7704: A function is not allowed to return a function; make sure to enforce

this consistently.

llvm-svn: 109360
This commit is contained in:
Eli Friedman 2010-07-24 22:58:04 +00:00
parent 7ae895e007
commit 6769a5186d

View File

@ -455,8 +455,8 @@ const PointerType *Type::getInt64PtrTy(LLVMContext &C, unsigned AS) {
/// isValidReturnType - Return true if the specified type is valid as a return
/// type.
bool FunctionType::isValidReturnType(const Type *RetTy) {
return RetTy->getTypeID() != LabelTyID &&
RetTy->getTypeID() != MetadataTyID;
return !RetTy->isFunctionTy() && !RetTy->isLabelTy() &&
!RetTy->isMetadataTy();
}
/// isValidArgumentType - Return true if the specified type is valid as an