aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2016-04-21 21:29:10 +0000
committerAmaury Sechet <deadalnix@gmail.com>2016-04-21 21:29:10 +0000
commit1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f (patch)
tree5c60610f058cba60d2aa4aa71d1834432a45a5ff /llvm/lib/IR/Instructions.cpp
parent6e295f230498a9ad3dbdb3d6d2f7f6453915c533 (diff)
downloadllvm-1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f.zip
llvm-1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f.tar.gz
llvm-1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f.tar.bz2
Add utility function to manipulate attributes on CallSite. NFC
Summary: As per title. This will help work on the C API. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19173 llvm-svn: 267057
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 4f2fbee..65703d1 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -343,6 +343,12 @@ void CallInst::addAttribute(unsigned i, StringRef Kind, StringRef Value) {
setAttributes(PAL);
}
+void CallInst::removeAttribute(unsigned i, Attribute::AttrKind attr) {
+ AttributeSet PAL = getAttributes();
+ PAL = PAL.removeAttribute(getContext(), i, attr);
+ setAttributes(PAL);
+}
+
void CallInst::removeAttribute(unsigned i, Attribute attr) {
AttributeSet PAL = getAttributes();
AttrBuilder B(attr);
@@ -663,6 +669,12 @@ void InvokeInst::addAttribute(unsigned i, Attribute::AttrKind attr) {
setAttributes(PAL);
}
+void InvokeInst::removeAttribute(unsigned i, Attribute::AttrKind attr) {
+ AttributeSet PAL = getAttributes();
+ PAL = PAL.removeAttribute(getContext(), i, attr);
+ setAttributes(PAL);
+}
+
void InvokeInst::removeAttribute(unsigned i, Attribute attr) {
AttributeSet PAL = getAttributes();
AttrBuilder B(attr);