[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-17 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood abandoned this revision. LegalizeAdulthood added a comment. Based on discussion, I'm going to move this as a private matcher in the check where I intend to use it. Therefore, I'm abandoning this review. I look forward to seeing Yitzhak's generalized matcher `:)` CHANGES SINCE

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-14 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added a comment. OK, I'm going to migrate this to a private matcher in the check that needs it. A related question is if it is possible to register private matchers with the parsing framework? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116518/new/ https://reviews.l

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Clarification: I'm totally fine with it existing privately, my concerns were with a public implementation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116518/new/ https://reviews.llvm.org/D116518 ___ cfe-commits ma

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Sorry for the delay. Read through the whole thread today. I agree with Aaron -- we shouldn't add this until 1. we have a general interface 2. we're sure this serves a general audience As I mentioned in my previous reply, I have a working general interface that I shared

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-12 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added a comment. In D116518#3237927 , @ymandel wrote: > [...] In the meantime, I'll note that we have something similar internally > which I never got around to upstreaming. That's very interesting and is certainly more general than wha

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for looping me in. I'll try to take a detailed look later today. In the meantime, I'll note that we have something similar internally which I never got around to upstreaming. However, we chose to support arbitrarily many matchers, with this interface: const cl

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-11 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; return false; } +/// \endcode +/// compoun

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a subscriber: ymandel. aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; ret

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-10 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood updated this revision to Diff 398754. LegalizeAdulthood added a comment. clang-format CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116518/new/ https://reviews.llvm.org/D116518 Files: clang/docs/LibASTMatchersReference.html clang/docs/ReleaseNotes.rst clang/incl

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-05 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; return false; } +/// \endcode +/// compoun

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-05 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; return false; } +/// \endcode +/// compoun

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-05 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; return false; } +/// \endcode +/// compoundStm

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-04 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood marked an inline comment as done. LegalizeAdulthood added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) ret

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-04 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; return false; } +/// \endcode +/// compoundStm

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-03 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood updated this revision to Diff 397121. LegalizeAdulthood marked an inline comment as done. LegalizeAdulthood added a comment. Add `stmtExpr` test case CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116518/new/ https://reviews.llvm.org/D116518 Files: clang/docs/LibASTM

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-03 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood marked an inline comment as done. LegalizeAdulthood added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) ret

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5435-5442 +/// Matches two consecutive statements within a compound statement. +/// +/// Given +/// \code +/// { if (x > 0) return true; return false; } +/// \endcode +/// compoundStm

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-02 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood updated this revision to Diff 397004. LegalizeAdulthood added a comment. Improve matching when the first matcher matches multiple times, but the 2nd matcher doesn't match at first. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116518/new/ https://reviews.llvm.org/D1165

[PATCH] D116518: [ast-matchers] Add hasSubstatementSequence matcher

2022-01-02 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood created this revision. LegalizeAdulthood added a reviewer: klimek. LegalizeAdulthood added a project: clang. LegalizeAdulthood requested review of this revision. This allows the matching of two specific statements in sequence within a compound statement. For instance `if (x) ret