Author: resistor Date: Sun Feb 17 17:22:28 2008 New Revision: 47248 URL: http://llvm.org/viewvc/llvm-project?rev=47248&view=rev Log: Add a predicate to Argument to check for the StructRet 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=47248&r1=47247&r2=47248&view=diff ============================================================================== --- llvm/trunk/include/llvm/Argument.h (original) +++ llvm/trunk/include/llvm/Argument.h Sun Feb 17 17:22:28 2008 @@ -57,6 +57,10 @@ /// it in its containing function. bool hasNoAliasAttr() const; + /// hasSRetAttr - Return true if this argument has the sret attribute on it in + /// its containing function. + bool hasStructRetAttr() const; + virtual void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); Modified: llvm/trunk/lib/VMCore/Function.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=47248&r1=47247&r2=47248&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Function.cpp (original) +++ llvm/trunk/lib/VMCore/Function.cpp Sun Feb 17 17:22:28 2008 @@ -103,6 +103,13 @@ 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); +} + _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits