diff options
author | Owen Anderson <resistor@mac.com> | 2008-02-17 23:22:28 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-02-17 23:22:28 +0000 |
commit | 827010c4c5834d9d519edb64bea6b9bc33631142 (patch) | |
tree | 53b669d1179755efa73b8b93f17cd6b07bfaedad /lib/VMCore | |
parent | 37f3ffb181176c614762f755c3a4f0ef2d842462 (diff) | |
download | external_llvm-827010c4c5834d9d519edb64bea6b9bc33631142.zip external_llvm-827010c4c5834d9d519edb64bea6b9bc33631142.tar.gz external_llvm-827010c4c5834d9d519edb64bea6b9bc33631142.tar.bz2 |
Add a predicate to Argument to check for the StructRet attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Function.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 47e85d7..fe3f2fe 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -103,6 +103,13 @@ bool Argument::hasNoAliasAttr() const { return getParent()->paramHasAttr(getArgNo()+1, ParamAttr::NoAlias); } +/// hasSRetAttr - Return true if this argument has the sret attribute on +/// it in its containing function. +bool Argument::hasStructRetAttr() const { + if (!isa<PointerType>(getType())) return false; + return getParent()->paramHasAttr(getArgNo()+1, ParamAttr::StructRet); +} + |