From defaca00b8087d452df2b783250a48a32658a910 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 22 Jan 2013 21:15:51 +0000 Subject: More encapsulation work. Use the AttributeSet when we're talking about more than one attribute. Add a function that adds a single attribute. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173196 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Core.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/IR/Core.cpp') diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index 12cb971af8..e72eb69982 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -1383,8 +1383,9 @@ void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) { const AttributeSet PAL = Func->getAttributes(); AttrBuilder B(PA); const AttributeSet PALnew = - PAL.addAttr(Func->getContext(), AttributeSet::FunctionIndex, - Attribute::get(Func->getContext(), B)); + PAL.addFnAttributes(Func->getContext(), + AttributeSet::get(Func->getContext(), + AttributeSet::FunctionIndex, B)); Func->setAttributes(PALnew); } @@ -1676,8 +1677,9 @@ void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index, CallSite Call = CallSite(unwrap(Instr)); AttrBuilder B(PA); Call.setAttributes( - Call.getAttributes().addAttr(Call->getContext(), index, - Attribute::get(Call->getContext(), B))); + Call.getAttributes().addAttributes(Call->getContext(), index, + AttributeSet::get(Call->getContext(), + index, B))); } void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index, @@ -1694,8 +1696,10 @@ void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, CallSite Call = CallSite(unwrap(Instr)); AttrBuilder B; B.addAlignmentAttr(align); - Call.setAttributes(Call.getAttributes().addAttr(Call->getContext(), index, - Attribute::get(Call->getContext(), B))); + Call.setAttributes(Call.getAttributes() + .addAttributes(Call->getContext(), index, + AttributeSet::get(Call->getContext(), + index, B))); } /*--.. Operations on call instructions (only) ..............................--*/ -- cgit v1.2.3