diff options
Diffstat (limited to 'llvm/lib/IR/AttributeImpl.h')
-rw-r--r-- | llvm/lib/IR/AttributeImpl.h | 14 |
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; |