This revision was automatically updated to reflect the committed changes.
Closed by commit rL279367: [analyzer] Make CloneDetector consider macro
expansions. (authored by dergachev).
Changed prior to commit:
https://reviews.llvm.org/D23316?vs=68684&id=68771#toc
Repository:
rL LLVM
https://r
teemperor updated this revision to Diff 68684.
teemperor added a comment.
- Fixed typo.
https://reviews.llvm.org/D23316
Files:
include/clang/Analysis/CloneDetection.h
lib/Analysis/CloneDetection.cpp
test/Analysis/copypaste/macro-complexity.cpp
test/Analysis/copypaste/macros.cpp
Index:
teemperor updated this revision to Diff 68568.
teemperor marked 2 inline comments as done.
teemperor added a comment.
- Added false-positives note for empty macros to the test suite.
https://reviews.llvm.org/D23316
Files:
include/clang/Analysis/CloneDetection.h
lib/Analysis/CloneDetection.c
teemperor marked 10 inline comments as done.
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
NoQ wrote:
> omtcyfz wrote:
> > omtcyfz wrote:
> > > omtcyfz wrote:
> > > > NoQ wrote:
> > > > >
teemperor updated this revision to Diff 68556.
teemperor added a comment.
- Added more documentation to the CloneSignature::Complexity field.
- Macros now have a complexity value of 1 + sum(ChildComplexityValues).
- Tests should be less cryptic now.
https://reviews.llvm.org/D23316
Files:
incl
NoQ added a comment.
No comments of my own, the patch looks good :)
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
omtcyfz wrote:
> omtcyfz wrote:
> > omtcyfz wrote:
> > > NoQ wrote:
> >
omtcyfz added inline comments.
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
omtcyfz wrote:
> omtcyfz wrote:
> > NoQ wrote:
> > > omtcyfz wrote:
> > > > Do I understand correctly that a c
omtcyfz added inline comments.
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
omtcyfz wrote:
> NoQ wrote:
> > omtcyfz wrote:
> > > Do I understand correctly that a code generated by a macr
omtcyfz added inline comments.
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
NoQ wrote:
> omtcyfz wrote:
> > Do I understand correctly that a code generated by a macro doesn't affect
> >
NoQ added inline comments.
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
omtcyfz wrote:
> Do I understand correctly that a code generated by a macro doesn't affect
> "complexity" at all
omtcyfz added a subscriber: omtcyfz.
Comment at: lib/Analysis/CloneDetection.cpp:436
@@ +435,3 @@
+if (IsInMacro) {
+ Signature.Complexity = 0;
+}
Do I understand correctly that a code generated by a macro doesn't affect
"complexity" at all then?
``
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 m
teemperor created this revision.
teemperor added reviewers: v.g.vassilev, NoQ, zaks.anna.
teemperor added a subscriber: cfe-commits.
So far macro-generated code was treated by the CloneDetector as normal code.
This caused that some macros where reported as false-positive clones because
their gen
13 matches
Mail list logo