diff options
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r-- | include/llvm/Function.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 907b14f599..fa6d0d3f5b 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -278,7 +278,8 @@ public: /// @brief Determine if the parameter does not alias other parameters. /// @param n The parameter to check. 1 is the first parameter, 0 is the return bool doesNotAlias(unsigned n) const { - return getParamAttributes(n).hasNoAliasAttr(); + return n != 0 ? getParamAttributes(n).hasNoAliasAttr() : + AttributeList.getRetAttributes().hasNoAliasAttr(); } void setDoesNotAlias(unsigned n, bool DoesNotAlias = true) { if (DoesNotAlias) addAttribute(n, Attribute::NoAlias); |