[PATCH] D22514: CloneDetection now respects statement specific data when searching for clones.
Raphael Isemann via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 31 18:25:06 PDT 2016
teemperor updated this revision to Diff 66261.
teemperor added a comment.
- Added typedef for the contents of the data vector.
- Fixed that StmtDataCollector isn't visiting all parent classes of a statement.
- Removed 'test-' prefix from test files.
- Fixed the other problems as pointed out by Artem (Thanks!)
- Added performance remark to the qualified name strings in the data vectors.
I'm now falling back to the ConstStmtVisitor for visiting the parent statements (see the `DEF_ADD_DATA` macro) which is probably the best fix for the visitor problem.
clang's binary size increases with this patch to 32890440 bytes from 32863664 bytes (+26 KB).
I've kept the long qualified name strings in the data vectors in for now because that's just a performance optimization. Using the pointer values would make the code non-deterministic and breaks cross-TU support and better solutions are probably out of scope for this patch. I've added a remark that we should fix this when we look into performance optimizations.
https://reviews.llvm.org/D22514
Files:
include/clang/Analysis/CloneDetection.h
lib/Analysis/CloneDetection.cpp
test/Analysis/copypaste/asm.cpp
test/Analysis/copypaste/attributes.cpp
test/Analysis/copypaste/call.cpp
test/Analysis/copypaste/catch.cpp
test/Analysis/copypaste/delete.cpp
test/Analysis/copypaste/dependent-exist.cpp
test/Analysis/copypaste/expr-types.cpp
test/Analysis/copypaste/false-positives.cpp
test/Analysis/copypaste/fold.cpp
test/Analysis/copypaste/function-try-block.cpp
test/Analysis/copypaste/functions.cpp
test/Analysis/copypaste/generic.c
test/Analysis/copypaste/labels.cpp
test/Analysis/copypaste/lambda.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22514.66261.patch
Type: text/x-patch
Size: 18352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160801/5325a2b5/attachment.bin>
More information about the cfe-commits
mailing list