More encapsulation work.

Use the AttributeSet when we're talking about more than one attribute. Add a
function that adds a single attribute. No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2013-01-22 21:15:51 +00:00
parent 5de048ec30
commit defaca00b8
7 changed files with 69 additions and 63 deletions

View File

@@ -212,6 +212,11 @@ private:
/// for the result are denoted with Idx = 0.
Attribute getAttributes(unsigned Idx) const;
/// \brief Add the specified attribute at the specified index to this
/// attribute list. Since attribute lists are immutable, this returns the new
/// list.
AttributeSet addAttr(LLVMContext &C, unsigned Idx, Attribute Attrs) const;
explicit AttributeSet(AttributeSetImpl *LI) : AttrList(LI) {}
public:
AttributeSet() : AttrList(0) {}
@@ -226,10 +231,10 @@ public:
static AttributeSet get(LLVMContext &C, ArrayRef<AttributeWithIndex> Attrs);
static AttributeSet get(LLVMContext &C, unsigned Idx, AttrBuilder &B);
/// \brief Add the specified attribute at the specified index to this
/// attribute list. Since attribute lists are immutable, this returns the new
/// list.
AttributeSet addAttr(LLVMContext &C, unsigned Idx, Attribute Attrs) const;
/// \brief Add an attribute to the attribute set at the given index. Since
/// attribute sets are immutable, this returns a new set.
AttributeSet addAttribute(LLVMContext &C, unsigned Idx,
Attribute::AttrKind Attr) const;
/// \brief Add attributes to the attribute set at the given index. Since
/// attribute sets are immutable, this returns a new set.