addRawValue(B);
}
AttrBuilder(const Attribute &A) : Alignment(0), StackAlignment(0) {
- addAttributes(A);
+ addAttribute(A);
}
AttrBuilder(AttributeSet AS, unsigned Idx);
/// \brief Add an attribute to the builder.
AttrBuilder &addAttribute(Attribute::AttrKind Val);
+ /// \brief Add the Attribute object to the builder.
+ AttrBuilder &addAttribute(Attribute A);
+
/// \brief Remove an attribute from the builder.
AttrBuilder &removeAttribute(Attribute::AttrKind Val);
- /// \brief Add the attributes to the builder.
- AttrBuilder &addAttributes(Attribute A);
-
/// \brief Remove the attributes from the builder.
AttrBuilder &removeAttributes(AttributeSet A, uint64_t Index);
for (AttributeSetNode::const_iterator II = ASN->begin(),
IE = ASN->end(); II != IE; ++II)
- B.addAttributes(*II);
+ B.addAttribute(*II);
return B.Raw();
}
if (Attrs.getSlotIndex(I) == Idx) {
for (AttributeSetImpl::const_iterator II = Attrs.pImpl->begin(I),
IE = Attrs.pImpl->end(I); II != IE; ++II)
- B.addAttributes(*II);
+ B.addAttribute(*II);
break;
}
for (AttributeSetImpl::const_iterator II = pImpl->begin(I),
IE = pImpl->end(I); II != IE; ++II)
- addAttributes(*II);
+ addAttribute(*II);
break;
}
return *this;
}
-AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) {
- Attrs.erase(Val);
-
- if (Val == Attribute::Alignment)
- Alignment = 0;
- else if (Val == Attribute::StackAlignment)
- StackAlignment = 0;
-
- return *this;
-}
-
-AttrBuilder &AttrBuilder::addAttributes(Attribute Attr) {
+AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) {
ConstantInt *Kind = cast<ConstantInt>(Attr.getAttributeKind());
Attribute::AttrKind KindVal = Attribute::AttrKind(Kind->getZExtValue());
Attrs.insert(KindVal);
return *this;
}
+AttrBuilder &AttrBuilder::removeAttribute(Attribute::AttrKind Val) {
+ Attrs.erase(Val);
+
+ if (Val == Attribute::Alignment)
+ Alignment = 0;
+ else if (Val == Attribute::StackAlignment)
+ StackAlignment = 0;
+
+ return *this;
+}
+
AttrBuilder &AttrBuilder::removeAttributes(AttributeSet A, uint64_t Index) {
uint64_t Mask = A.Raw(Index);