OSDN Git Service

[Lint] Don't warn about passing alloca'd value to tail call if using byval
authorMikael Holmen <mikael.holmen@ericsson.com>
Wed, 15 Nov 2017 07:46:48 +0000 (07:46 +0000)
committerMikael Holmen <mikael.holmen@ericsson.com>
Wed, 15 Nov 2017 07:46:48 +0000 (07:46 +0000)
commitc14b5c3b1e74405b22e62df4483c142de0487d0d
treec002cabe87bdf19af7689181bae35764aeeee8e7
parent8aebe5139f44a2a35f8d0dc34f67d2892c4bb4bc
[Lint] Don't warn about passing alloca'd value to tail call if using byval

Summary:
This fixes PR35241.

When using byval, the data is effectively copied as part of the call
anyway, so the pointer returned by the alloca will not be leaked to the
callee and thus there is no reason to issue a warning.

Reviewers: rnk

Reviewed By: rnk

Subscribers: Ka-Ka, llvm-commits

Differential Revision: https://reviews.llvm.org/D40009

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318279 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/Lint.cpp
test/Analysis/Lint/tail-call-byval.ll [new file with mode: 0644]