[PATCH] D22514: CloneDetection now respects statement specific data when searching for clones.
Vassil Vassilev via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 20 05:37:38 PDT 2016
v.g.vassilev requested changes to this revision.
v.g.vassilev added a comment.
I guess the question about the binary size holds here, too. What would be the impact on the binary size?
================
Comment at: lib/Analysis/CloneDetection.cpp:104
@@ +103,3 @@
+/// defines what a 'similar' clone is. For example, this class doesn't collect
+/// names of variables for example, which makes statements that only differ in
+/// the names of the referenced variables clones of each other.
----------------
duplicate "for example".
================
Comment at: lib/Analysis/CloneDetection.cpp:145
@@ +144,3 @@
+ }
+ #include "clang/AST/StmtNodes.inc"
+
----------------
Why do we need this? Wouldn't `callAddDataStmt` properly dispatch to the concrete method call?
================
Comment at: lib/Analysis/CloneDetection.cpp:306
@@ -112,1 +305,3 @@
for (Stmt const *Child : Parent->children()) {
+ if (!Child)
+ continue;
----------------
In which case this happens?
================
Comment at: lib/Analysis/CloneDetection.cpp:324
@@ -128,2 +323,3 @@
}
- llvm_unreachable("Couldn't find CloneSignature for StmtSequence");
+ // We return an empty signature on a cache miss. This isn't a perfect
+ // solution, but it's better than crashing when RecursiveASTVisitor is
----------------
Could you prefix this as // FIXME:
https://reviews.llvm.org/D22514
More information about the cfe-commits
mailing list