summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AttributeImpl.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-29 03:20:31 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-29 03:20:31 +0000
commitf2955aa3f20ab76162be2aa23512d8d175cbf34f (patch)
tree4d14291591208f37db3315480c352a326c2a4671 /llvm/lib/IR/AttributeImpl.h
parent778138e960b9f0abfdc1ff6e65bbfcb497cdd12a (diff)
downloadbcm5719-llvm-f2955aa3f20ab76162be2aa23512d8d175cbf34f.tar.gz
bcm5719-llvm-f2955aa3f20ab76162be2aa23512d8d175cbf34f.zip
Convert getAttributes() to return an AttributeSetNode.
The AttributeSetNode contains all of the attributes. This removes one (hopefully last) use of the Attribute class as a container of multiple attributes. llvm-svn: 173761
Diffstat (limited to 'llvm/lib/IR/AttributeImpl.h')
-rw-r--r--llvm/lib/IR/AttributeImpl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/AttributeImpl.h b/llvm/lib/IR/AttributeImpl.h
index 34754e8e543..91f5005639a 100644
--- a/llvm/lib/IR/AttributeImpl.h
+++ b/llvm/lib/IR/AttributeImpl.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/IR/Attributes.h"
+#include <string>
namespace llvm {
@@ -92,6 +93,13 @@ class AttributeSetNode : public FoldingSetNode {
public:
static AttributeSetNode *get(LLVMContext &C, ArrayRef<Attribute> Attrs);
+ bool hasAttribute(Attribute::AttrKind Kind) const;
+ bool hasAttributes() const { return !AttrList.empty(); }
+
+ unsigned getAlignment() const;
+ unsigned getStackAlignment() const;
+ std::string getAsString() const;
+
typedef SmallVectorImpl<Attribute>::iterator iterator;
typedef SmallVectorImpl<Attribute>::const_iterator const_iterator;
@@ -152,6 +160,12 @@ public:
return AttributeSet::get(Context, AttrNodes[Slot]);
}
+ /// \brief Retrieve the attribute set node for the given "slot" in the
+ /// AttrNode list.
+ AttributeSetNode *getSlotNode(unsigned Slot) const {
+ return AttrNodes[Slot].second;
+ }
+
typedef AttributeSetNode::iterator iterator;
typedef AttributeSetNode::const_iterator const_iterator;
OpenPOWER on IntegriCloud