diff options
author | Devin Coughlin <dcoughlin@apple.com> | 2016-02-18 19:37:39 +0000 |
---|---|---|
committer | Devin Coughlin <dcoughlin@apple.com> | 2016-02-18 19:37:39 +0000 |
commit | ef3697e093deac22f8207d96ce2c6d978f721ff9 (patch) | |
tree | 2cb3e3489991ef0d9e8c8502bd1c28bafef3fc8c /clang/lib/Analysis/BodyFarm.cpp | |
parent | 4152f522aa1c9a5f1c36465e06f306934bc9afba (diff) | |
download | bcm5719-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.cpp | 8 |
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; |