summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Argument.h4
-rw-r--r--llvm/lib/VMCore/Function.cpp7
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/include/llvm/Argument.h b/llvm/include/llvm/Argument.h
index 3a846c28994..ca54f48c36f 100644
--- a/llvm/include/llvm/Argument.h
+++ b/llvm/include/llvm/Argument.h
@@ -51,6 +51,10 @@ public:
/// in its containing function.
bool hasByValAttr() const;
+ /// hasNestAttr - Return true if this argument has the nest attribute on
+ /// it in its containing function.
+ bool hasNestAttr() const;
+
/// hasNoAliasAttr - Return true if this argument has the noalias attribute on
/// it in its containing function.
bool hasNoAliasAttr() const;
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 6cf2c8186f9..88e1fe8ae4f 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -77,6 +77,13 @@ bool Argument::hasByValAttr() const {
return getParent()->paramHasAttr(getArgNo()+1, Attribute::ByVal);
}
+/// hasNestAttr - Return true if this argument has the nest attribute on
+/// it in its containing function.
+bool Argument::hasNestAttr() const {
+ if (!isa<PointerType>(getType())) return false;
+ return getParent()->paramHasAttr(getArgNo()+1, Attribute::Nest);
+}
+
/// hasNoAliasAttr - Return true if this argument has the noalias attribute on
/// it in its containing function.
bool Argument::hasNoAliasAttr() const {
OpenPOWER on IntegriCloud