summaryrefslogtreecommitdiff
path: root/lib/VMCore/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-14 07:17:34 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-14 07:17:34 +0000
commit432e606cf126e38f3f2a0a9f3348dfac34915bee (patch)
tree57efcbb5f08e77477c2260edfd07d6a0de886e10 /lib/VMCore/Attributes.cpp
parent3756e70af69096a82b367ee9667e7720ca2201e4 (diff)
downloadllvm-432e606cf126e38f3f2a0a9f3348dfac34915bee.tar.gz
llvm-432e606cf126e38f3f2a0a9f3348dfac34915bee.tar.bz2
llvm-432e606cf126e38f3f2a0a9f3348dfac34915bee.tar.xz
Remove the bitwise OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Attributes.cpp')
-rw-r--r--lib/VMCore/Attributes.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/VMCore/Attributes.cpp b/lib/VMCore/Attributes.cpp
index e70efc54fa..0f24f97f83 100644
--- a/lib/VMCore/Attributes.cpp
+++ b/lib/VMCore/Attributes.cpp
@@ -93,9 +93,6 @@ bool Attributes::isEmptyOrSingleton() const {
return Attrs.isEmptyOrSingleton();
}
-Attributes Attributes::operator | (const Attributes &A) const {
- return Attributes(Raw() | A.Raw());
-}
Attributes Attributes::operator & (const Attributes &A) const {
return Attributes(Raw() & A.Raw());
}
@@ -236,8 +233,12 @@ removeAttribute(Attributes::AttrVal Val) {
return *this;
}
-Attributes::Builder &Attributes::Builder::
-removeAttributes(const Attributes &A) {
+Attributes::Builder &Attributes::Builder::addAttributes(const Attributes &A) {
+ Bits |= A.Raw();
+ return *this;
+}
+
+Attributes::Builder &Attributes::Builder::removeAttributes(const Attributes &A){
Bits &= ~A.Raw();
return *this;
}
@@ -514,8 +515,9 @@ AttrListPtr AttrListPtr::addAttr(unsigned Idx, Attributes Attrs) const {
"Attempt to change alignment!");
#endif
- Attributes NewAttrs = OldAttrs | Attrs;
- if (NewAttrs == OldAttrs)
+ Attributes::Builder NewAttrs =
+ Attributes::Builder(OldAttrs).addAttributes(Attrs);
+ if (NewAttrs == Attributes::Builder(OldAttrs))
return *this;
SmallVector<AttributeWithIndex, 8> NewAttrList;