]> granicus.if.org Git - clang/commit
[analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead of -release.
authorDevin Coughlin <dcoughlin@apple.com>
Fri, 4 Mar 2016 18:09:58 +0000 (18:09 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Fri, 4 Mar 2016 18:09:58 +0000 (18:09 +0000)
commit0c35e452895ad039178f3a19e90a1c36b4554749
treebbc64d6c8356319e5f83bbaf0c3701db72f7deee
parente0bd794efa508ad8b2c7a95f6f7091c9cbe54593
[analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead of -release.

In dealloc methods, the analyzer now warns when -dealloc is called directly on
a synthesized retain/copy ivar instead of -release. This is intended to find mistakes of
the form:

- (void)dealloc {
  [_ivar dealloc]; // Mistaken call to -dealloc instead of -release

  [super dealloc];
}

rdar://problem/16227989

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262729 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp
test/Analysis/DeallocMissingRelease.m