summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-09-26 23:38:00 +0000
committerBill Wendling <isanbard@gmail.com>2012-09-26 23:38:00 +0000
commit59e6586ee00ec145be50f9eb2f71ed308fb5e60a (patch)
tree09f181a84fd73711f76bbc9e5d7691ac6f425826
parentbfc342d412724c91f87da1c3abdcf8e1dbf2db8c (diff)
downloadllvm-59e6586ee00ec145be50f9eb2f71ed308fb5e60a.tar.gz
llvm-59e6586ee00ec145be50f9eb2f71ed308fb5e60a.tar.bz2
llvm-59e6586ee00ec145be50f9eb2f71ed308fb5e60a.tar.xz
Buildbot Fix.
This method can be called with a '0' argument which checks the return value. However, the method it calls doesn't expect '0' as a valid value. Call the correct method when it's 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164735 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Function.h3
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);