[llvm-commits] [llvm] r91109 - in /llvm/trunk: include/llvm/Argument.h lib/VMCore/Function.cpp
Duncan Sands
baldrick at free.fr
Fri Dec 11 00:36:18 PST 2009
Author: baldrick
Date: Fri Dec 11 02:36:17 2009
New Revision: 91109
URL: http://llvm.org/viewvc/llvm-project?rev=91109&view=rev
Log:
Add utility method for determining whether a function argument
has the 'nest' attribute.
Modified:
llvm/trunk/include/llvm/Argument.h
llvm/trunk/lib/VMCore/Function.cpp
Modified: llvm/trunk/include/llvm/Argument.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Argument.h?rev=91109&r1=91108&r2=91109&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Argument.h (original)
+++ llvm/trunk/include/llvm/Argument.h Fri Dec 11 02:36:17 2009
@@ -51,6 +51,10 @@
/// 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;
Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=91109&r1=91108&r2=91109&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Fri Dec 11 02:36:17 2009
@@ -77,6 +77,13 @@
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 {
More information about the llvm-commits
mailing list