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/Analysis/InlineCost.cpp | |
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/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index cd85ef3703f..2ad32a639b8 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -583,8 +583,7 @@ bool CallAnalyzer::visitUnaryInstruction(UnaryInstruction &I) { } bool CallAnalyzer::paramHasAttr(Argument *A, Attribute::AttrKind Attr) { - unsigned ArgNo = A->getArgNo(); - return CandidateCS.paramHasAttr(ArgNo + 1, Attr); + return CandidateCS.paramHasAttr(A->getArgNo(), Attr); } bool CallAnalyzer::isKnownNonNullInCallee(Value *V) { |