Remove the bitwise AND operators from the Attributes class. Replace it with the equiv...
authorBill Wendling <isanbard@gmail.com>
Sun, 14 Oct 2012 07:52:48 +0000 (07:52 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 14 Oct 2012 07:52:48 +0000 (07:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165896 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Attributes.h
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/VMCore/Attributes.cpp
lib/VMCore/Verifier.cpp

index 08cfb86898c9e45305876f7702ca3638387da64b..24d52bc46df02b0a6336f74fd082c2bd4e9f3650 100644 (file)
@@ -235,9 +235,6 @@ public:
     return Attrs.Bits != A.Attrs.Bits;
   }
 
-  Attributes operator & (const Attributes &A) const;
-  Attributes &operator &= (const Attributes &A);
-
   uint64_t Raw() const;
 
   /// @brief Which attributes cannot be applied to a type.
index 6b5238750486d283c60dbec5a3aceeea024a5294..aa34b33a8aedde4848cf734a169f586f8895b34e 100644 (file)
@@ -766,8 +766,9 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
       Attributes::get(Attributes::Builder(RAttrs).
                       removeAttributes(Attributes::typeIncompatible(NRetTy)));
   else
-    assert((RAttrs & Attributes::typeIncompatible(NRetTy)) == 0
-           && "Return attributes no longer compatible?");
+    assert(!Attributes::Builder(RAttrs).
+             hasAttributes(Attributes::typeIncompatible(NRetTy)) &&
+           "Return attributes no longer compatible?");
 
   if (RAttrs)
     AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
index 34e16c7aeff488692cbecdf6555ecd3bf0211b52..aa4b6b4a399f44188603aa8a9020bb9388f9cd1d 100644 (file)
@@ -1038,7 +1038,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
       return false;   // Cannot transform this parameter value.
 
     Attributes Attrs = CallerPAL.getParamAttributes(i + 1);
-    if (Attrs & Attributes::typeIncompatible(ParamTy))
+    if (Attributes::Builder(Attrs).
+          hasAttributes(Attributes::typeIncompatible(ParamTy)))
       return false;   // Attribute not compatible with transformed value.
 
     // If the parameter is passed as a byval argument, then we have to have a
index 635ad1409ffa220825054dccc974c67a83241681..fadb8ca6c1dbf1c612c9b47b4e40d3ff06d01ec2 100644 (file)
@@ -93,14 +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) {
-  Attrs.Bits &= A.Raw();
-  return *this;
-}
-
 uint64_t Attributes::Raw() const {
   return Attrs.Bits;
 }
index 53744b48691f665337b8a62bb441605e6174e7aa..5d431df281a70e90b9c5f039167f0c545d5d8ee7 100644 (file)
@@ -567,9 +567,10 @@ void Verifier::VerifyParameterAttrs(Attributes Attrs, Type *Ty,
             Attrs.hasAttribute(Attributes::AlwaysInline)), "Attributes "
           "'noinline and alwaysinline' are incompatible!", V);
 
-  Attributes TypeI = Attrs & Attributes::typeIncompatible(Ty);
-  Assert1(!TypeI, "Wrong type for attribute " +
-          TypeI.getAsString(), V);
+  Assert1(!Attributes::Builder(Attrs).
+            hasAttributes(Attributes::typeIncompatible(Ty)),
+          "Wrong types for attribute: " +
+          Attributes::typeIncompatible(Ty).getAsString(), V);
 
   if (PointerType *PTy = dyn_cast<PointerType>(Ty))
     Assert1(!Attrs.hasAttribute(Attributes::ByVal) ||