diff options
author | Duncan Sands <baldrick@free.fr> | 2008-01-13 21:19:12 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-01-13 21:19:12 +0000 |
commit | 421d1c93cc7e15fc918bf0f545006dc0da20edc6 (patch) | |
tree | dd5acffffca0c091f8319b1d0ac2de354fc843c9 | |
parent | ee2b7a4530736d311fb3e2eae551e0acdb919354 (diff) |
Allow the byval attribute for pointers to any type with
a size, not just structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45938 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/ParameterAttributes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/ParameterAttributes.cpp b/lib/VMCore/ParameterAttributes.cpp index 77a2a6e7fe..b48e0cecde 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<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. |