/// removeAttribute - Remove the attributes from A from the builder.
AttrBuilder &removeAttributes(const Attribute &A);
- /// \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;
bool operator!=(const AttrBuilder &B) {
return Bits != B.Bits;
}
+
+ bool operator==(Attribute::AttrKind A) const;
+ bool operator!=(Attribute::AttrKind A) const;
};
//===----------------------------------------------------------------------===//
return Vals;
}
- bool contains(Attribute::AttrKind Kind) const;
- bool contains(StringRef Kind) const;
-
bool hasAttribute(Attribute::AttrKind A) const;
bool hasAttributes() const;
uint64_t getAlignment() const;
uint64_t getStackAlignment() const;
- bool operator==(Attribute::AttrKind Kind) const {
- return contains(Kind);
- }
- bool operator!=(Attribute::AttrKind Kind) const {
- return !contains(Kind);
- }
+ bool operator==(Attribute::AttrKind Kind) const;
+ bool operator!=(Attribute::AttrKind Kind) const;
- bool operator==(StringRef Kind) const {
- return contains(Kind);
- }
- bool operator!=(StringRef Kind) const {
- return !contains(Kind);
- }
+ bool operator==(StringRef Kind) const;
+ bool operator!=(StringRef Kind) const;
uint64_t getBitMask() const; // FIXME: Remove.
}
bool Attribute::operator==(AttrKind K) const {
- return pImpl && pImpl->contains(K);
+ return pImpl && *pImpl == K;
}
bool Attribute::operator!=(AttrKind K) const {
- return !(pImpl && pImpl->contains(K));
+ return !(pImpl && *pImpl == K);
}
uint64_t Attribute::getBitMask() const {
return *this;
}
-bool AttrBuilder::contains(Attribute::AttrKind A) const {
+bool AttrBuilder::operator==(Attribute::AttrKind A) const {
return Bits & AttributeImpl::getAttrMask(A);
}
+bool AttrBuilder::operator!=(Attribute::AttrKind A) const {
+ return !(*this == A);
+}
+
bool AttrBuilder::hasAttributes() const {
return Bits != 0;
}
Data = ConstantDataArray::getString(C, data);
}
-bool AttributeImpl::contains(Attribute::AttrKind Kind) const {
+bool AttributeImpl::operator==(Attribute::AttrKind Kind) const {
if (ConstantInt *CI = dyn_cast<ConstantInt>(Data))
return CI->getZExtValue() == Kind;
return false;
}
+bool AttributeImpl::operator!=(Attribute::AttrKind Kind) const {
+ return !(*this == Kind);
+}
-bool AttributeImpl::contains(StringRef Kind) const {
+bool AttributeImpl::operator==(StringRef Kind) const {
if (ConstantDataArray *CDA = dyn_cast<ConstantDataArray>(Data))
if (CDA->isString())
return CDA->getAsString() == Kind;
return false;
}
+bool AttributeImpl::operator!=(StringRef Kind) const {
+ return !(*this == Kind);
+}
uint64_t AttributeImpl::getBitMask() const {
// FIXME: Remove this.