diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-23 00:45:55 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-23 00:45:55 +0000 |
commit | 430fa9bfb3aa13cd77b970c8994dfedd5fc38af5 (patch) | |
tree | cf330b57e4a857725749479e06946222212e33bf /llvm/lib/IR/Function.cpp | |
parent | f8317679cb2dab9d06835e05bd5d69c0bd8f491f (diff) | |
download | llvm-430fa9bfb3aa13cd77b970c8994dfedd5fc38af5.zip llvm-430fa9bfb3aa13cd77b970c8994dfedd5fc38af5.tar.gz llvm-430fa9bfb3aa13cd77b970c8994dfedd5fc38af5.tar.bz2 |
Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.
llvm-svn: 173214
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 4d047f6..f2f3ec9 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -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); } |