X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2FIR%2FFunction.cpp;h=15c05e71e2283e805ce5739214a1d229ea1a3799;hb=b7a1dda9c91b3d1821f4235c35a0d62c62d18848;hp=839e496f92b1de27439851c9f56c8d73713eb77b;hpb=08addcab19d1a3697477f10e9573e61945beccd7;p=oota-llvm.git diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index 839e496f92b..15c05e71e22 100644 --- a/lib/IR/Function.cpp +++ b/lib/IR/Function.cpp @@ -125,12 +125,22 @@ bool Argument::hasStructRetAttr() const { /// addAttr - Add attributes to an argument. void Argument::addAttr(AttributeSet AS) { - getParent()->addAttributes(getArgNo() + 1, AS); + assert(AS.getNumSlots() == 1 && + "Trying to add more than one attribute set to an argument!"); + AttrBuilder B(AS, AS.getSlotIndex(0)); + getParent()->addAttributes(getArgNo() + 1, + AttributeSet::get(Parent->getContext(), + getArgNo() + 1, B)); } /// removeAttr - Remove attributes from an argument. void Argument::removeAttr(AttributeSet AS) { - getParent()->removeAttributes(getArgNo() + 1, AS); + assert(AS.getNumSlots() == 1 && + "Trying to remove more than one attribute set from an argument!"); + AttrBuilder B(AS, AS.getSlotIndex(0)); + getParent()->removeAttributes(getArgNo() + 1, + AttributeSet::get(Parent->getContext(), + getArgNo() + 1, B)); } //===----------------------------------------------------------------------===//