diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-09 00:28:54 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-09 00:28:54 +0000 |
commit | 060f20a0fa73d04b871e273fbf7b3e49a3e78b73 (patch) | |
tree | e4ea3df24e8abc86fd9a8ce802ea83951fb1356e /lib/VMCore | |
parent | 8831c0605bbc0c82ce56c2fb85bd681d1c013925 (diff) | |
download | external_llvm-060f20a0fa73d04b871e273fbf7b3e49a3e78b73.zip external_llvm-060f20a0fa73d04b871e273fbf7b3e49a3e78b73.tar.gz external_llvm-060f20a0fa73d04b871e273fbf7b3e49a3e78b73.tar.bz2 |
Remove more uses of the attribute enums by supplying appropriate query methods for them.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index e3cbf22..1d73268 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -342,6 +342,56 @@ void CallInst::removeAttribute(unsigned i, Attributes attr) { setAttributes(PAL); } +bool CallInst::fnHasNoAliasAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoAliasAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoAliasAttr(); + return false; +} +bool CallInst::fnHasNoInlineAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoInlineAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoInlineAttr(); + return false; +} +bool CallInst::fnHasNoReturnAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoReturnAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoReturnAttr(); + return false; +} +bool CallInst::fnHasNoUnwindAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoUnwindAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoUnwindAttr(); + return false; +} +bool CallInst::fnHasReadNoneAttr() const { + if (AttributeList.getParamAttributes(~0U).hasReadNoneAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasReadNoneAttr(); + return false; +} +bool CallInst::fnHasReadOnlyAttr() const { + if (AttributeList.getParamAttributes(~0U).hasReadOnlyAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasReadOnlyAttr(); + return false; +} +bool CallInst::fnHasReturnsTwiceAttr() const { + if (AttributeList.getParamAttributes(~0U).hasReturnsTwiceAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasReturnsTwiceAttr(); + return false; +} + bool CallInst::paramHasSExtAttr(unsigned i) const { if (AttributeList.getParamAttributes(i).hasSExtAttr()) return true; @@ -626,6 +676,56 @@ void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) { return setSuccessor(idx, B); } +bool InvokeInst::fnHasNoAliasAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoAliasAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoAliasAttr(); + return false; +} +bool InvokeInst::fnHasNoInlineAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoInlineAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoInlineAttr(); + return false; +} +bool InvokeInst::fnHasNoReturnAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoReturnAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoReturnAttr(); + return false; +} +bool InvokeInst::fnHasNoUnwindAttr() const { + if (AttributeList.getParamAttributes(~0U).hasNoUnwindAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasNoUnwindAttr(); + return false; +} +bool InvokeInst::fnHasReadNoneAttr() const { + if (AttributeList.getParamAttributes(~0U).hasReadNoneAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasReadNoneAttr(); + return false; +} +bool InvokeInst::fnHasReadOnlyAttr() const { + if (AttributeList.getParamAttributes(~0U).hasReadOnlyAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasReadOnlyAttr(); + return false; +} +bool InvokeInst::fnHasReturnsTwiceAttr() const { + if (AttributeList.getParamAttributes(~0U).hasReturnsTwiceAttr()) + return true; + if (const Function *F = getCalledFunction()) + return F->getParamAttributes(~0U).hasReturnsTwiceAttr(); + return false; +} + bool InvokeInst::paramHasSExtAttr(unsigned i) const { if (AttributeList.getParamAttributes(i).hasSExtAttr()) return true; |