[analyzer] Add annotation attribute to trust retain count implementation
authorDevin Coughlin <dcoughlin@apple.com>
Wed, 19 Jul 2017 04:10:44 +0000 (04:10 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Wed, 19 Jul 2017 04:10:44 +0000 (04:10 +0000)
commitd05132d21feabe6647727a6b028ec1b424ae1953
treec778998fa8c1e356313c9f5ac76ad419cb01a42c
parent0bfdbc67082f42b5f15c5232070eb9be9887337a
[analyzer] Add annotation attribute to trust retain count implementation

Add support to the retain-count checker for an annotation indicating that a
function's implementation should be trusted by the retain count checker.
Functions with these attributes will not be inlined and the arguments will
be treating as escaping.

Adding this annotation avoids spurious diagnostics when the implementation of
a reference counting operation is visible but the analyzer can't reason
precisely about the ref count.

Patch by Malhar Thakkar!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308416 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
test/Analysis/retain-release-inline.m