[PATCH] D138329: [-Wunsafe-buffer-usage] Add a new recursive matcher to replace `forEachDescendant` in unsafe buffer check

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 13:32:02 PST 2022


ziqingluo-90 created this revision.
ziqingluo-90 added reviewers: NoQ, jkorous, t-rasmud, malavikasamak, aaron.ballman, xazax.hun, gribozavr.
Herald added a subscriber: rnkovacs.
Herald added a project: All.
ziqingluo-90 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Add a new matcher `forEveryDescendant` that recursively matches descendants of a `Stmt` but skips nested callable definitions.
This matcher has same effect as using `forEachDescendant` and skipping `forCallable` explicitly but does not require the AST construction to be complete.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138329

Files:
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138329.476586.patch
Type: text/x-patch
Size: 7581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221118/73029f5e/attachment.bin>


More information about the cfe-commits mailing list