diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-02-05 23:48:36 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-02-05 23:48:36 +0000 |
commit | 64754f499058b5dc748ea6d06a084af0ed539ec4 (patch) | |
tree | 7f020dda14e1ed8c76d8b229910200b27ca2d86a /include | |
parent | 7743232775d2fe12f3152fe955218dc1fc97a497 (diff) | |
download | external_llvm-64754f499058b5dc748ea6d06a084af0ed539ec4.zip external_llvm-64754f499058b5dc748ea6d06a084af0ed539ec4.tar.gz external_llvm-64754f499058b5dc748ea6d06a084af0ed539ec4.tar.bz2 |
Add the target-dependent (string) attributes from the AttrBuilder to the AttributeSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/Attributes.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 46d279c..83396e1 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -140,6 +140,9 @@ public: /// \brief Return true if the attribute is present. bool hasAttribute(AttrKind Val) const; + /// \brief Return true if the target-dependent attribute is present. + bool hasAttribute(StringRef Val) const; + /// \brief Return the attribute's kind as an enum (Attribute::AttrKind). This /// requires the attribute to be an enum or alignment attribute. Attribute::AttrKind getKindAsEnum() const; @@ -418,6 +421,7 @@ public: /// the form used internally in Attribute. AttrBuilder &addStackAlignmentAttr(unsigned Align); + // Iterators for target-independent attributes. typedef DenseSet<Attribute::AttrKind>::iterator iterator; typedef DenseSet<Attribute::AttrKind>::const_iterator const_iterator; @@ -427,6 +431,17 @@ public: const_iterator begin() const { return Attrs.begin(); } const_iterator end() const { return Attrs.end(); } + // Iterators for target-dependent attributes. + typedef std::pair<std::string, std::string> td_type; + typedef std::map<std::string, std::string>::iterator td_iterator; + typedef std::map<std::string, std::string>::const_iterator td_const_iterator; + + td_iterator td_begin() { return TargetDepAttrs.begin(); } + td_iterator td_end() { return TargetDepAttrs.end(); } + + td_const_iterator td_begin() const { return TargetDepAttrs.begin(); } + td_const_iterator td_end() const { return TargetDepAttrs.end(); } + /// \brief Remove attributes that are used on functions only. void removeFunctionOnlyAttrs() { removeAttribute(Attribute::NoReturn) |