[PATCH] D22514: CloneDetection now respects statement specific data when searching for clones.

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 1 01:32:23 PDT 2016


NoQ added a comment.

Congrats on the fantastic hack that nobody else noticed! I've a feeling we cannot add tests for that, because any test would quickly break if we change the hash, though demonstrating that we fixed the problem would still be cool (eg. take two unsupported expressions of different kind but same type, and show that they're no longer reported).

One more minor comment.


================
Comment at: lib/Analysis/CloneDetection.cpp:127
@@ +126,3 @@
+    // Initialize the last bytes that are maybe not fully overwritten.
+    CollectedData.back() = 0;
+
----------------
I think `resize()` zero-initializes the whole new data(?)

================
Comment at: lib/Analysis/CloneDetection.cpp:142
@@ +141,3 @@
+    CODE;                                                                      \
+    ConstStmtVisitor<StmtDataCollector>::Visit##CLASS(S);                      \
+  }
----------------
This is... Beautiful... o________o
/Approves.


https://reviews.llvm.org/D22514





More information about the cfe-commits mailing list