return hasAttribute(ReturnIndex, Kind);
}
+ /// Return true if the attribute exists for the return value.
+ bool hasRetAttr(StringRef Kind) const {
+ return hasAttribute(ReturnIndex, Kind);
+ }
+
/// Return true if attributes exist for the return value.
bool hasRetAttrs() const { return hasAttributes(ReturnIndex); }
return getAttributes().getParamAttr(ArgNo, Kind);
}
+ /// check if an attribute is in the list of attributes for the return value.
+ bool hasRetAttribute(Attribute::AttrKind Kind) const {
+ return getAttributes().hasRetAttr(Kind);
+ }
+
/// gets the attribute from the list of attributes.
Attribute getAttribute(unsigned i, Attribute::AttrKind Kind) const {
return AttributeSets.getAttribute(i, Kind);
/// Determine whether the return value has the given attribute. Supports
/// Attribute::AttrKind and StringRef as \p AttrKind types.
template <typename AttrKind> bool hasRetAttrImpl(AttrKind Kind) const {
- if (Attrs.hasAttribute(AttributeList::ReturnIndex, Kind))
+ if (Attrs.hasRetAttr(Kind))
return true;
// Look at the callee, if available.
if (const Function *F = getCalledFunction())
- return F->getAttributes().hasAttribute(AttributeList::ReturnIndex, Kind);
+ return F->getAttributes().hasRetAttr(Kind);
return false;
}
};
if (isAMustTailRetVal(RetVal)) return;
Value *ShadowPtr = getShadowPtrForRetval(RetVal, IRB);
bool HasNoUndef =
- F.hasAttribute(AttributeList::ReturnIndex, Attribute::NoUndef);
+ F.hasRetAttribute(Attribute::NoUndef);
bool StoreShadow = !(ClEagerChecks && HasNoUndef);
// FIXME: Consider using SpecialCaseList to specify a list of functions that
// must always return fully initialized values. For now, we hardcode "main".