summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-04-14 20:19:02 +0000
committerReid Kleckner <rnk@google.com>2017-04-14 20:19:02 +0000
commitfb502d2f5e20eb7bd6fb95c407ff4078a530c0fe (patch)
treece9278d3d691404cb00cdfa0932ec36c143f6b90 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp
parent23f28e6c75f80afe8e9f3c3fe739071757df8e09 (diff)
downloadbcm5719-llvm-fb502d2f5e20eb7bd6fb95c407ff4078a530c0fe.tar.gz
bcm5719-llvm-fb502d2f5e20eb7bd6fb95c407ff4078a530c0fe.zip
[IR] Make paramHasAttr to use arg indices instead of attr indices
This avoids the confusing 'CS.paramHasAttr(ArgNo + 1, Foo)' pattern. Previously we were testing return value attributes with index 0, so I introduced hasReturnAttr() for that use case. llvm-svn: 300367
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index 80fea977f40..4d13b3f4068 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -828,7 +828,7 @@ static bool isFunctionMallocLike(Function *F, const SCCNodeSet &SCCNodes) {
case Instruction::Call:
case Instruction::Invoke: {
CallSite CS(RVI);
- if (CS.paramHasAttr(0, Attribute::NoAlias))
+ if (CS.hasRetAttr(Attribute::NoAlias))
break;
if (CS.getCalledFunction() && SCCNodes.count(CS.getCalledFunction()))
break;
OpenPOWER on IntegriCloud