diff options
author | Duncan Sands <baldrick@free.fr> | 2008-01-21 11:28:49 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-01-21 11:28:49 +0000 |
commit | 262e54eb7b397b09c3ce183a2256bf895e7dca76 (patch) | |
tree | 805d9a6678895e19be2283b6df4fd8c977bbc8d7 /llvm/lib/VMCore/ParameterAttributes.cpp | |
parent | a59f396cba15449568df52983f4463215166bcf7 (diff) | |
download | bcm5719-llvm-262e54eb7b397b09c3ce183a2256bf895e7dca76.tar.gz bcm5719-llvm-262e54eb7b397b09c3ce183a2256bf895e7dca76.zip |
Check that sret is only used on pointers to types
with a size, like byval.
llvm-svn: 46207
Diffstat (limited to 'llvm/lib/VMCore/ParameterAttributes.cpp')
-rw-r--r-- | llvm/lib/VMCore/ParameterAttributes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/ParameterAttributes.cpp b/llvm/lib/VMCore/ParameterAttributes.cpp index 4b63cfb2da7..0cafd307b2f 100644 --- a/llvm/lib/VMCore/ParameterAttributes.cpp +++ b/llvm/lib/VMCore/ParameterAttributes.cpp @@ -202,8 +202,8 @@ uint16_t ParamAttr::typeIncompatible (const Type *Ty) { if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) { if (!PTy->getElementType()->isSized()) - // The byval attribute only applies to pointers to types with a size. - Incompatible |= ParamAttr::ByVal; + // The byval and sret attributes only apply to pointers to sized types. + Incompatible |= ByVal | StructRet; } else { // Attributes that only apply to pointers. Incompatible |= ByVal | Nest | NoAlias | StructRet; |