summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-03 01:54:39 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-03 01:54:39 +0000
commit04949fa99810054766741ffb4a186b7014557a54 (patch)
tree57842611c7011772262cd76206d212a04253550e /llvm/lib/IR/Attributes.cpp
parentb168708ad8824bb01677165298828583c9e49973 (diff)
downloadbcm5719-llvm-04949fa99810054766741ffb4a186b7014557a54.tar.gz
bcm5719-llvm-04949fa99810054766741ffb4a186b7014557a54.zip
Try again to revert the bad patch. The tree was reverted for some unknown reason
before the last time. --- Reverse-merging r171442 into '.': U include/llvm/IR/Attributes.h U lib/IR/Attributes.cpp U lib/IR/AttributeImpl.h llvm-svn: 171448
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index e6a5327b5fa..b847d768f3a 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -89,11 +89,11 @@ unsigned Attribute::getStackAlignment() const {
}
bool Attribute::operator==(AttrKind K) const {
- return pImpl && *pImpl == K;
+ return pImpl && pImpl->contains(K);
}
bool Attribute::operator!=(AttrKind K) const {
- return !(pImpl && *pImpl == K);
+ return !(pImpl && pImpl->contains(K));
}
uint64_t Attribute::getBitMask() const {
@@ -293,14 +293,10 @@ AttrBuilder &AttrBuilder::removeAttributes(const Attribute &A){
return *this;
}
-bool AttrBuilder::operator==(Attribute::AttrKind A) const {
+bool AttrBuilder::contains(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;
}
@@ -345,24 +341,18 @@ AttributeImpl::AttributeImpl(LLVMContext &C, StringRef data) {
Data = ConstantDataArray::getString(C, data);
}
-bool AttributeImpl::operator==(Attribute::AttrKind Kind) const {
+bool AttributeImpl::contains(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::operator==(StringRef Kind) const {
+bool AttributeImpl::contains(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.
OpenPOWER on IntegriCloud