1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

Use findEnumAttribute helper for preallocated

This commit is contained in:
Matt Arsenault 2020-07-09 21:02:25 -04:00
parent e12de24e43
commit 67958cd15e

View File

@ -925,14 +925,13 @@ MaybeAlign AttributeSetNode::getStackAlignment() const {
Type *AttributeSetNode::getByValType() const {
if (auto A = findEnumAttribute(Attribute::ByVal))
return A->getValueAsType();
return 0;
return nullptr;
}
Type *AttributeSetNode::getPreallocatedType() const {
for (const auto &I : *this)
if (I.hasAttribute(Attribute::Preallocated))
return I.getValueAsType();
return 0;
if (auto A = findEnumAttribute(Attribute::Preallocated))
return A->getValueAsType();
return nullptr;
}
uint64_t AttributeSetNode::getDereferenceableBytes() const {