teemperor created this revision.
teemperor added reviewers: v.g.vassilev, NoQ.
teemperor added a subscriber: cfe-commits.
The CloneDetector currently ignores template arguments in function calls which
leads to false-positive clones such as `isa(S)` and `isa(S)`.
This patch adds functionality to
NoQ added inline comments.
Comment at: lib/Analysis/CloneDetection.cpp:154
@@ -153,2 +153,3 @@
// Function pointers don't have a callee and we just skip hashing it.
-if (S->getDirectCallee())
+if (S->getDirectCallee()) {
+ // If the function is a template instant
v.g.vassilev accepted this revision.
v.g.vassilev added a comment.
This revision is now accepted and ready to land.
LGTM once the @NoQ remarks are addressed.
https://reviews.llvm.org/D23555
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
teemperor updated this revision to Diff 68683.
teemperor marked an inline comment as done.
https://reviews.llvm.org/D23555
Files:
lib/Analysis/CloneDetection.cpp
test/Analysis/copypaste/call.cpp
Index: test/Analysis/copypaste/call.cpp
=
teemperor marked 3 inline comments as done.
Comment at: lib/Analysis/CloneDetection.cpp:164
@@ +163,3 @@
+for (unsigned i = 0; i < Args->size(); ++i) {
+ Args->get(i).print(Context.getLangOpts(), OS);
+}
NoQ wrote:
> We don't discriminate
This revision was automatically updated to reflect the committed changes.
Closed by commit rL279366: [analyzer] Make CloneDetector consider template
arguments. (authored by dergachev).
Changed prior to commit:
https://reviews.llvm.org/D23555?vs=68683&id=68770#toc
Repository:
rL LLVM
https:/