summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-05 01:36:54 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-05 01:36:54 +0000
commit1bbd644301ed4d8a7efd4ceb15f71c56fa914f28 (patch)
tree01f782ee5c5506a9b2f61bb5cc69e58f32a34a65 /include
parent024328ea49e8321f358bd68bf6c077d5f5323413 (diff)
downloadllvm-1bbd644301ed4d8a7efd4ceb15f71c56fa914f28.tar.gz
llvm-1bbd644301ed4d8a7efd4ceb15f71c56fa914f28.tar.bz2
llvm-1bbd644301ed4d8a7efd4ceb15f71c56fa914f28.tar.xz
Add a method to create an AttributeSet from an AttrBuilder.
The Attribute class is eventually going to represent one attribute. So we need this class to create the set of attributes. Add some iterator methods to the builder to access its internal bits in a nice way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/Attributes.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index e5a1ad294b..28ec9db62e 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -116,10 +116,16 @@ public:
/// value.
unsigned getAlignment() const;
+ /// \brief Set the alignment field of an attribute.
+ void setAlignment(unsigned Align);
+
/// \brief Returns the stack alignment field of an attribute as a byte
/// alignment value.
unsigned getStackAlignment() const;
+ /// \brief Set the stack alignment field of an attribute.
+ void setStackAlignment(unsigned Align);
+
/// \brief Equality and non-equality query methods.
bool operator==(AttrKind K) const;
bool operator!=(AttrKind K) const;
@@ -233,6 +239,15 @@ public:
/// the form used internally in Attribute.
AttrBuilder &addStackAlignmentAttr(unsigned Align);
+ typedef DenseSet<Attribute::AttrKind>::iterator iterator;
+ typedef DenseSet<Attribute::AttrKind>::const_iterator const_iterator;
+
+ iterator begin() { return Attrs.begin(); }
+ iterator end() { return Attrs.end(); }
+
+ const_iterator begin() const { return Attrs.begin(); }
+ const_iterator end() const { return Attrs.end(); }
+
/// \brief Add the raw value to the internal representation.
///
/// N.B. This should be used ONLY for decoding LLVM bitcode!
@@ -329,6 +344,7 @@ public:
/// \brief Return an AttributeSet with the specified parameters in it.
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