summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BodyFarm.cpp
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-02-18 19:37:39 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-02-18 19:37:39 +0000
commitef3697e093deac22f8207d96ce2c6d978f721ff9 (patch)
tree2cb3e3489991ef0d9e8c8502bd1c28bafef3fc8c /clang/lib/Analysis/BodyFarm.cpp
parent4152f522aa1c9a5f1c36465e06f306934bc9afba (diff)
downloadbcm5719-llvm-ef3697e093deac22f8207d96ce2c6d978f721ff9.tar.gz
bcm5719-llvm-ef3697e093deac22f8207d96ce2c6d978f721ff9.zip
[analyzer] Include comment mistakenly left out of r261243. NFC.
It explains why we can't just synthesize bodies of setters in BodyFarm. llvm-svn: 261248
Diffstat (limited to 'clang/lib/Analysis/BodyFarm.cpp')
-rw-r--r--clang/lib/Analysis/BodyFarm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Analysis/BodyFarm.cpp b/clang/lib/Analysis/BodyFarm.cpp
index 2118301362e..d8b652f68e8 100644
--- a/clang/lib/Analysis/BodyFarm.cpp
+++ b/clang/lib/Analysis/BodyFarm.cpp
@@ -498,6 +498,14 @@ Stmt *BodyFarm::getBody(const ObjCMethodDecl *D) {
return nullptr;
// For now, we only synthesize getters.
+ // Synthesizing setters would cause false negatives in the
+ // RetainCountChecker because the method body would bind the parameter
+ // to an instance variable, causing it to escape. This would prevent
+ // warning in the following common scenario:
+ //
+ // id foo = [[NSObject alloc] init];
+ // self.foo = foo; // We should warn that foo leaks here.
+ //
if (D->param_size() != 0)
return nullptr;
OpenPOWER on IntegriCloud