diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2015-07-02 22:08:48 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-07-02 22:08:48 +0000 |
commit | 5c40eeabef402d30e77bf2f125f6170859f81eaf (patch) | |
tree | 8467b5f4cddcaeefef53cc262082f21dec80d7e4 /llvm/lib | |
parent | a68d90fa529222a155923fd294da790cbd0630ad (diff) | |
download | bcm5719-llvm-5c40eeabef402d30e77bf2f125f6170859f81eaf.tar.gz bcm5719-llvm-5c40eeabef402d30e77bf2f125f6170859f81eaf.zip |
Add functions for adding and testing string attributes to CallInst. NFC.
This change is needed later when I make changes to attach string function
attributes to llvm.trap and llvm.debugtrap.
llvm-svn: 241304
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 1e438033892..86c921aeda8 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -292,6 +292,12 @@ void CallInst::addAttribute(unsigned i, Attribute::AttrKind attr) { setAttributes(PAL); } +void CallInst::addAttribute(unsigned i, StringRef Kind, StringRef Value) { + AttributeSet PAL = getAttributes(); + PAL = PAL.addAttribute(getContext(), i, Kind, Value); + setAttributes(PAL); +} + void CallInst::removeAttribute(unsigned i, Attribute attr) { AttributeSet PAL = getAttributes(); AttrBuilder B(attr); @@ -313,14 +319,6 @@ void CallInst::addDereferenceableOrNullAttr(unsigned i, uint64_t Bytes) { setAttributes(PAL); } -bool CallInst::hasFnAttrImpl(Attribute::AttrKind A) const { - if (AttributeList.hasAttribute(AttributeSet::FunctionIndex, A)) - return true; - if (const Function *F = getCalledFunction()) - return F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, A); - return false; -} - bool CallInst::paramHasAttr(unsigned i, Attribute::AttrKind A) const { if (AttributeList.hasAttribute(i, A)) return true; |