This is an archive of the discontinued LLVM Phabricator instance.

[clang-diff] improve mapping accuracy
AbandonedPublic

Authored by johannes on Jun 28 2017, 6:26 AM.

Details

Reviewers
arphaman

Diff Detail

Event Timeline

johannes created this revision.Jun 28 2017, 6:26 AM
johannes updated this revision to Diff 104461.Jun 28 2017, 10:49 AM
arphaman edited edge metadata.Jul 7 2017, 4:46 AM

Can you provide a test that demonstrates what this change fixed/improved?

include/clang/Tooling/ASTDiff/ASTDiffInternal.h
53

If I understand correctly this comment matches the same method in MultiMapping. Will you ever implement this method in Mapping though? I don't think you need such a comment if you don't intend to have this method in the Mapping class.

Can you provide a test that demonstrates what this change fixed/improved?

My bad, it looks like this does not improve anything yet. In order to do so I will use additional heuristics for similarity, like in the reference implementation.

johannes updated this revision to Diff 107479.Jul 20 2017, 3:46 AM
johannes retitled this revision from [clang-diff] Fix multiple mappings. to [clang-diff] improve mapping accuracy, HTML side-by-side diff..

Some comments:

  • I had to make a couple of post-commit fixes to appease the buildbots when I committed your first patch, so it looks like this one doesn't apply cleanly anymore. Can you please rebase it?
  • Let's separate the addition of HTML output and the improvements to the algorithm in two patches. I would recommend that you leave the algorithm improvements in this one and post a follow-up patch that has HTML output (with a HTML output test).
  • I won't be able to accept a change like this without tests. Did you monitor the changes in the HTML output while your worked on improvements to the algorithm? Please try and base the tests on those changes and improvements.
lib/Tooling/ASTDiff/ASTDiff.cpp
818

What are these magic constants? Please describe them in comments and factor out to appropriately named const variables if needed.

johannes updated this revision to Diff 108370.Jul 26 2017, 3:20 PM
johannes retitled this revision from [clang-diff] improve mapping accuracy, HTML side-by-side diff. to [clang-diff] improve mapping accuracy.
arphaman added a comment.EditedJul 27 2017, 4:49 AM

In general this patch is too big, and combines a lot of changes that could be separated using multiple patches. I've suggested one pre-commit and a new patch so far, but more changes might be required once I see the updated patch.

include/clang/Tooling/ASTDiff/ASTDiff.h
48

Redundant const in the return type.

49

Redundant const in the return type.

58

Please Move these fields to the end of the class. Can they be private too?

lib/Tooling/ASTDiff/ASTDiff.cpp
170

How will you deal with changes in headers if you limit analysis to main files only?

694

Redundant const in return type.

tools/clang-diff/ClangDiff.cpp
28

The rename of DumpAST to ASTDump should be a separate change. Please pre-commit this rename and remove it from the updated patch.

45

Can you avoid moving the NoCompilationDatabase? This will make the patch clearer.

65

This is a copy ArgumentsAdjustingCompilations from lib/Tooling. You should create a patch that moves existing ArgumentsAdjustingCompilations from the implementation file to some header so that it will be accessible by the tool and make this patch depend on the new patch.

224

You might want to assert here. We should never have Delete in the destination AST, right?

johannes abandoned this revision.Aug 1 2017, 2:17 PM

split up in several commits starting from https://reviews.llvm.org/D36176

lib/Tooling/ASTDiff/ASTDiff.cpp
170

I will change this to support headers in another patch