From 86c17f2ebf0c919cd45035ab80125cd68088d8e8 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Sun, 13 Jan 2008 21:19:12 +0000 Subject: [PATCH] Allow the byval attribute for pointers to any type with a size, not just structs. llvm-svn: 45938 --- lib/VMCore/ParameterAttributes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/VMCore/ParameterAttributes.cpp b/lib/VMCore/ParameterAttributes.cpp index 77a2a6e7fe3..b48e0cecde3 100644 --- a/lib/VMCore/ParameterAttributes.cpp +++ b/lib/VMCore/ParameterAttributes.cpp @@ -194,8 +194,8 @@ uint16_t ParamAttr::typeIncompatible (const Type *Ty) { Incompatible |= SExt | ZExt; if (const PointerType *PTy = dyn_cast(Ty)) { - if (!isa(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.