[PATCH] D157441: [-Wunsafe-buffer-usage] Use `Strategy` to determine whether to fix a parameter

Ziqing Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 14:35:21 PDT 2023


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

- Use `Strategy` to determine whether to fix a parameter.
- Fix the `Strategy` construction so that only variables on the graph are assigned the `std::span` strategy
- Extend `PointerAssignmentGadget` and `PointerInitGadget` to generate fix-its for cases where the left-hand side has `won't fix` strategy and the right-hand side has `std::span` strategy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157441

Files:
  clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-multi-parm-span.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage-multi-decl-ptr-init.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage-multi-decl-warnings.cpp
  clang/test/SemaCXX/warn-unsafe-buffer-usage.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157441.548333.patch
Type: text/x-patch
Size: 17313 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230808/985ba6a8/attachment.bin>


More information about the cfe-commits mailing list