summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6035518)
raw | patch | inline | side by side (parent: 6035518)
author | Juergen Ributzka <juergen@apple.com> | |
Tue, 5 Aug 2014 05:43:41 +0000 (05:43 +0000) | ||
committer | Juergen Ributzka <juergen@apple.com> | |
Tue, 5 Aug 2014 05:43:41 +0000 (05:43 +0000) |
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214843 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Argument.h | patch | blob | history | |
lib/IR/Function.cpp | patch | blob | history |
index 7c398a5e5530a8865931229d44beae49d78c00d3..dd76a90aa5ea799292882aa7ae8092495992213f 100644 (file)
/// its containing function.
bool hasInAllocaAttr() const;
+ /// \brief Return true if this argument has the zext attribute on it in its
+ /// containing function.
+ bool hasZExtAttr() const;
+
+ /// \brief Return true if this argument has the sext attribute on it in its
+ /// containing function.
+ bool hasSExtAttr() const;
+
/// \brief Add a Attribute to an argument.
void addAttr(AttributeSet AS);
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp
index de59b26ec92ae5853ac0370435ae1db6b6042f4e..f1fe6604333462a01f5b483a1243404f5212a82f 100644 (file)
--- a/lib/IR/Function.cpp
+++ b/lib/IR/Function.cpp
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 {