AttributeSet addAttributes(LLVMContext &C, unsigned Idx,
AttributeSet Attrs) const;
- /// \brief Add return attributes to this attribute set. Since attribute sets
- /// are immutable, this returns a new set.
- AttributeSet addRetAttributes(LLVMContext &C, AttributeSet Attrs) const {
- return addAttributes(C, ReturnIndex, Attrs);
- }
-
- /// \brief Add function attributes to this attribute set. Since attribute sets
- /// are immutable, this returns a new set.
- AttributeSet addFnAttributes(LLVMContext &C, AttributeSet Attrs) const {
- return addAttributes(C, FunctionIndex, Attrs);
- }
-
/// \brief Remove the specified attribute at the specified index from this
/// attribute list. Since attribute lists are immutable, this returns the new
/// list.
const AttributeSet PAL = Func->getAttributes();
AttrBuilder B(PA);
const AttributeSet PALnew =
- PAL.addFnAttributes(Func->getContext(),
- AttributeSet::get(Func->getContext(),
- AttributeSet::FunctionIndex, B));
+ PAL.addAttributes(Func->getContext(), AttributeSet::FunctionIndex,
+ AttributeSet::get(Func->getContext(),
+ AttributeSet::FunctionIndex, B));
Func->setAttributes(PALnew);
}
Function *F = (*I)->getFunction();
const AttributeSet &PAL = F->getAttributes();
const AttributeSet &NPAL =
- PAL.addFnAttributes(F->getContext(),
- AttributeSet::get(F->getContext(),
- AttributeSet::FunctionIndex,
- NewAttributes));
+ PAL.addAttributes(F->getContext(), AttributeSet::FunctionIndex,
+ AttributeSet::get(F->getContext(),
+ AttributeSet::FunctionIndex,
+ NewAttributes));
if (PAL != NPAL) {
MadeChange = true;
F->setAttributes(NPAL);
Anew->addAttr(OldFunc->getAttributes()
.getParamAttributes(I->getArgNo() + 1));
NewFunc->setAttributes(NewFunc->getAttributes()
- .addRetAttributes(NewFunc->getContext(),
- OldFunc->getAttributes()));
+ .addAttributes(NewFunc->getContext(),
+ AttributeSet::ReturnIndex,
+ OldFunc->getAttributes()));
NewFunc->setAttributes(NewFunc->getAttributes()
- .addFnAttributes(NewFunc->getContext(),
- OldFunc->getAttributes()));
+ .addAttributes(NewFunc->getContext(),
+ AttributeSet::FunctionIndex,
+ OldFunc->getAttributes()));
}