]> granicus.if.org Git - clang/commit
[analyzer] Add minimal support for fix-it hints.
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 6 Sep 2019 20:55:29 +0000 (20:55 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 6 Sep 2019 20:55:29 +0000 (20:55 +0000)
commit71ee164e08197eaee5aa294c0ba74342d22073b1
tree5e8f0dd42c0b366106511aa1c5a0429135eca279
parentf2f05530b6f84c2742558100acc544ae6bf73bbf
[analyzer] Add minimal support for fix-it hints.

Allow attaching fixit hints to Static Analyzer BugReports.

Fixits are attached either to the bug report itself or to its notes
(path-sensitive event notes or path-insensitive extra notes).

Add support for fixits in text output (including the default text output that
goes without notes, as long as the fixit "belongs" to the warning).

Add support for fixits in the plist output mode.

Implement a fixit for the path-insensitive DeadStores checker. Only dead
initialization warning is currently covered.

Implement a fixit for the path-sensitive VirtualCall checker when the virtual
method is not pure virtual (in this case the "fix" is to suppress the warning
by qualifying the call).

Both fixits are under an off-by-default flag for now, because they
require more careful testing.

Differential Revision: https://reviews.llvm.org/D65182

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371257 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/StaticAnalyzer/Checkers/Checkers.td
include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
test/Analysis/analyzer-config.c
test/Analysis/dead-stores.c
test/Analysis/edges-new.mm
test/Analysis/objc-arc.m
test/Analysis/plist-output.m
test/Analysis/virtualcall-fixits.cpp [new file with mode: 0644]