/// list.
AttributeSet addAttr(LLVMContext &C, unsigned Idx, Attribute Attrs) const;
+ /// \brief Add attributes to the attribute set at the given index. Since
+ /// attribute sets are immutable, this returns a new set.
+ 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;
+ 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;
+ 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
return false;
}
-AttributeSet AttributeSet::addRetAttributes(LLVMContext &C,
- AttributeSet Attrs) const {
- return addAttr(C, ReturnIndex, Attrs.getAttributes(ReturnIndex));
-}
-
-AttributeSet AttributeSet::addFnAttributes(LLVMContext &C,
- AttributeSet Attrs) const {
- return addAttr(C, FunctionIndex, Attrs.getAttributes(FunctionIndex));
+AttributeSet AttributeSet::addAttributes(LLVMContext &C, unsigned Idx,
+ AttributeSet Attrs) const {
+ return addAttr(C, Idx, Attrs.getAttributes(Idx));
}
AttributeSet AttributeSet::addAttr(LLVMContext &C, unsigned Idx,