[analyzer] Improve CloneChecker diagnostics
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 3 Oct 2016 08:11:50 +0000 (08:11 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 3 Oct 2016 08:11:50 +0000 (08:11 +0000)
commitc87d2a613ec0e99e43ea683743736c8acc9bd47c
tree8d9024e4bc23322982245a97d4e48521b75825bc
parent918602df8dc137dfeb148315248751b68776c25d
[analyzer] Improve CloneChecker diagnostics

Highlight code clones referenced by the warning message with the help of
the extra notes feature recently introduced in r283092.

Change warning text to more clang-ish. Remove suggestions from the copy-paste
error checker diagnostics, because currently our suggestions are strictly 50%
wrong (we do not know which of the two code clones contains the error), and
for that reason we should not sound as if we're actually suggesting this.
Hopefully a better solution would bring them back.

Make sure the suspicious clone pair structure always mentions
the correct variable for the second clone.

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

llvm-svn: 283094
14 files changed:
clang/include/clang/Analysis/CloneDetection.h
clang/lib/Analysis/CloneDetection.cpp
clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
clang/test/Analysis/copypaste/blocks.cpp
clang/test/Analysis/copypaste/function-try-block.cpp
clang/test/Analysis/copypaste/functions.cpp
clang/test/Analysis/copypaste/macro-complexity.cpp
clang/test/Analysis/copypaste/macros.cpp
clang/test/Analysis/copypaste/objc-methods.m
clang/test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/plist-diagnostics.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/sub-sequences.cpp
clang/test/Analysis/copypaste/suspicious-clones.cpp
clang/test/Analysis/copypaste/text-diagnostics.cpp [new file with mode: 0644]