Author: baldrick Date: Sun Jan 13 15:19:12 2008 New Revision: 45938 URL: http://llvm.org/viewvc/llvm-project?rev=45938&view=rev Log: Allow the byval attribute for pointers to any type with a size, not just structs.
Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ParameterAttributes.cpp?rev=45938&r1=45937&r2=45938&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ParameterAttributes.cpp (original) +++ llvm/trunk/lib/VMCore/ParameterAttributes.cpp Sun Jan 13 15:19:12 2008 @@ -194,8 +194,8 @@ 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. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits