diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-22 21:15:51 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-22 21:15:51 +0000 |
commit | 09175b39f2e9c81fe07efc0187e8b5b372c9796e (patch) | |
tree | bc0c984f737e8525fd15114a7dfe8d06a5f47ba5 /llvm/lib/IR/Core.cpp | |
parent | 0017d8a4691e99ba1e15c351938f023ede03115e (diff) | |
download | bcm5719-llvm-09175b39f2e9c81fe07efc0187e8b5b372c9796e.tar.gz bcm5719-llvm-09175b39f2e9c81fe07efc0187e8b5b372c9796e.zip |
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.
llvm-svn: 173196
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 12cb971af89..e72eb699824 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/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<Instruction>(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<Instruction>(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) ..............................--*/ |