diff options
Diffstat (limited to 'include/llvm/IR/Attributes.h')
-rw-r--r-- | include/llvm/IR/Attributes.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 9eccf40..86f9cc8 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -86,6 +86,7 @@ public: NoInline, ///< inline=never NonLazyBind, ///< Function is called early and/or ///< often, so lazy binding isn't worthwhile + NonNull, ///< Pointer is known to be not null NoRedZone, ///< Disable redzone NoReturn, ///< Mark the function as not returning NoUnwind, ///< Function doesn't unwind stack @@ -116,7 +117,7 @@ private: AttributeImpl *pImpl; Attribute(AttributeImpl *A) : pImpl(A) {} public: - Attribute() : pImpl(0) {} + Attribute() : pImpl(nullptr) {} //===--------------------------------------------------------------------===// // Attribute Construction @@ -232,7 +233,7 @@ private: explicit AttributeSet(AttributeSetImpl *LI) : pImpl(LI) {} public: - AttributeSet() : pImpl(0) {} + AttributeSet() : pImpl(nullptr) {} //===--------------------------------------------------------------------===// // AttributeSet Construction and Mutation @@ -242,7 +243,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 +470,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 +479,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); |