[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-07 Thread Erik Pilkington via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. erik.pilkington marked an inline comment as done. Closed by commit rG7437a9496528: [SemaObjC] Add a warning for @selector expressions that

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-07 Thread Erik Pilkington via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7437a9496528: [SemaObjC] Add a warning for @selector expressions that potentially refer to… (authored by erik.pilkington). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-06 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. In D82611#2133521 , @erik.pilkington wrote: > In D82611#2125868 , @MadCoder wrote: > > > > >> I would suggest something like `-Wstrict-direct-dispatch` or something. > > I kinda

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. In D82611#2125868 , @MadCoder wrote: > So the risk with that one is that if someone had say the `-didSomething` > direct selector and that some UIKit/Apple SDK API now adds this as a thing > that you use with

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-06 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 275759. erik.pilkington marked 3 inline comments as done. erik.pilkington added a comment. Add an off-by-default variant of this warning. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82611/new/ https://reviews.llvm.org/D82611 Files:

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-01 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added a comment. So the risk with that one is that if someone had say the `-didSomething` direct selector and that some UIKit/Apple SDK API now adds this as a thing that you use with CFNotification center for example, where you _need_ dynamism, then the uses of the API would warn all

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-01 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/lib/Sema/SemaExprObjC.cpp:1230 } - -static void HelperToDiagnoseDirectSelectorsExpr(Sema , SourceLocation AtLoc, -Selector Sel, +static void

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-07-01 Thread Pierre Habouzit via Phabricator via cfe-commits
MadCoder added inline comments. Comment at: clang/test/SemaObjC/potentially-direct-selector.m:84 + (void)@selector(inBaseCat); + (void)@selector(inBaseCatImpl); + (void)@selector(inDerived); I think this might be too weak, if we add a warning then maybe what

[PATCH] D82611: [SemaObjC] Add a warning for @selector expressions that potentially refer to objc_direct methods

2020-06-25 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: rjmccall, MadCoder. Herald added subscribers: ributzka, dexonsmith, jkorous. As a heuristic, only warn if the selector matches a method declared in the current interface. rdar://64621668 https://reviews.llvm.org/D82611