[PATCH] D143697: [-Wunsafe-buffer-usage] Create Fix-Its only if they are emitted
Ziqing Luo via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 23 14:48:10 PST 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf78c34346635: [-Wunsafe-buffer-usage] Create Fix-Its only if they are emitted (authored by ziqingluo-90).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143697/new/
https://reviews.llvm.org/D143697
Files:
clang/lib/Analysis/UnsafeBufferUsage.cpp
clang/lib/Sema/AnalysisBasedWarnings.cpp
Index: clang/lib/Sema/AnalysisBasedWarnings.cpp
===================================================================
--- clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -2518,7 +2518,8 @@
UnsafeBufferUsageReporter R(S);
checkUnsafeBufferUsage(
D, R,
- /*EmitFixits=*/S.getLangOpts().CPlusPlus20);
+ /*EmitFixits=*/S.getDiagnostics().getDiagnosticOptions().ShowFixits &&
+ S.getLangOpts().CPlusPlus20);
}
// If none of the previous checks caused a CFG build, trigger one here
Index: clang/lib/Analysis/UnsafeBufferUsage.cpp
===================================================================
--- clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1017,8 +1017,6 @@
DeclUseTracker Tracker;
{
- // FIXME: We could skip even matching Fixables' matchers if EmitFixits ==
- // false.
auto [FixableGadgets, WarningGadgets, TrackerRes] = findGadgets(D, Handler);
UnsafeOps = groupWarningGadgetsByVar(std::move(WarningGadgets));
FixablesForUnsafeVars = groupFixablesByVar(std::move(FixableGadgets));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143697.499985.patch
Type: text/x-patch
Size: 1151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230223/b201e3f8/attachment-0001.bin>
More information about the cfe-commits
mailing list