]> granicus.if.org Git - clang/commit
[analyzer] Respect statement-specific data in CloneDetection.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 2 Aug 2016 12:21:09 +0000 (12:21 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 2 Aug 2016 12:21:09 +0000 (12:21 +0000)
commit34b6437ab993036f2bf8dd6ae4335c17a25ee0d7
tree11aa767d495ea738459835697b1f281db7f21a82
parent774347efea4dc47cb3093531aa71315bf0e19259
[analyzer] Respect statement-specific data in CloneDetection.

So far the CloneDetector only respected the kind of each statement when
searching for clones. This patch refines the way the CloneDetector collects data
from each statement by providing methods for each statement kind,
that will read the kind-specific attributes.

For example, statements 'a < b' and 'a > b' are no longer considered to be
clones, because they are different in operation code, which is an attribute
specific to the BinaryOperator statement kind.

Patch by Raphael Isemann!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277449 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/Analysis/CloneDetection.h
lib/Analysis/CloneDetection.cpp
test/Analysis/copypaste/asm.cpp [new file with mode: 0644]
test/Analysis/copypaste/attributes.cpp [new file with mode: 0644]
test/Analysis/copypaste/call.cpp [new file with mode: 0644]
test/Analysis/copypaste/catch.cpp [new file with mode: 0644]
test/Analysis/copypaste/delete.cpp [new file with mode: 0644]
test/Analysis/copypaste/dependent-exist.cpp [new file with mode: 0644]
test/Analysis/copypaste/expr-types.cpp [new file with mode: 0644]
test/Analysis/copypaste/false-positives.cpp
test/Analysis/copypaste/fold.cpp [new file with mode: 0644]
test/Analysis/copypaste/function-try-block.cpp [new file with mode: 0644]
test/Analysis/copypaste/functions.cpp
test/Analysis/copypaste/generic.c [new file with mode: 0644]
test/Analysis/copypaste/labels.cpp [new file with mode: 0644]
test/Analysis/copypaste/lambda.cpp [new file with mode: 0644]