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 | 8246df61f6de716acf1f8c64fac3c19970a2c174 (patch) | |
tree | eea5feb78eb13d53687b1211b304c2388ef2f63c /lib/IR/Core.cpp | |
parent | 4d79724e130e69e3ce6327680460f399c18cb7eb (diff) | |
download | llvm-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.cpp | 12 |
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, |