diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-27 22:43:04 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-27 22:43:04 +0000 |
commit | c08a5ef6581f2c7550e92d31f63cd65ec29c39e0 (patch) | |
tree | 121609d00713195ea54144a8e971145da96bde8e /include/llvm/IR/Attributes.h | |
parent | 970a479c02a418726950580e13136acd2a2dc13f (diff) | |
download | llvm-c08a5ef6581f2c7550e92d31f63cd65ec29c39e0.tar.gz llvm-c08a5ef6581f2c7550e92d31f63cd65ec29c39e0.tar.bz2 llvm-c08a5ef6581f2c7550e92d31f63cd65ec29c39e0.tar.xz |
Add special 'get' methods to create an Attribute with an alignment. Also do some random cleanup. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR/Attributes.h')
-rw-r--r-- | include/llvm/IR/Attributes.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 8959510714..4ee5814a9c 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -107,11 +107,15 @@ private: public: Attribute() : pImpl(0) {} - /// \brief Return a uniquified Attribute object. This takes the uniquified - /// value from the Builder and wraps it in the Attribute class. + /// \brief Return a uniquified Attribute object. static Attribute get(LLVMContext &Context, ArrayRef<AttrKind> Kinds); static Attribute get(LLVMContext &Context, AttrBuilder &B); + /// \brief Return a uniquified Attribute object that has the specific + /// alignment set. + static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align); + static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align); + /// \brief Return true if the attribute is present. bool hasAttribute(AttrKind Val) const; @@ -130,25 +134,18 @@ public: bool operator==(AttrKind K) const; bool operator!=(AttrKind K) const; + /// \brief Less-than operator. Useful for sorting the attributes list. bool operator<(Attribute A) const; + /// \brief The Attribute is converted to a string of equivalent mnemonic. This + /// is, presumably, for writing out the mnemonics for the assembly writer. + std::string getAsString() const; + void Profile(FoldingSetNodeID &ID) const { ID.AddPointer(pImpl); } - // FIXME: Remove these 'operator' methods. - bool operator==(const Attribute &A) const { - return pImpl == A.pImpl; - } - bool operator!=(const Attribute &A) const { - return pImpl != A.pImpl; - } - uint64_t Raw() const; - - /// \brief The Attribute is converted to a string of equivalent mnemonic. This - /// is, presumably, for writing out the mnemonics for the assembly writer. - std::string getAsString() const; }; //===----------------------------------------------------------------------===// |