[llvm-commits] [llvm] r45938 - /llvm/trunk/lib/VMCore/ParameterAttributes.cpp
Duncan Sands
baldrick at free.fr
Sun Jan 13 13:19:12 PST 2008
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.
More information about the llvm-commits
mailing list