diff options
author | Artem Dergachev <adergachev@apple.com> | 2022-12-16 14:46:05 -0800 |
---|---|---|
committer | Artem Dergachev <adergachev@apple.com> | 2022-12-16 15:02:22 -0800 |
commit | 0d00a9722f3ce9d314ddd26a33e22921956b7519 (patch) | |
tree | 9cd68de0914333592c9c9c8da80c4b781cd1cfb7 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 6bbf9c0cca6f7eab35a524bbba9d6508f764b82d (diff) | |
download | llvm-0d00a9722f3ce9d314ddd26a33e22921956b7519.zip llvm-0d00a9722f3ce9d314ddd26a33e22921956b7519.tar.gz llvm-0d00a9722f3ce9d314ddd26a33e22921956b7519.tar.bz2 |
[-Wunsafe-buffer-usage] NFC: Introduce an abstraction for fixable code patterns.
This patch introduces a hierarchy of Gadget classes, which are going to be
the core concept in the somewhat sophisticated machine behind the upcoming
-Wunsafe-buffer-usage fix-it hints.
A gadget is a rigid code pattern that constitutes an operation that
the fixit machine "understands" well enough to work with. A gadget may be
"unsafe" (i.e., constitute a raw buffer access) or "safe" (constitute
a use of a pointer or array variable that isn't unsafe per se,
but may need fixing if the participating variable changes type
to a safe container/view).
We'll be able to make decisions about how to fix the code depending on
the set of gadgets that we've enumerated. Basically, in order to fix a type
of a variable, each use of that variable has to participate in a gadget,
and each such gadget has to consent to fixing itself according to
the variable's new type.
Differential Revision: https://reviews.llvm.org/D137348
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions