v.g.vassilev added inline comments.

================
Comment at: lib/Analysis/CloneDetection.cpp:431
@@ +430,3 @@
+    // level of it's containing clone. This prevents false-positives caused by
+    // complex macros. For example 'assert(false)' could be reported as a clone
+    // if the assert macro is implemented as a expression that would
----------------
What are complex macros? Could you clarify?

================
Comment at: test/Analysis/copypaste/macro-complexity.cpp:19
@@ +18,3 @@
+// Prevents that this tests won't accidentially pass because the code inside
+// the macro isn't complex enough.
+int foo(int a, int b) {  // expected-warning{{Detected code clone.}}
----------------
I am not sure I understand this comment. Could you reword?

================
Comment at: test/Analysis/copypaste/macros.cpp:11
@@ +10,3 @@
+int max(int a, int b) { // expected-warning{{Detected code clone.}}
+  return a > b ? a : b;
+}
----------------
Wouldn't it be a good idea to have a fixit hint, saying "Did you mean to use 
ABS(a,b)". If the suggestion is applied, it would make the code more 
consistent, however it would encourage using preprocessor tricks (which is not 
always considered as good practice).


https://reviews.llvm.org/D23316



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to