diff options
| author | Reid Kleckner <rnk@google.com> | 2017-04-14 20:19:02 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-04-14 20:19:02 +0000 |
| commit | fb502d2f5e20eb7bd6fb95c407ff4078a530c0fe (patch) | |
| tree | ce9278d3d691404cb00cdfa0932ec36c143f6b90 /llvm/lib/Target/WebAssembly | |
| parent | 23f28e6c75f80afe8e9f3c3fe739071757df8e09 (diff) | |
| download | bcm5719-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/Target/WebAssembly')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp index 96520aa5d28..f4c9a4ef6b9 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp @@ -54,7 +54,7 @@ FunctionPass *llvm::createWebAssemblyOptimizeReturned() { void OptimizeReturned::visitCallSite(CallSite CS) { for (unsigned i = 0, e = CS.getNumArgOperands(); i < e; ++i) - if (CS.paramHasAttr(1 + i, Attribute::Returned)) { + if (CS.paramHasAttr(0, Attribute::Returned)) { Instruction *Inst = CS.getInstruction(); Value *Arg = CS.getArgOperand(i); // Ignore constants, globals, undef, etc. |

