diff options
| author | Bill Wendling <isanbard@gmail.com> | 2012-10-03 17:54:26 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2012-10-03 17:54:26 +0000 |
| commit | 8baa61d85d3faa05882e5a6b45bcc11c78f60d40 (patch) | |
| tree | a5db4351f1c5ed8d142a0f6774055847e10f7f09 /llvm/include | |
| parent | 53fefd1f6a19971509ae9440f6a66e56d08e736b (diff) | |
| download | bcm5719-llvm-8baa61d85d3faa05882e5a6b45bcc11c78f60d40.tar.gz bcm5719-llvm-8baa61d85d3faa05882e5a6b45bcc11c78f60d40.zip | |
Add methods which query for the specific attribute instead of using the
enums. This allows for better encapsulation of the Attributes class.
llvm-svn: 165132
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Instructions.h | 16 | ||||
| -rw-r--r-- | llvm/include/llvm/Support/CallSite.h | 20 |
2 files changed, 36 insertions, 0 deletions
diff --git a/llvm/include/llvm/Instructions.h b/llvm/include/llvm/Instructions.h index 7a0379e371b..a607c84c5bc 100644 --- a/llvm/include/llvm/Instructions.h +++ b/llvm/include/llvm/Instructions.h @@ -1272,6 +1272,14 @@ public: return paramHasAttr(~0, N); } + /// @brief Determine whether the call or the callee has the given attributes. + bool paramHasSExtAttr(unsigned i) const; + bool paramHasZExtAttr(unsigned i) const; + bool paramHasInRegAttr(unsigned i) const; + bool paramHasStructRetAttr(unsigned i) const; + bool paramHasNestAttr(unsigned i) const; + bool paramHasByValAttr(unsigned i) const; + /// @brief Determine whether the call or the callee has the given attribute. bool paramHasAttr(unsigned i, Attributes attr) const; @@ -3034,6 +3042,14 @@ public: return paramHasAttr(~0, N); } + /// @brief Determine whether the call or the callee has the given attributes. + bool paramHasSExtAttr(unsigned i) const; + bool paramHasZExtAttr(unsigned i) const; + bool paramHasInRegAttr(unsigned i) const; + bool paramHasStructRetAttr(unsigned i) const; + bool paramHasNestAttr(unsigned i) const; + bool paramHasByValAttr(unsigned i) const; + /// @brief Determine whether the call or the callee has the given attribute. bool paramHasAttr(unsigned i, Attributes attr) const; diff --git a/llvm/include/llvm/Support/CallSite.h b/llvm/include/llvm/Support/CallSite.h index 8905e1e33b7..3e1a2f58227 100644 --- a/llvm/include/llvm/Support/CallSite.h +++ b/llvm/include/llvm/Support/CallSite.h @@ -189,6 +189,26 @@ public: CALLSITE_DELEGATE_GETTER(hasFnAttr(N)); } + /// paramHas*Attr - whether the call or the callee has the given attribute. + bool paramHasSExtAttr(unsigned i) const { + CALLSITE_DELEGATE_GETTER(paramHasSExtAttr(i)); + } + bool paramHasZExtAttr(unsigned i) const { + CALLSITE_DELEGATE_GETTER(paramHasZExtAttr(i)); + } + bool paramHasInRegAttr(unsigned i) const { + CALLSITE_DELEGATE_GETTER(paramHasInRegAttr(i)); + } + bool paramHasStructRetAttr(unsigned i) const { + CALLSITE_DELEGATE_GETTER(paramHasStructRetAttr(i)); + } + bool paramHasNestAttr(unsigned i) const { + CALLSITE_DELEGATE_GETTER(paramHasNestAttr(i)); + } + bool paramHasByValAttr(unsigned i) const { + CALLSITE_DELEGATE_GETTER(paramHasByValAttr(i)); + } + /// paramHasAttr - whether the call or the callee has the given attribute. bool paramHasAttr(uint16_t i, Attributes attr) const { CALLSITE_DELEGATE_GETTER(paramHasAttr(i, attr)); |

