aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 00:45:55 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 00:45:55 +0000
commit8246df61f6de716acf1f8c64fac3c19970a2c174 (patch)
treeeea5feb78eb13d53687b1211b304c2388ef2f63c /lib/IR/Function.cpp
parent4d79724e130e69e3ce6327680460f399c18cb7eb (diff)
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
Diffstat (limited to 'lib/IR/Function.cpp')
-rw-r--r--lib/IR/Function.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp
index 4d047f6443..f2f3ec9aab 100644
--- a/lib/IR/Function.cpp
+++ b/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);
}