[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
This commit is contained in:
Devin Coughlin 2016-02-18 19:37:39 +00:00
parent 4152f522aa
commit ef3697e093
1 changed files with 8 additions and 0 deletions

View File

@ -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;