summaryrefslogtreecommitdiff
path: root/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-22 21:15:51 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-22 21:15:51 +0000
commitdefaca00b8087d452df2b783250a48a32658a910 (patch)
treedcc4e29343864e54bcfd33035512ca7d6e2bef74 /lib/IR/Core.cpp
parent5de048ec30f9ef9f56c89f9fdb50022beca6ae88 (diff)
downloadllvm-defaca00b8087d452df2b783250a48a32658a910.tar.gz
llvm-defaca00b8087d452df2b783250a48a32658a910.tar.bz2
llvm-defaca00b8087d452df2b783250a48a32658a910.tar.xz
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
Diffstat (limited to 'lib/IR/Core.cpp')
-rw-r--r--lib/IR/Core.cpp16
1 files changed, 10 insertions, 6 deletions
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<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) ..............................--*/