[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-22 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL303562: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong… (authored by epilk). Changed prior to commit: https://reviews.llvm.org/D33250?vs=99605=99772#toc Repository:

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-22 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman accepted this revision. arphaman added a comment. This revision is now accepted and ready to land. LGTM with one change below: Comment at: lib/Sema/SemaDeclAttr.cpp:7256 + bool VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *PRE) { +if (ObjCInterfaceDecl *ID =

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-19 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 99605. erik.pilkington added a comment. > Can we ignore the TypeLocs with invalid location and instead look at > ObjCPropertyRefExprs with a class receiver? Sure, good idea. This new patch does exactly that. Thanks, Erik

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-17 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: test/SemaObjC/unguarded-availability.m:141 +@interface InterWithProp // expected-note 2 {{marked partial here}} +@property int x; +@end Should this be `@property(class)`? https://reviews.llvm.org/D33250

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-17 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. Hmm, I don't like how we end with a location that points to `x` instead of `InterWithProp`. Can we ignore the TypeLocs with invalid location and instead look at `ObjCPropertyRefExpr`s with a class receiver? https://reviews.llvm.org/D33250

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington updated this revision to Diff 99235. erik.pilkington added a comment. Just noticed this can be simplified a bit, NFC compared to the last version of the diff. https://reviews.llvm.org/D33250 Files: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/unguarded-availability.m Index:

[PATCH] D33250: [Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location

2017-05-16 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision. Previously, we used TypeLocs to find the correct SourceLocations to emit -Wunguarded-availability. Unfortunately, TypeLocs can't be trusted as they sometimes have an an empty SourceLocation component. This new patch maintains the enclosing SourceLocation