diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-05-03 23:00:35 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-05-03 23:00:35 +0000 |
commit | b3428a05a021bf067f70cd5363b70833f962c14f (patch) | |
tree | 1a397389b6e529e7ca26cc14e3b2a3084d69ec57 /include/llvm/IR/Attributes.h | |
parent | b2bd7e89e64b73be1c412ba8942b40c106b3f070 (diff) | |
download | llvm-b3428a05a021bf067f70cd5363b70833f962c14f.tar.gz llvm-b3428a05a021bf067f70cd5363b70833f962c14f.tar.bz2 llvm-b3428a05a021bf067f70cd5363b70833f962c14f.tar.xz |
IR: Cleanup AttributeSet::get for AttrBuilder
We don't modify the AttrBuilder in AttributeSet::get, make the reference
argument const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR/Attributes.h')
-rw-r--r-- | include/llvm/IR/Attributes.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 43d1fb4258..cb4275337d 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -242,7 +242,7 @@ public: static AttributeSet get(LLVMContext &C, ArrayRef<AttributeSet> Attrs); static AttributeSet get(LLVMContext &C, unsigned Index, ArrayRef<Attribute::AttrKind> Kind); - static AttributeSet get(LLVMContext &C, unsigned Index, AttrBuilder &B); + static AttributeSet get(LLVMContext &C, unsigned Index, const AttrBuilder &B); /// \brief Add an attribute to the attribute set at the given index. Since /// attribute sets are immutable, this returns a new set. @@ -469,6 +469,8 @@ public: 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; + typedef llvm::iterator_range<td_iterator> td_range; + typedef llvm::iterator_range<td_const_iterator> td_const_range; td_iterator td_begin() { return TargetDepAttrs.begin(); } td_iterator td_end() { return TargetDepAttrs.end(); } @@ -476,6 +478,11 @@ public: td_const_iterator td_begin() const { return TargetDepAttrs.begin(); } td_const_iterator td_end() const { return TargetDepAttrs.end(); } + td_range td_attrs() { return td_range(td_begin(), td_end()); } + td_const_range td_attrs() const { + return td_const_range(td_begin(), td_end()); + } + bool td_empty() const { return TargetDepAttrs.empty(); } bool operator==(const AttrBuilder &B); |