diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-29 03:20:31 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-29 03:20:31 +0000 |
commit | 606c8e36dfdd28fc589356addd3e2cbb89a32e4d (patch) | |
tree | 5a62f95278b5433f40460890026320b96b2c0f8a /lib/IR/AttributeImpl.h | |
parent | 3a57c37964adfbbf83b4b309a2ceda43ba6d8231 (diff) | |
download | external_llvm-606c8e36dfdd28fc589356addd3e2cbb89a32e4d.zip external_llvm-606c8e36dfdd28fc589356addd3e2cbb89a32e4d.tar.gz external_llvm-606c8e36dfdd28fc589356addd3e2cbb89a32e4d.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173761 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/AttributeImpl.h')
-rw-r--r-- | lib/IR/AttributeImpl.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h index 34754e8..91f5005 100644 --- a/lib/IR/AttributeImpl.h +++ b/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; |