Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-10-26 Thread Nico Weber via cfe-commits
If you're working on it, let's just wait for that :-) On Wed, Oct 26, 2016 at 12:01 PM, Erik Pilkington wrote: > Hi Nico, > All that is left for the diagnostic to make sense it CodeGen support for > @available, which is something I’m working on now. I should have a patch up > for it in a couple

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-10-26 Thread Erik Pilkington via cfe-commits
Hi Nico, All that is left for the diagnostic to make sense it CodeGen support for @available, which is something I’m working on now. I should have a patch up for it in a couple days. I suppose it was a mistake to mention upgrading to something that doesn’t work yet, if this is an inconvenience f

[PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-10-26 Thread Nico Weber via cfe-commits
thakis added a comment. Erik, are you planning on adding the later phases soon? At the moment, due to this patch, clang emits "enclose 'setAllowsAutomaticWindowTabbing:' in an @available check to silence this warning" but then errors out when trying to use @available. This is proving to be conf

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-16 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278826: [ObjC] Warn on unguarded use of partial declaration (authored by epilk). Changed prior to commit: https://reviews.llvm.org/D23003?vs=67713&id=68218#toc Repository: rL LLVM https://reviews.ll

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-15 Thread Manman Ren via cfe-commits
manmanren accepted this revision. manmanren added a comment. This revision is now accepted and ready to land. > This is done so containers, such as `vector` can be used > safely provided `partially_available` is safe at the point of instantiation. > I think the way to improve this is in `Sema:

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-11 Thread Erik Pilkington via cfe-commits
erik.pilkington updated this revision to Diff 67713. erik.pilkington added a comment. This new patch adds some testcases for templates, and simplifies some control flow in `TraverseIfStmt`. This patch also removes diagnostics for instantiated templates, instead just using the pattern. This means

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-10 Thread Manman Ren via cfe-commits
manmanren added a comment. This looks pretty good. Can you add a few more testing cases for templates such as @available inside the template function, @available enclosing the template instantiation? Cheers, Manman Comment at: lib/Sema/SemaDeclAttr.cpp:6634 @@ +6633,3 @@ + /

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-10 Thread Erik Pilkington via cfe-commits
erik.pilkington updated this revision to Diff 67582. erik.pilkington added a comment. This new patch rebases on top of r277887, and addresses Manman's comments. After looking through the AST nodes, I realized I neglected to emit a diagnostic for member expressions. I also noticed that function p

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-04 Thread Manman Ren via cfe-commits
manmanren added a comment. Hi Erik, Thanks for working on this! It is great to see these patches coming. Manman Comment at: include/clang/Sema/Sema.h:9608 @@ -9604,1 +9607,3 @@ + /// \brief Whether we should emit an availability diagnostic for \c D. + bool ShouldDiagnoseAv

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-02 Thread Erik Pilkington via cfe-commits
erik.pilkington updated this revision to Diff 66555. erik.pilkington added a comment. @dcoughlin: Yes, good point! This new patch uses the enclosing version to diagnose both branches of the '*' case, as opposed to ignoring them. https://reviews.llvm.org/D23003 Files: include/clang/AST/Stmt.

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-02 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:6611 @@ +6610,3 @@ + if (auto *E = dyn_cast(If->getCond())) { +// If we're using the '*' case here, then we cannot emit any warnings for +// the 'then' branch. Do you still want to sup

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-02 Thread Erik Pilkington via cfe-commits
erik.pilkington updated this revision to Diff 66501. erik.pilkington added a comment. This new patch removes the warning `diag::warn_available_using_star_case`, as per Devin's suggestion. https://reviews.llvm.org/D23003 Files: include/clang/AST/Stmt.h include/clang/Basic/DiagnosticGroups.t

Re: [PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-08-01 Thread Devin Coughlin via cfe-commits
dcoughlin added a comment. It's really great to see this! Comment at: lib/Sema/SemaExpr.cpp:15200 @@ -15182,2 +15199,3 @@ // platform. -Diag(AtLoc, diag::warn_available_using_star_case) << RParen << Platform; +Diag(AtLoc, diag::warn_available_using_star_case) +

[PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration

2016-07-31 Thread Erik Pilkington via cfe-commits
erik.pilkington created this revision. erik.pilkington added reviewers: manmanren, dexonsmith, dcoughlin. erik.pilkington added a subscriber: cfe-commits. This patch implements support for diagnostics for @available violations. This is done with a traversal of the AST after semantic analysis of a