1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Check that sret is only used on pointers to types

with a size, like byval.

llvm-svn: 46207
This commit is contained in:
Duncan Sands 2008-01-21 11:28:49 +00:00
parent 26de25066c
commit 50df31d59a

View File

@ -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;