void removeParamUndefImplyingAttrs(unsigned ArgNo);
/// check if an attributes is in the list of attributes.
- bool hasAttribute(unsigned i, Attribute::AttrKind Kind) const {
- return getAttributes().hasAttribute(i, Kind);
- }
-
- /// check if an attributes is in the list of attributes.
bool hasParamAttribute(unsigned ArgNo, Attribute::AttrKind Kind) const {
return getAttributes().hasParamAttr(ArgNo, Kind);
}
return AttributeSets.getAttribute(i, Kind);
}
- /// adds the dereferenceable attribute to the list of attributes.
- void addDereferenceableAttr(unsigned i, uint64_t Bytes);
-
/// adds the dereferenceable attribute to the list of attributes for
/// the given arg.
void addDereferenceableParamAttr(unsigned ArgNo, uint64_t Bytes);
/// adds the dereferenceable_or_null attribute to the list of
- /// attributes.
- void addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes);
-
- /// adds the dereferenceable_or_null attribute to the list of
/// attributes for the given arg.
void addDereferenceableOrNullParamAttr(unsigned ArgNo, uint64_t Bytes);
TargetLowering::ArgListEntry Entry;
Entry.Node = GuardVal;
Entry.Ty = FnTy->getParamType(0);
- if (GuardCheckFn->hasAttribute(1, Attribute::AttrKind::InReg))
+ if (GuardCheckFn->hasParamAttribute(0, Attribute::AttrKind::InReg))
Entry.IsInReg = true;
Args.push_back(Entry);
setAttributes(PAL);
}
-void Function::addDereferenceableAttr(unsigned i, uint64_t Bytes) {
- AttributeList PAL = getAttributes();
- PAL = PAL.addDereferenceableAttr(getContext(), i, Bytes);
- setAttributes(PAL);
-}
-
void Function::addDereferenceableParamAttr(unsigned ArgNo, uint64_t Bytes) {
AttributeList PAL = getAttributes();
PAL = PAL.addDereferenceableParamAttr(getContext(), ArgNo, Bytes);
setAttributes(PAL);
}
-void Function::addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes) {
- AttributeList PAL = getAttributes();
- PAL = PAL.addDereferenceableOrNullAttr(getContext(), i, Bytes);
- setAttributes(PAL);
-}
-
void Function::addDereferenceableOrNullParamAttr(unsigned ArgNo,
uint64_t Bytes) {
AttributeList PAL = getAttributes();
}
static bool setRetDoesNotAlias(Function &F) {
- if (F.hasAttribute(AttributeList::ReturnIndex, Attribute::NoAlias))
+ if (F.hasRetAttribute(Attribute::NoAlias))
return false;
F.addAttribute(AttributeList::ReturnIndex, Attribute::NoAlias);
++NumNoAlias;
static bool setRetNoUndef(Function &F) {
if (!F.getReturnType()->isVoidTy() &&
- !F.hasAttribute(AttributeList::ReturnIndex, Attribute::NoUndef)) {
+ !F.hasRetAttribute(Attribute::NoUndef)) {
F.addAttribute(AttributeList::ReturnIndex, Attribute::NoUndef);
++NumNoUndef;
return true;