[llvm] r174832 - Add 'empty' query methods to the builder and use them in the verifier.

Bill Wendling isanbard at gmail.com
Sun Feb 10 02:12:06 PST 2013


Author: void
Date: Sun Feb 10 04:12:06 2013
New Revision: 174832

URL: http://llvm.org/viewvc/llvm-project?rev=174832&view=rev
Log:
Add 'empty' query methods to the builder and use them in the verifier.

Modified:
    llvm/trunk/include/llvm/IR/Attributes.h
    llvm/trunk/lib/IR/Verifier.cpp

Modified: llvm/trunk/include/llvm/IR/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Attributes.h?rev=174832&r1=174831&r2=174832&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Attributes.h (original)
+++ llvm/trunk/include/llvm/IR/Attributes.h Sun Feb 10 04:12:06 2013
@@ -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)

Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=174832&r1=174831&r2=174832&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Sun Feb 10 04:12:06 2013
@@ -744,7 +744,7 @@ void Verifier::VerifyFunctionAttrs(Funct
 
   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) +





More information about the llvm-commits mailing list