Remove the bitwise AND operators from the Attributes class. Replace it with the equivalent from the builder class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165896 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2012-10-14 07:52:48 +00:00
parent c416795fea
commit 1feacad0ca
5 changed files with 9 additions and 17 deletions

View 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.

View 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));

View 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

View 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;
}

View 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) ||