aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-28 05:23:28 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-28 05:23:28 +0000
commit49f6060f16aec4024d644a6ec4ddd3de9b3e8821 (patch)
tree9eb437c836037b61b3c006bee17f556e2131518b /include
parent53ff78b2019e96e142986d19dd99f8dd563dc494 (diff)
downloadexternal_llvm-49f6060f16aec4024d644a6ec4ddd3de9b3e8821.zip
external_llvm-49f6060f16aec4024d644a6ec4ddd3de9b3e8821.tar.gz
external_llvm-49f6060f16aec4024d644a6ec4ddd3de9b3e8821.tar.bz2
Rewrite the addAttr() method.
This now uses the AttributeSet object instead of the Attribute / AttributeWithIndex objects. It's fairly simple now. It goes through all of the subsets before the one we're modifying, adds them to the new set. It then adds the modified subset. And then adds the rest of the subsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/Attributes.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index 89a73d6..e477b79 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -219,7 +219,7 @@ private:
/// \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;
+ AttributeSet addAttr(LLVMContext &C, unsigned Idx, AttributeSet Attrs) const;
/// \brief Remove the specified attribute at the specified index from this
/// attribute list. Since attribute lists are immutable, this returns the new
@@ -284,7 +284,7 @@ public:
AttributeSet Attrs) const;
//===--------------------------------------------------------------------===//
- // Attribute List Accessors
+ // Attribute Set Accessors
//===--------------------------------------------------------------------===//
/// \brief The attributes for the specified index are returned.
@@ -296,24 +296,20 @@ public:
/// \brief The function attributes are returned.
AttributeSet getFnAttributes() const;
- /// \brief Return the alignment for the specified function parameter.
- unsigned getParamAlignment(unsigned Idx) const;
-
/// \brief Return true if the attribute exists at the given index.
- bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const;
+ bool hasAttribute(uint64_t Index, Attribute::AttrKind Kind) const;
/// \brief Return true if attribute exists at the given index.
- bool hasAttributes(unsigned Index) const;
+ bool hasAttributes(uint64_t Index) const;
- /// \brief Returns the alignment field of an attribute as a byte alignment
- /// value.
- unsigned getAlignment(unsigned Index) const;
+ /// \brief Return the alignment for the specified function parameter.
+ unsigned getParamAlignment(uint64_t Idx) const;
/// \brief Get the stack alignment.
- unsigned getStackAlignment(unsigned Index) const;
+ unsigned getStackAlignment(uint64_t Index) const;
/// \brief Return the attributes at the index as a string.
- std::string getAsString(unsigned Index) const;
+ std::string getAsString(uint64_t Index) const;
uint64_t Raw(unsigned Index) const;
@@ -389,11 +385,14 @@ public:
/// \brief Remove an attribute from the builder.
AttrBuilder &removeAttribute(Attribute::AttrKind Val);
- /// \brief Add the attributes from A to the builder.
- AttrBuilder &addAttributes(const Attribute &A);
+ /// \brief Add the attributes to the builder.
+ AttrBuilder &addAttributes(Attribute A);
+
+ /// \brief Remove the attributes from the builder.
+ AttrBuilder &removeAttributes(Attribute A);
- /// \brief Remove the attributes from A from the builder.
- AttrBuilder &removeAttributes(const Attribute &A);
+ /// \brief Add the attributes to the builder.
+ AttrBuilder &addAttributes(AttributeSet A);
/// \brief Return true if the builder has the specified attribute.
bool contains(Attribute::AttrKind A) const;