summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-08-05 05:43:41 +0000
committerJuergen Ributzka <juergen@apple.com>2014-08-05 05:43:41 +0000
commit384c3b5c03bc449eed93ac5fc6933c6c8328974f (patch)
treeb9e08c8440678bb894e18f2dbb07fceae1fe082d /llvm/lib/IR/Function.cpp
parentfc6de428c8ab10330e1b00c6541503cfd98a9cca (diff)
downloadbcm5719-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.cpp14
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 {
OpenPOWER on IntegriCloud