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

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 2 21:19:02 PST 2022


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) return true; return false;`
can be matched as

  compoundStmt(hasSubstatementSequence(ifStmt(), returnStmt()))


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116518

Files:
  clang/docs/LibASTMatchersReference.html
  clang/docs/ReleaseNotes.rst
  clang/include/clang/ASTMatchers/ASTMatchers.h
  clang/lib/ASTMatchers/Dynamic/Registry.cpp
  clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116518.396991.patch
Type: text/x-patch
Size: 5070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220103/4305c67b/attachment.bin>


More information about the cfe-commits mailing list