diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-06-11 15:59:20 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-06-11 16:01:23 -0700 |
commit | 37a2c4517bbf93bca18f9c67d9c6cfb3a6a627ec (patch) | |
tree | e023be09ef720285bb95da0afc3a6bb8d5bb675d /llvm/lib/IR/Function.cpp | |
parent | 1c51bf3b78854fd1c8faff0533cf4307f7828ada (diff) | |
download | llvm-37a2c4517bbf93bca18f9c67d9c6cfb3a6a627ec.zip llvm-37a2c4517bbf93bca18f9c67d9c6cfb3a6a627ec.tar.gz llvm-37a2c4517bbf93bca18f9c67d9c6cfb3a6a627ec.tar.bz2 |
[NFC][OpaquePtr] Make getMemoryParamAllocType() compatible with opaque pointers
These ABI attributes now always require the type parameter.
sret was missing from the first set of checks but was covered by the
second set.
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; } |