aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-31 11:51:54 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-31 11:51:54 +0000
commit92e287f5bde8d34af9c3f2979afb6cd05bfb452c (patch)
tree8230b4eb4dd69aed66609e24da371182d0b2fd7e /lib
parent5d0d67f3d17514e703f5c59c23445d6e971dcb73 (diff)
Add some comparison operators to compare the Attribute object with the AttrKind value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Attributes.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index e8c6b2a01c..f17a9b70f7 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -88,6 +88,14 @@ unsigned Attribute::getStackAlignment() const {
return 1U << ((pImpl->getStackAlignment() >> 26) - 1);
}
+bool Attribute::operator==(AttrKind K) const {
+ return pImpl && pImpl->contains(K);
+}
+
+bool Attribute::operator!=(AttrKind K) const {
+ return !(pImpl && pImpl->contains(K));
+}
+
uint64_t Attribute::getBitMask() const {
return pImpl ? pImpl->getBitMask() : 0;
}
@@ -473,8 +481,8 @@ uint64_t AttributeSet::getBitMask(unsigned Index) const {
}
/// getAttributes - The attributes for the specified index are returned.
-/// Attribute for the result are denoted with Idx = 0. Function notes are
-/// denoted with idx = ~0.
+/// Attributes for the result are denoted with Idx = 0. Function attributes are
+/// denoted with Idx = ~0.
Attribute AttributeSet::getAttributes(unsigned Idx) const {
if (AttrList == 0) return Attribute();