Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind

when removing one attribute. This further encapsulates the use of the attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173214 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2013-01-23 00:45:55 +00:00
parent 4d79724e13
commit 8246df61f6
9 changed files with 59 additions and 23 deletions

View File

@@ -133,7 +133,10 @@ void Argument::addAttr(Attribute attr) {
/// removeAttr - Remove a Attribute from an argument
void Argument::removeAttr(Attribute attr) {
getParent()->removeAttribute(getArgNo() + 1, attr);
AttrBuilder B(attr);
getParent()->removeAttributes(getArgNo() + 1,
AttributeSet::get(getParent()->getContext(),
getArgNo() + 1, B));
}
@@ -263,9 +266,9 @@ void Function::addAttributes(unsigned i, AttributeSet attrs) {
setAttributes(PAL);
}
void Function::removeAttribute(unsigned i, Attribute attrs) {
void Function::removeAttributes(unsigned i, AttributeSet attrs) {
AttributeSet PAL = getAttributes();
PAL = PAL.removeAttr(getContext(), i, attrs);
PAL = PAL.removeAttributes(getContext(), i, attrs);
setAttributes(PAL);
}