summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2014-03-25 17:10:58 +0000
committerJordan Rose <jordan_rose@apple.com>2014-03-25 17:10:58 +0000
commitfa9f141c711c12da0d052bc31854781d590e6b6f (patch)
treec3de635be17377aac54fd42a9a426d15d955b08a /lib/CodeGen/CGExpr.cpp
parentd13c37832fb3792e1a05352184cb7b73e9fc8a93 (diff)
downloadclang-fa9f141c711c12da0d052bc31854781d590e6b6f.tar.gz
clang-fa9f141c711c12da0d052bc31854781d590e6b6f.tar.bz2
clang-fa9f141c711c12da0d052bc31854781d590e6b6f.tar.xz
[analyzer] Don't track retain counts of objects directly accessed through ivars.
A refinement of r198953 to handle cases where an object is accessed both through a property getter and through direct ivar access. An object accessed through a property should always be treated as +0, i.e. not owned by the caller. However, an object accessed through an ivar may be at +0 or at +1, depending on whether the ivar is a strong reference. Outside of ARC, we don't have that information, so we just don't track objects accessed through ivars. With this change, accessing an ivar directly will deliberately override the +0 provided by a getter, but only if the +0 hasn't participated in other retain counting yet. That isn't perfect, but it's already unusual for people to be mixing property access with direct ivar access. (The primary use case for this is in setters, init methods, and -dealloc.) Thanks to Ted for spotting a few mistakes in private review. <rdar://problem/16333368> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions