diff options
| author | Juergen Ributzka <juergen@apple.com> | 2014-08-05 05:43:41 +0000 |
|---|---|---|
| committer | Juergen Ributzka <juergen@apple.com> | 2014-08-05 05:43:41 +0000 |
| commit | 384c3b5c03bc449eed93ac5fc6933c6c8328974f (patch) | |
| tree | b9e08c8440678bb894e18f2dbb07fceae1fe082d /llvm/lib/IR/Function.cpp | |
| parent | fc6de428c8ab10330e1b00c6541503cfd98a9cca (diff) | |
| download | bcm5719-llvm-384c3b5c03bc449eed93ac5fc6933c6c8328974f.tar.gz bcm5719-llvm-384c3b5c03bc449eed93ac5fc6933c6c8328974f.zip | |
Provide convenient access to the zext/sext attributes of function arguments. NFC.
llvm-svn: 214843
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
| -rw-r--r-- | llvm/lib/IR/Function.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index de59b26ec92..f1fe6604333 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -166,6 +166,20 @@ bool Argument::hasReturnedAttr() const { hasAttribute(getArgNo()+1, Attribute::Returned); } +/// hasZExtAttr - Return true if this argument has the zext attribute on it in +/// its containing function. +bool Argument::hasZExtAttr() const { + return getParent()->getAttributes(). + hasAttribute(getArgNo()+1, Attribute::ZExt); +} + +/// hasSExtAttr Return true if this argument has the sext attribute on it in its +/// containing function. +bool Argument::hasSExtAttr() const { + return getParent()->getAttributes(). + hasAttribute(getArgNo()+1, Attribute::SExt); +} + /// Return true if this argument has the readonly or readnone attribute on it /// in its containing function. bool Argument::onlyReadsMemory() const { |

