[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGde401ac2a4ab: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute (authored by hazohelet, committed by aaron.ballman). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145842/new/ https://reviews.llvm.org/D145842 ___ cfe-commits mailing

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504933. hazohelet added a comment. Address comments from @aaron.ballman - NFC stylistic changes Thanks for the review! Since I don't have commit access, would you please land this patch for me? Please use "Takuya Shimizu " for the patch attribution.

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you, I think this is heading in the right direction! Can you also add a release note to `clang/docs/ReleaseNotes.rst` about the fix? Comment at: clang/lib/Analysis/ReachableCode.cpp:633-635 + const AttributedStmt *AS = dyn_cast(S); +

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504697. hazohelet added a comment. Address comments from @aaron.ballman - Dropped `const` qualifier from value objects for style consistency - Passed boolean `HasFallThroughAttr` to callback and handled warning suppression in `HandleUnreachable` in order

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Analysis/Analyses/ReachableCode.h:65 + Callback , + const bool UnreachableFallThroughDiagIsEnabled); }} // end namespace clang::reachable_code

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-12 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504501. hazohelet added a comment. Address comments from @shafik - Pass bool flag `UnreachableFallThroughDiagIsEnabled` instead of `DiagnosticsEngine` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145842/new/ https://reviews.llvm.org/D145842

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-12 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/Analysis/ReachableCode.cpp:674 + if (AS && hasSpecificAttr(AS->getAttrs()) && + !Diag.isIgnored(diag::warn_unreachable_fallthrough_attr, + SourceLocation())) { Your passing through

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-11 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: tbaeder, aaron.ballman, cjdb. Herald added a reviewer: NoQ. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch checks whether `-Wunreachable-code-fallthrough` is enabled