erik.pilkington created this revision.
erik.pilkington added a reviewer: manmanren.
erik.pilkington added a subscriber: cfe-commits.
This patch removes some redundant functions that implement checking
availability against context, and implements a new, more correct one:
`ShouldDiagnoseAvailabili
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added inline comments.
Comment at: include/clang/Sema/Sema.h:9747
+ AvailabilityResult ShouldDiagnoseAvailabilityOfDecl(NamedDecl *&D,
+ std::string *Message);
---
manmanren added a comment.
This is a nice cleanup!
Manman
Comment at: lib/Sema/SemaDeclAttr.cpp:6348
+
+ auto IsContextGreater = [&](const Decl *C) {
+if (K == AR_NotYetIntroduced) {
Can you add a comment for the lambda?
Comment at: lib
erik.pilkington updated this revision to Diff 74547.
erik.pilkington added a comment.
This new patch fixes the style issues @aaron.ballman and @manmanren brought up.
Thanks,
Erik
https://reviews.llvm.org/D25283
Files:
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.c
erik.pilkington added inline comments.
Comment at: lib/Sema/SemaExpr.cpp:179
- if (const DeclContext *DC = S.getCurObjCLexicalContext())
-ContextVersion = S.getVersionForDecl(cast(DC));
-
manmanren wrote:
> I don't quite get why we can remove the above logic
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM
https://reviews.llvm.org/D25283
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/
This revision was automatically updated to reflect the committed changes.
Closed by commit rL284265: [Sema] Refactor context checking for availability
diagnostics (authored by epilk).
Changed prior to commit:
https://reviews.llvm.org/D25283?vs=74547&id=74729#toc
Repository:
rL LLVM
https://