diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h index cc14e965e2d..7b621249d72 100644 --- a/include/llvm/Attributes.h +++ b/include/llvm/Attributes.h @@ -176,8 +176,8 @@ public: /// removeAttribute - Remove the attributes from A from the builder. AttrBuilder &removeAttributes(const Attribute &A); - /// contains - Return true if the builder has the specified attribute. - bool hasAttribute(Attribute::AttrKind A) const; + /// \brief Return true if the builder has the specified attribute. + bool contains(Attribute::AttrKind A) const; /// hasAttributes - Return true if the builder has IR-level attributes. bool hasAttributes() const; diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 0f9ba58295b..c2e59f0f2ca 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -479,7 +479,7 @@ void CppWriter::printAttributes(const AttributeSet &PAL, Out << " {\n AttrBuilder B;\n"; #define HANDLE_ATTR(X) \ - if (attrs.hasAttribute(Attribute::X)) \ + if (attrs.contains(Attribute::X)) \ Out << " B.addAttribute(Attribute::" #X ");\n"; \ attrs.removeAttribute(Attribute::X); @@ -509,7 +509,7 @@ void CppWriter::printAttributes(const AttributeSet &PAL, HANDLE_ATTR(NonLazyBind); HANDLE_ATTR(MinSize); #undef HANDLE_ATTR - if (attrs.hasAttribute(Attribute::StackAlignment)) + if (attrs.contains(Attribute::StackAlignment)) Out << " B.addStackAlignmentAttr(" << attrs.getStackAlignment() << ")\n"; attrs.removeAttribute(Attribute::StackAlignment); assert(!attrs.hasAttributes() && "Unhandled attribute!"); diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp index 0db1eb5ed44..b32358708d8 100644 --- a/lib/VMCore/Attributes.cpp +++ b/lib/VMCore/Attributes.cpp @@ -266,7 +266,7 @@ AttrBuilder &AttrBuilder::removeAttributes(const Attribute &A){ return *this; } -bool AttrBuilder::hasAttribute(Attribute::AttrKind A) const { +bool AttrBuilder::contains(Attribute::AttrKind A) const { return Bits & AttributeImpl::getAttrMask(A); }