diff options
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r-- | include/llvm/Function.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 897e53b0a2..627b47f9d9 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -21,6 +21,7 @@ #include "llvm/GlobalValue.h" #include "llvm/BasicBlock.h" #include "llvm/Argument.h" +#include "llvm/ParameterAttributes.h" #include "llvm/Support/Annotation.h" namespace llvm { @@ -152,8 +153,15 @@ public: /// @brief Set the parameter attributes. void setParamAttrs(const ParamAttrsList *attrs); + /// @brief Determine whether the function has the given attribute. + bool paramHasAttr(uint16_t i, ParameterAttributes attr) const { + return ParamAttrs && ParamAttrs->paramHasAttr(i, attr); + } + /// @brief Determine if the function returns a structure. - bool isStructReturn() const; + bool isStructReturn() const { + return paramHasAttr(1, ParamAttr::StructRet); + } /// deleteBody - This method deletes the body of the function, and converts /// the linkage to external. |