X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FAttributes.h;h=8ce7651ae9449b9db9f9f6f2b21fd8a796cf46b3;hb=39cd0c8e477255a7296b2bd1dc67193f8d38c003;hp=0975d1a2906e3bd3cc967d5919565565c9ca5d49;hpb=629fb82419d9bfff6ae475363bcce66192dfcc8e;p=oota-llvm.git diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h index 0975d1a2906..8ce7651ae94 100644 --- a/include/llvm/Attributes.h +++ b/include/llvm/Attributes.h @@ -127,7 +127,7 @@ public: return pImpl != A.pImpl; } - uint64_t Raw() const; + uint64_t getBitMask() const; /// \brief Which attributes cannot be applied to a type. static Attribute typeIncompatible(Type *Ty); @@ -160,7 +160,7 @@ class AttrBuilder { public: AttrBuilder() : Bits(0) {} explicit AttrBuilder(uint64_t B) : Bits(B) {} - AttrBuilder(const Attribute &A) : Bits(A.Raw()) {} + AttrBuilder(const Attribute &A) : Bits(A.getBitMask()) {} void clear() { Bits = 0; } @@ -176,8 +176,8 @@ public: /// removeAttribute - Remove the attributes from A from the builder. AttrBuilder &removeAttributes(const Attribute &A); - /// contains - Return true if the builder has the specified attribute. - bool hasAttribute(Attribute::AttrKind A) const; + /// \brief Return true if the builder has the specified attribute. + bool contains(Attribute::AttrKind A) const; /// hasAttributes - Return true if the builder has IR-level attributes. bool hasAttributes() const; @@ -231,7 +231,7 @@ public: .removeAttribute(Attribute::NoDuplicate); } - uint64_t Raw() const { return Bits; } + uint64_t getBitMask() const { return Bits; } bool operator==(const AttrBuilder &B) { return Bits == B.Bits; @@ -341,6 +341,20 @@ public: return getAttributes(Idx).getAlignment(); } + /// \brief Return true if the attribute exists at the given index. + bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const; + + /// \brief Return true if attribute exists at the given index. + bool hasAttributes(unsigned Index) const; + + /// \brief Get the stack alignment. + unsigned getStackAlignment(unsigned Index) const; + + /// \brief Return the attributes at the index as a string. + std::string getAsString(unsigned Index) const; + + uint64_t getBitMask(unsigned Index) const; + /// \brief Return true if the specified attribute is set for at least one /// parameter or for the return value. bool hasAttrSomewhere(Attribute::AttrKind Attr) const;