Remove the bitwise NOT 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@165892 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2012-10-14 06:39:53 +00:00
parent a19a53065f
commit 5886b7bfc8
7 changed files with 35 additions and 22 deletions
@@ -762,7 +762,9 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
// here. Currently, this should not be possible, but special handling might be
// required when new return value attributes are added.
if (NRetTy->isVoidTy())
RAttrs &= ~Attributes::typeIncompatible(NRetTy);
RAttrs =
Attributes::get(Attributes::Builder(RAttrs).
removeAttributes(Attributes::typeIncompatible(NRetTy)));
else
assert((RAttrs & Attributes::typeIncompatible(NRetTy)) == 0
&& "Return attributes no longer compatible?");
@@ -831,7 +833,9 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
Attributes RAttrs = CallPAL.getRetAttributes();
Attributes FnAttrs = CallPAL.getFnAttributes();
// Adjust in case the function was changed to return void.
RAttrs &= ~Attributes::typeIncompatible(NF->getReturnType());
RAttrs =
Attributes::get(Attributes::Builder(RAttrs).
removeAttributes(Attributes::typeIncompatible(NF->getReturnType())));
if (RAttrs)
AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));