Add utility method for determining whether a function argument

has the 'nest' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2009-12-11 08:36:17 +00:00
parent 50d070561e
commit be1ce0a867
2 changed files with 11 additions and 0 deletions

View File

@ -51,6 +51,10 @@ public:
/// in its containing function. /// in its containing function.
bool hasByValAttr() const; 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 /// hasNoAliasAttr - Return true if this argument has the noalias attribute on
/// it in its containing function. /// it in its containing function.
bool hasNoAliasAttr() const; bool hasNoAliasAttr() const;

View File

@ -77,6 +77,13 @@ bool Argument::hasByValAttr() const {
return getParent()->paramHasAttr(getArgNo()+1, Attribute::ByVal); 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 /// hasNoAliasAttr - Return true if this argument has the noalias attribute on
/// it in its containing function. /// it in its containing function.
bool Argument::hasNoAliasAttr() const { bool Argument::hasNoAliasAttr() const {