summaryrefslogtreecommitdiff
path: root/lib/IR/Instructions.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/Instructions.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/Instructions.cpp')
-rw-r--r--lib/IR/Instructions.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp
index 8597d5c452..8a0a465a96 100644
--- a/lib/IR/Instructions.cpp
+++ b/lib/IR/Instructions.cpp
@@ -334,14 +334,18 @@ CallInst::CallInst(const CallInst &CI)
void CallInst::addAttribute(unsigned i, Attribute attr) {
AttributeSet PAL = getAttributes();
AttrBuilder B(attr);
- PAL = PAL.addAttributes(getContext(), i,
- AttributeSet::get(getContext(), i, B));
+ LLVMContext &Context = getContext();
+ PAL = PAL.addAttributes(Context, i,
+ AttributeSet::get(Context, i, B));
setAttributes(PAL);
}
void CallInst::removeAttribute(unsigned i, Attribute attr) {
AttributeSet PAL = getAttributes();
- PAL = PAL.removeAttr(getContext(), i, attr);
+ AttrBuilder B(attr);
+ LLVMContext &Context = getContext();
+ PAL = PAL.removeAttributes(Context, i,
+ AttributeSet::get(Context, i, B));
setAttributes(PAL);
}
@@ -599,7 +603,9 @@ void InvokeInst::addAttribute(unsigned i, Attribute attr) {
void InvokeInst::removeAttribute(unsigned i, Attribute attr) {
AttributeSet PAL = getAttributes();
- PAL = PAL.removeAttr(getContext(), i, attr);
+ AttrBuilder B(attr);
+ PAL = PAL.removeAttributes(getContext(), i,
+ AttributeSet::get(getContext(), i, B));
setAttributes(PAL);
}