|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3 |
|
| #
fde4b80c |
| 16-Feb-2024 |
jkorous-apple <32549412+jkorous-apple@users.noreply.github.com> |
[-Wunsafe-buffer-usage] Minimize fixit range for pointer variables (#81935)
Example:
int * const my_var = my_initializer;
Currently when transforming my_var to std::span the fixits:
- replace "
[-Wunsafe-buffer-usage] Minimize fixit range for pointer variables (#81935)
Example:
int * const my_var = my_initializer;
Currently when transforming my_var to std::span the fixits:
- replace "int * const my_var = " with "std::span<int> const my_var {"
- add ", SIZE}" after "my_initializer" where SIZE is either inferred or
a placeholder
This patch makes that behavior less intrusive by not modifying variable
cv-qualifiers and initialization syntax.
The new behavior is:
- replace "int *" with "std::span<int>"
- add "{" before "my_initializer"
- add ", SIZE}" after "my_initializer"
This is an improvement on its own - since we don't touch the identifier,
we automatically can handle macros in them.
It also simplifies future work on initializer fixits.
show more ...
|
|
Revision tags: llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2 |
|
| #
87b8c85b |
| 19-Sep-2023 |
Rashmi Mudduluru <r_mudduluru@apple.com> |
[-Wunsafe-bugger-usage] Clean tests: remove nondeterministic ordering
Differential Review: https://reviews.llvm.org/D158553
|
|
Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3 |
|
| #
3a67b912 |
| 21-Aug-2023 |
Ziqing Luo <ziqing@udel.edu> |
[-Wunsafe-buffer-usage] Refactor to let local variable fix-its and parameter fix-its share common code
Refactor the code for local variable fix-its so that it reuses the code for parameter fix-its,
[-Wunsafe-buffer-usage] Refactor to let local variable fix-its and parameter fix-its share common code
Refactor the code for local variable fix-its so that it reuses the code for parameter fix-its, which is in general better. For example, cv-qualifiers are supported.
Reviewed by: NoQ (Artem Dergachev), t-rasmud (Rashmi Mudduluru)
Differential revision: https://reviews.llvm.org/D156189
show more ...
|
|
Revision tags: llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5 |
|
| #
b7bdf199 |
| 18-May-2023 |
Artem Dergachev <adergachev@apple.com> |
[-Wunsafe-buffer-usage] Hide fixits/suggestions behind an extra flag.
This patch implements a new clang driver flag -fsafe-buffer-usage-suggestions which allows turning the smart suggestion machine
[-Wunsafe-buffer-usage] Hide fixits/suggestions behind an extra flag.
This patch implements a new clang driver flag -fsafe-buffer-usage-suggestions which allows turning the smart suggestion machine on and off (defaults to off). This is valuable for stability reasons, as the machine is being rapidly improved\ and we don't want accidental breakages to ruin the build for innocent users. It is also arguably useful in general because it enables separation of concerns between project contributors: some users will actively update the code to conform to the programming model, while others simply want to make sure that they aren't regressing it. Finally, there could be other valid reasons to opt out of suggestions entirely on some codebases (while continuing to enforce -Wunsafe-buffer-usage warnings), such as lack of access to hardened libc++ (or even to the C++ standard library in general) on the target platform.
When the flag is disabled, the unsafe buffer usage analysis is reduced to an extremely minimal mode of operation that contains virtually no smarts: not only it doesn't offer automatic fixits, but also textual suggestions such as "change the type of this variable to std::span to preserve bounds information" are not displayed, and in fact the machine doesn't even try to blame specific variables in the first place, it simply warns on the operations and leaves everything else to the user. So this flag turns off a lot more of our complex machinery than what we already turn off in presence of say -fno-diagnostic-fixit-info.
The flag is discoverable: when it's off, the warnings are accompanied by a note: telling the user that there's a flag they can use.
Differential Revision: https://reviews.llvm.org/D146669
show more ...
|
|
Revision tags: llvmorg-16.0.4, llvmorg-16.0.3 |
|
| #
9516419c |
| 19-Apr-2023 |
MalavikaSamak <malavika2@apple.com> |
Revert "Revert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages""
This reverts commit 7bf5f4692ad6f9ba2d5c155f6b630049bb59876f and adding -frtti flag to support
Revert "Revert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages""
This reverts commit 7bf5f4692ad6f9ba2d5c155f6b630049bb59876f and adding -frtti flag to support PS4/PS5 builds.
show more ...
|
| #
777eb4bc |
| 19-Apr-2023 |
MalavikaSamak <malavika2@apple.com> |
[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages
This patch handles unevaluated contexts to ensure no warnings are produced by the machinery for buffer access ma
[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages
This patch handles unevaluated contexts to ensure no warnings are produced by the machinery for buffer access made within an unevaluated contexts. However, such accesses must be considered by a FixableGadget and produce the necessary fixits.
Reviewed by: NoQ, ziqingluo-90, jkorous
Differential revision: https://reviews.llvm.org/D144905
show more ...
|