[PATCH] D68108: Redeclare Objective-C property accessors inside the ObjCImplDecl in which they are synthesized.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 18:15:18 PDT 2019


NoQ edited reviewers, added: NoQ; removed: dergachev.a.
NoQ added inline comments.


================
Comment at: clang/test/Analysis/Inputs/expected-plists/nullability-notes.m.plist:191
    <array>
-    <integer>10</integer>
     <integer>14</integer>
----------------
It looks like the body farm for the property accessor has stopped working here. The code under analysis (from `test/Analysis/nullability-notes.m`) is:
```lang=objc
     7	void takesNonnull(NSObject *_Nonnull y);
     8
     9	@interface ClassWithProperties: NSObject
    10	@property(copy, nullable) NSObject *x; // plist check ensures no control flow piece from here to 'self.x'.
    11	-(void) method;
    12	@end;
    13	@implementation ClassWithProperties
    14	-(void) method {
    15	  // no-crash
    16	  NSObject *x = self.x; // expected-note{{Nullability 'nullable' is inferred}}
    17	  takesNonnull(x); // expected-warning{{Nullable pointer is passed to a callee that requires a non-null 1st parameter}}
    18	                   // expected-note at -1{{Nullable pointer is passed to a callee that requires a non-null 1st parameter}}
    19	}
    20	@end
```
The point of the test is to check how control flow is displayed to the user, and //this// change in the plist file will not really be visible to the user. However i'm worried that we've lost precision of the analysis on similar examples. I'll double-check.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68108/new/

https://reviews.llvm.org/D68108





More information about the cfe-commits mailing list