diff options
author | Amaury Sechet <deadalnix@gmail.com> | 2016-06-15 05:14:29 +0000 |
---|---|---|
committer | Amaury Sechet <deadalnix@gmail.com> | 2016-06-15 05:14:29 +0000 |
commit | a65a237805d8c5a995bb15ed31bdeacbab401489 (patch) | |
tree | 95147eef29f4ad6207378b24ac627f534326f39b /llvm/lib/IR/Instructions.cpp | |
parent | 0e392d5dd7fbc70d90cb11525aceaa2977d63583 (diff) | |
download | bcm5719-llvm-a65a237805d8c5a995bb15ed31bdeacbab401489.tar.gz bcm5719-llvm-a65a237805d8c5a995bb15ed31bdeacbab401489.zip |
Add support for callsite in the new C API for attributes
Summary: The second consumer of attributes.
Reviewers: Wallbraker, whitequark, echristo, rafael, jyknight
Subscribers: mehdi_amini
Differential Revision: http://reviews.llvm.org/D21266
llvm-svn: 272754
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 01d180e4abe..98d37074b4a 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::addAttribute(unsigned i, Attribute Attr) { + AttributeSet PAL = getAttributes(); + PAL = PAL.addAttribute(getContext(), i, Attr); + setAttributes(PAL); +} + void CallInst::removeAttribute(unsigned i, Attribute::AttrKind Kind) { AttributeSet PAL = getAttributes(); PAL = PAL.removeAttribute(getContext(), i, Kind); @@ -380,6 +386,10 @@ bool CallInst::paramHasAttr(unsigned i, Attribute::AttrKind Kind) const { return false; } +Attribute CallInst::getAttribute(unsigned i, Attribute::AttrKind Kind) const { + return getAttributes().getAttribute(i, Kind); +} + bool CallInst::dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind Kind) const { // There are getNumOperands() - 1 data operands. The last operand is the @@ -702,6 +712,12 @@ void InvokeInst::addAttribute(unsigned i, Attribute::AttrKind Kind) { setAttributes(PAL); } +void InvokeInst::addAttribute(unsigned i, Attribute Attr) { + AttributeSet PAL = getAttributes(); + PAL = PAL.addAttribute(getContext(), i, Attr); + setAttributes(PAL); +} + void InvokeInst::removeAttribute(unsigned i, Attribute::AttrKind Kind) { AttributeSet PAL = getAttributes(); PAL = PAL.removeAttribute(getContext(), i, Kind); @@ -716,6 +732,11 @@ void InvokeInst::removeAttribute(unsigned i, Attribute Attr) { setAttributes(PAL); } +Attribute InvokeInst::getAttribute(unsigned i, + Attribute::AttrKind Kind) const { + return getAttributes().getAttribute(i, Kind); +} + void InvokeInst::addDereferenceableAttr(unsigned i, uint64_t Bytes) { AttributeSet PAL = getAttributes(); PAL = PAL.addDereferenceableAttr(getContext(), i, Bytes); |