summaryrefslogtreecommitdiff
path: root/lib/IR/Core.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/Core.cpp
parent4d79724e130e69e3ce6327680460f399c18cb7eb (diff)
downloadllvm-8246df61f6de716acf1f8c64fac3c19970a2c174.tar.gz
llvm-8246df61f6de716acf1f8c64fac3c19970a2c174.tar.bz2
llvm-8246df61f6de716acf1f8c64fac3c19970a2c174.tar.xz
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/Core.cpp')
-rw-r--r--lib/IR/Core.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp
index e72eb69982..0e42536789 100644
--- a/lib/IR/Core.cpp
+++ b/lib/IR/Core.cpp
@@ -1394,8 +1394,9 @@ void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
const AttributeSet PAL = Func->getAttributes();
AttrBuilder B(PA);
const AttributeSet PALnew =
- PAL.removeAttr(Func->getContext(), AttributeSet::FunctionIndex,
- Attribute::get(Func->getContext(), B));
+ PAL.removeAttributes(Func->getContext(), AttributeSet::FunctionIndex,
+ AttributeSet::get(Func->getContext(),
+ AttributeSet::FunctionIndex, B));
Func->setAttributes(PALnew);
}
@@ -1686,9 +1687,10 @@ void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
LLVMAttribute PA) {
CallSite Call = CallSite(unwrap<Instruction>(Instr));
AttrBuilder B(PA);
- Call.setAttributes(
- Call.getAttributes().removeAttr(Call->getContext(), index,
- Attribute::get(Call->getContext(), B)));
+ Call.setAttributes(Call.getAttributes()
+ .removeAttributes(Call->getContext(), index,
+ AttributeSet::get(Call->getContext(),
+ index, B)));
}
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,