Allow the byval attribute for pointers to any type with

a size, not just structs.

llvm-svn: 45938
This commit is contained in:
Duncan Sands 2008-01-13 21:19:12 +00:00
parent 32eae5daa5
commit 86c17f2ebf

View File

@ -194,8 +194,8 @@ uint16_t ParamAttr::typeIncompatible (const Type *Ty) {
Incompatible |= SExt | ZExt;
if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
if (!isa<StructType>(PTy->getElementType()))
// Attributes that only apply to pointers to structs.
if (!PTy->getElementType()->isSized())
// The byval attribute only applies to pointers to types with a size.
Incompatible |= ParamAttr::ByVal;
} else {
// Attributes that only apply to pointers.