diff options
author | Amaury Sechet <deadalnix@gmail.com> | 2016-04-21 21:29:10 +0000 |
---|---|---|
committer | Amaury Sechet <deadalnix@gmail.com> | 2016-04-21 21:29:10 +0000 |
commit | 1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f (patch) | |
tree | 5c60610f058cba60d2aa4aa71d1834432a45a5ff /llvm/include | |
parent | 6e295f230498a9ad3dbdb3d6d2f7f6453915c533 (diff) | |
download | bcm5719-llvm-1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f.tar.gz bcm5719-llvm-1a0e0978b4b6a2be5ce705c5d2d35bb3860f7d5f.zip |
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/include')
-rw-r--r-- | llvm/include/llvm/IR/CallSite.h | 16 | ||||
-rw-r--r-- | llvm/include/llvm/IR/Instructions.h | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/CallSite.h b/llvm/include/llvm/IR/CallSite.h index 2bd836fd794..ad66cfbfaad 100644 --- a/llvm/include/llvm/IR/CallSite.h +++ b/llvm/include/llvm/IR/CallSite.h @@ -305,6 +305,22 @@ public: CALLSITE_DELEGATE_SETTER(setAttributes(PAL)); } + void addAttribute(unsigned i, Attribute::AttrKind attr) { + CALLSITE_DELEGATE_SETTER(addAttribute(i, attr)); + } + + void addAttribute(unsigned i, StringRef Kind, StringRef Value) { + CALLSITE_DELEGATE_SETTER(addAttribute(i, Kind, Value)); + } + + void removeAttribute(unsigned i, Attribute::AttrKind attr) { + CALLSITE_DELEGATE_SETTER(removeAttribute(i, attr)); + } + + void removeAttribute(unsigned i, Attribute attr) { + CALLSITE_DELEGATE_SETTER(removeAttribute(i, attr)); + } + /// \brief Return true if this function has the given attribute. bool hasFnAttr(Attribute::AttrKind A) const { CALLSITE_DELEGATE_GETTER(hasFnAttr(A)); diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h index 19ea3464a10..63175ed8b3f 100644 --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -1604,6 +1604,9 @@ public: void addAttribute(unsigned i, StringRef Kind, StringRef Value); /// removeAttribute - removes the attribute from the list of attributes. + void removeAttribute(unsigned i, Attribute::AttrKind attr); + + /// removeAttribute - removes the attribute from the list of attributes. void removeAttribute(unsigned i, Attribute attr); /// \brief adds the dereferenceable attribute to the list of attributes. @@ -3542,6 +3545,9 @@ public: void addAttribute(unsigned i, Attribute::AttrKind attr); /// removeAttribute - removes the attribute from the list of attributes. + void removeAttribute(unsigned i, Attribute::AttrKind attr); + + /// removeAttribute - removes the attribute from the list of attributes. void removeAttribute(unsigned i, Attribute attr); /// \brief adds the dereferenceable attribute to the list of attributes. |