/// 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));
}
//===----------------------------------------------------------------------===//