mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-24 13:06:56 +00:00
Check that sret is only used on pointers to types
with a size, like byval. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46207 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
53d4afcee9
commit
333e8be5e8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user