[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)
commit78692ea590046c7c9a66e58a14165ff6b16b5ae5
treeed55724a4d77ce1d14a17f2ca2a36090990381af
parent3f704497fa409aba387a75770e1be9198b5796e4
[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

llvm-svn: 277449
16 files changed:
clang/include/clang/Analysis/CloneDetection.h
clang/lib/Analysis/CloneDetection.cpp
clang/test/Analysis/copypaste/asm.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/attributes.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/call.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/catch.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/delete.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/dependent-exist.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/expr-types.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/false-positives.cpp
clang/test/Analysis/copypaste/fold.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/function-try-block.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/functions.cpp
clang/test/Analysis/copypaste/generic.c [new file with mode: 0644]
clang/test/Analysis/copypaste/labels.cpp [new file with mode: 0644]
clang/test/Analysis/copypaste/lambda.cpp [new file with mode: 0644]