X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FIPO%2FDeadArgumentElimination.cpp;h=61b37d87cca893a4c9d22a6f05837da9620d7e3a;hb=8e47daf2858e980210f3e1f007036b24da342c29;hp=3a38ca4bb8c6a49e5d1b3043cd00a047616bb3b8;hpb=28d65722d6f283b327b5815914382077fe9c0ab4;p=oota-llvm.git diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 3a38ca4bb8c..61b37d87cca 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -272,14 +272,16 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { // Drop any attributes that were on the vararg arguments. AttributeSet PAL = CS.getAttributes(); - if (!PAL.isEmpty() && PAL.getSlot(PAL.getNumSlots() - 1).Index > NumArgs) { - SmallVector AttributesVec; - for (unsigned i = 0; PAL.getSlot(i).Index <= NumArgs; ++i) - AttributesVec.push_back(PAL.getSlot(i)); + if (!PAL.isEmpty() && PAL.getSlotIndex(PAL.getNumSlots() - 1) > NumArgs) { + SmallVector AttributesVec; + for (unsigned i = 0; PAL.getSlotIndex(i) <= NumArgs; ++i) + AttributesVec.push_back(PAL.getSlotAttributes(i)); if (PAL.hasAttributes(AttributeSet::FunctionIndex)) - AttributesVec.push_back(AttributeWithIndex::get(Fn.getContext(), - AttributeSet::FunctionIndex, - PAL.getFnAttributes())); + AttributesVec.push_back( + AttributeSet::get(Fn.getContext(), + AttributeWithIndex::get(Fn.getContext(), + AttributeSet::FunctionIndex, + PAL.getFnAttributes()))); PAL = AttributeSet::get(Fn.getContext(), AttributesVec); } @@ -765,10 +767,10 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) { RAttrs = AttributeSet::get(NRetTy->getContext(), AttributeSet::ReturnIndex, AttrBuilder(RAttrs, AttributeSet::ReturnIndex). - removeAttributes(Attribute::typeIncompatible(NRetTy))); + removeAttributes(AttributeFuncs::typeIncompatible(NRetTy))); else assert(!AttrBuilder(RAttrs, AttributeSet::ReturnIndex). - hasAttributes(Attribute::typeIncompatible(NRetTy)) && + hasAttributes(AttributeFuncs::typeIncompatible(NRetTy)) && "Return attributes no longer compatible?"); if (RAttrs.hasAttributes(AttributeSet::ReturnIndex)) @@ -846,7 +848,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) { RAttrs = AttributeSet::get(NF->getContext(), AttributeSet::ReturnIndex, AttrBuilder(RAttrs, AttributeSet::ReturnIndex). - removeAttributes(Attribute::typeIncompatible(NF->getReturnType()))); + removeAttributes(AttributeFuncs::typeIncompatible(NF->getReturnType()))); if (RAttrs.hasAttributes(AttributeSet::ReturnIndex)) AttributesVec.push_back(AttributeWithIndex::get(NF->getContext(), AttributeSet::ReturnIndex,