diff options
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 29e0c64..25c59d0 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -169,14 +169,8 @@ static Type *getMemoryParamAllocType(AttributeSet ParamAttrs, Type *ArgTy) { return PreAllocTy; if (Type *InAllocaTy = ParamAttrs.getInAllocaType()) return InAllocaTy; - - // FIXME: sret and inalloca always depends on pointee element type. It's also - // possible for byval to miss it. - if (ParamAttrs.hasAttribute(Attribute::InAlloca) || - ParamAttrs.hasAttribute(Attribute::ByVal) || - ParamAttrs.hasAttribute(Attribute::StructRet) || - ParamAttrs.hasAttribute(Attribute::Preallocated)) - return cast<PointerType>(ArgTy)->getElementType(); + if (Type *SRetTy = ParamAttrs.getStructRetType()) + return SRetTy; return nullptr; } |