diff options
Diffstat (limited to 'llvm/lib/VMCore/AttributeImpl.h')
-rw-r--r-- | llvm/lib/VMCore/AttributeImpl.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/AttributeImpl.h b/llvm/lib/VMCore/AttributeImpl.h index 65ac3ea9823..38eef6f16c3 100644 --- a/llvm/lib/VMCore/AttributeImpl.h +++ b/llvm/lib/VMCore/AttributeImpl.h @@ -34,6 +34,9 @@ class AttributeImpl : public FoldingSetNode { public: AttributeImpl(LLVMContext &C, uint64_t data); + bool contains(Attribute::AttrKind Kind) const; + bool contains(StringRef Kind) const; + bool hasAttribute(uint64_t A) const; bool hasAttributes() const; @@ -42,6 +45,20 @@ public: uint64_t getAlignment() const; uint64_t getStackAlignment() const; + bool operator==(Attribute::AttrKind Kind) const { + return contains(Kind); + } + bool operator!=(Attribute::AttrKind Kind) const { + return !contains(Kind); + } + + bool operator==(StringRef Kind) const { + return contains(Kind); + } + bool operator!=(StringRef Kind) const { + return !contains(Kind); + } + uint64_t getBitMask() const; // FIXME: Remove. static uint64_t getAttrMask(uint64_t Val); |