Add a predicate to Argument to check for the StructRet attribute.
llvm-svn: 47248
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 47e85d7..fe3f2fe 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -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);
+}
+