[PATCH] D22514: CloneDetection now respects statement specific data when searching for clones.
Raphael Isemann via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 19 07:24:41 PDT 2016
teemperor created this revision.
teemperor added reviewers: v.g.vassilev, zaks.anna, NoQ.
teemperor added a subscriber: cfe-commits.
So far the CloneDetector only respected the class of each statement when searching for clones. This means that nodes that differentiate in any other attribute are falsely considered to be clones of each other as long as they had the same statement class. As an example, the statements "a > b" and "a < b" are currently considered to be clones of each other, even though they are obviously different.
This patch refines the way the CloneDetector collects data from each statement by providing methods for each class that will read the class-specific
attributes. These attributes are for example the operator kind for BinaryOperator statements which would prevent the false-positive result from the example above.
The code itself is contained in the StmtDataCollector class because it will be reused in a future patch that searches for false-positives.
https://reviews.llvm.org/D22514
Files:
lib/Analysis/CloneDetection.cpp
test/Analysis/copypaste/test-min-max.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22514.64491.patch
Type: text/x-patch
Size: 10142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160719/ed46893b/attachment.bin>
More information about the cfe-commits
mailing list