[all-commits] [llvm/llvm-project] b2ac5f: [-Wunsafe-buffer-usage] Add a new `forEachDescenda...

Ziqing Luo via All-commits all-commits at lists.llvm.org
Wed Jan 4 15:53:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2ac5fd724c44cf662caed84bd8f84af574b981d
      https://github.com/llvm/llvm-project/commit/b2ac5fd724c44cf662caed84bd8f84af574b981d
  Author: Ziqing Luo <ziqing at udel.edu>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M clang/lib/Analysis/UnsafeBufferUsage.cpp
    M clang/test/SemaCXX/warn-unsafe-buffer-usage.cpp

  Log Message:
  -----------
  [-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations

Note this is a change local to -Wunsafe-buffer-usage checks.

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.

Reviewed by: NoQ, xazax.hun

Differential revision: https://reviews.llvm.org/D138329




More information about the All-commits mailing list