diff options
-rw-r--r-- | include/llvm/IR/Attributes.h | 4 | ||||
-rw-r--r-- | lib/IR/Verifier.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index 38f4ed9..2a0363c 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -471,6 +471,8 @@ public: const_iterator begin() const { return Attrs.begin(); } const_iterator end() const { return Attrs.end(); } + bool empty() const { return Attrs.empty(); } + // Iterators for target-dependent attributes. typedef std::pair<std::string, std::string> td_type; typedef std::map<std::string, std::string>::iterator td_iterator; @@ -482,6 +484,8 @@ public: td_const_iterator td_begin() const { return TargetDepAttrs.begin(); } td_const_iterator td_end() const { return TargetDepAttrs.end(); } + bool td_empty() const { return TargetDepAttrs.empty(); } + /// \brief Remove attributes that are used on functions only. void removeFunctionOnlyAttrs() { removeAttribute(Attribute::NoReturn) diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index babc295..31312dc 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -744,7 +744,7 @@ void Verifier::VerifyFunctionAttrs(FunctionType *FT, AttrBuilder NotFn(Attrs, AttributeSet::FunctionIndex); NotFn.removeFunctionOnlyAttrs(); - Assert1(!NotFn.hasAttributes(), "Attribute '" + + Assert1(NotFn.empty(), "Attributes '" + AttributeSet::get(V->getContext(), AttributeSet::FunctionIndex, NotFn).getAsString(AttributeSet::FunctionIndex) + |