[PATCH] D36179: [clang-diff] Move printing of matches and changes to clang-diff

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109417. johannes added a comment. remove unused SubtreeIterator https://reviews.llvm.org/D36179 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp

[PATCH] D36178: [clang-diff] Move the JSON export function to clang-diff

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109416. johannes added a comment. getSourceRangeOffsets, test https://reviews.llvm.org/D36178 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-json.cpp tools/clang-diff/ClangDiff.cpp Index:

[PATCH] D36184: [clang-diff] Filter AST nodes

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D36184#828866, @klimek wrote: > Why? Also, missing tests. implicit nodes are noisy / they generally don't add information; I guess one could also keep them. I excluded nodes outside of the main file are because the visualisation only

[PATCH] D36176: [clang-diff] Fix some errors and inconsistencies

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109414. johannes added a comment. move most functional changes to other commits move constructor for Syntaxtree https://reviews.llvm.org/D36176 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h

[PATCH] D36181: [clang-diff] Make printing of matches optional

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109420. johannes added a comment. rename to -dump-matches, add a test https://reviews.llvm.org/D36181 Files: test/Tooling/clang-diff-args.sh test/Tooling/clang-diff-basic.cpp tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp

[PATCH] D36180: [clang-diff] Add option to dump the AST, one node per line

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109419. johannes added a comment. Herald added a subscriber: klimek. add a test https://reviews.llvm.org/D36180 Files: test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-json.cpp tools/clang-diff/ClangDiff.cpp Index:

[PATCH] D36176: [clang-diff] Fix some errors and inconsistencies

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:96 : TreeImpl(llvm::make_unique(this, Node, AST)) {} + SyntaxTree(const SyntaxTree ) = delete; ~SyntaxTree(); arphaman wrote: > johannes wrote: > > arphaman wrote: > >

[PATCH] D36183: [clang-diff] Simplify mapping

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109422. johannes edited the summary of this revision. johannes added a comment. - https://reviews.llvm.org/D36183 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/Inputs/clang-diff-basic-src.cpp

[PATCH] D36184: [clang-diff] Filter AST nodes

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109423. johannes added a comment. tests https://reviews.llvm.org/D36184 Files: lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp Index: test/Tooling/clang-diff-ast.cpp ===

[PATCH] D36177: [clang-diff] Add commandline arguments.

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109415. johannes added a comment. add some test, replace -no-compilation-database with -- https://reviews.llvm.org/D36177 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-args.sh

[PATCH] D36185: [clang-diff] Fix similarity computation

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109424. johannes added a comment. add test for Options.MaxSize https://reviews.llvm.org/D36185 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-bottomup.cpp test/Tooling/clang-diff-opt.cpp

[PATCH] D36185: [clang-diff] Fix similarity computation

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: test/Tooling/clang-diff-bottomup.cpp:3 +// RUN: %clang_cc1 -E %s > %t.dst.cpp -DDEST +// RUN: clang-diff -m -no-compilation-database -s=0 %t.src.cpp %t.dst.cpp | FileCheck %s +// klimek wrote: > Instead of using

[PATCH] D36182: [clang-diff] Add HTML side-by-side diff output

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109421. johannes added a comment. - https://reviews.llvm.org/D36182 Files: test/Tooling/Inputs/clang-diff-basic-src.cpp test/Tooling/clang-diff-basic.cpp test/Tooling/clang-diff-html.py tools/clang-diff/CMakeLists.txt

[PATCH] D36186: [clang-diff] Improve and test getNodeValue

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109425. johannes added a comment. NFC renames https://reviews.llvm.org/D36186 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-basic.cpp

[PATCH] D36186: [clang-diff] Improve and test getNodeValue

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109426. johannes added a comment. renamse, NFC https://reviews.llvm.org/D36186 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-basic.cpp

[PATCH] D36177: [clang-diff] Add commandline arguments.

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D36177#828909, @arphaman wrote: > There should be a test that ensures that `stop-after` works and `extra-arg`s > are correctly passed to the compiler. `stop-after` is not tested yet. It is also broken in this patch, I will move it to a

[PATCH] D36186: [clang-diff] Improve and test getNodeValue

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: test/Tooling/clang-diff-ast.cpp:32 + +// CHECK: TypedefDecl: nat;unsigned int;( +typedef unsigned nat; klimek wrote: > For my curiosity: why are there semicolons here? Is the format documented > somewhere? To avoid

[PATCH] D36176: [clang-diff] Fix some errors and inconsistencies

2017-08-02 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:96 : TreeImpl(llvm::make_unique(this, Node, AST)) {} + SyntaxTree(const SyntaxTree ) = delete; ~SyntaxTree(); arphaman wrote: > It might be better to add a move

[PATCH] D36185: [clang-diff] Fix similarity computation

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109505. johannes added a comment. merge parent changes https://reviews.llvm.org/D36185 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-bottomup.cpp test/Tooling/clang-diff-opt.cpp

[PATCH] D36183: [clang-diff] Simplify mapping

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109504. johannes added a comment. merge parent changes https://reviews.llvm.org/D36183 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/Inputs/clang-diff-basic-src.cpp test/Tooling/clang-diff-basic.cpp

[PATCH] D36178: [clang-diff] Move the JSON export function to clang-diff

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: test/Tooling/clang-diff-json.cpp:1 +// RUN: clang-diff -ast-dump %s -- | python -m json.tool | FileCheck %s + arphaman wrote: > I think you have to use `%python` instead of `python`, like LLVM tests do. ok So I have to

[PATCH] D36181: [clang-diff] Make printing of matches optional

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109503. johannes added a comment. fix tests https://reviews.llvm.org/D36181 Files: test/Tooling/clang-diff-args.test test/Tooling/clang-diff-basic.cpp tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp

[PATCH] D36177: [clang-diff] Add commandline arguments.

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109502. johannes added a comment. fix tests https://reviews.llvm.org/D36177 Files: test/Tooling/clang-diff-args.test test/Tooling/clang-diff-basic.cpp tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp

[PATCH] D36178: [clang-diff] Move the JSON export function to clang-diff

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: test/Tooling/clang-diff-json.cpp:1 +// RUN: clang-diff -ast-dump %s -- | python -m json.tool | FileCheck %s + johannes wrote: > arphaman wrote: > > I think you have to use `%python` instead of `python`, like LLVM tests

[PATCH] D34748: [clang-diff] improve mapping accuracy

2017-08-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes abandoned this revision. johannes added a comment. split up in several commits starting from https://reviews.llvm.org/D36176 Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:170 + // Ignore everything from other files. + if (!SrcMgr.isInMainFile(SLoc)) +return true;

[PATCH] D35921: [clang-diff] HTML side-by-side diff

2017-08-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes abandoned this revision. johannes added a comment. moved to https://reviews.llvm.org/D36182, sorry for the noise https://reviews.llvm.org/D35921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D36178: [clang-diff] Move the JSON export function to clang-diff

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109537. johannes added a comment. use %python in tests https://reviews.llvm.org/D36178 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-json.cpp test/lit.cfg test/lit.site.cfg.in

[PATCH] D36180: [clang-diff] Add option to dump the AST, one node per line

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109538. johannes added a comment. merge update https://reviews.llvm.org/D36180 Files: test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-json.cpp tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp

[PATCH] D36176: [clang-diff] Fix some errors and inconsistencies

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109536. johannes edited the summary of this revision. johannes added a comment. update commit message https://reviews.llvm.org/D36176 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h

[PATCH] D36182: [clang-diff] Add HTML side-by-side diff output

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 109539. johannes added a comment. make test work with python 2 https://reviews.llvm.org/D36182 Files: test/Tooling/Inputs/clang-diff-basic-src.cpp test/Tooling/clang-diff-basic.cpp test/Tooling/clang-diff-html.py tools/clang-diff/CMakeLists.txt

[PATCH] D36176: [clang-diff] Fix some errors and inconsistencies

2017-08-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D36176#830341, @arphaman wrote: > LGTM. Although I'm not 100% sure it's fully NFC, so if you can't come up with > a test please justify why. There are changes that affect the output. Firstly the computation of the rightmost descendant; the

[PATCH] D36664: [analyzer] Make StmtDataCollector customizable

2017-08-16 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 111316. johannes edited the summary of this revision. johannes removed a subscriber: rsmith. johannes added a comment. - fix comments - add unittest for the new node kinds - make `addData()` take a const reference https://reviews.llvm.org/D36664 Files:

[PATCH] D36664: [analyzer] Make StmtDataCollector customizable

2017-08-16 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 111317. johannes added a subscriber: rsmith. johannes added a comment. add https://reviews.llvm.org/D36664 Files: include/clang/AST/DataCollection.h include/clang/Analysis/CloneDetection.h lib/AST/CMakeLists.txt lib/AST/DataCollection.cpp

[PATCH] D36664: [analyzer] Make StmtDataCollector customizable

2017-08-16 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D36664#841758, @teemperor wrote: > Very well done, I really like this patch! I added a few remarks mostly about > the comments that need some small adjusting. > > I'm wondering what would be a nice way of creating a StmtDataCollector that >

[PATCH] D36686: [clang-diff] Add option to compare files across git revisions

2017-08-16 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 111328. johannes edited the summary of this revision. johannes added a comment. accept a commit range https://reviews.llvm.org/D36686 Files: tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp

[PATCH] D36686: [clang-diff] Add option to compare files across git revisions

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D36686#840827, @arphaman wrote: > It might be useful to have both source and destination in a different > revision. Maybe something like `-src-git-rev` and `-dst-git-rev`? Then I'd rather have a revision range such as `-git-revs ..` and if

[PATCH] D36179: [clang-diff] Move printing of matches and changes to clang-diff

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110608. johannes added a comment. initialize Node::Shift https://reviews.llvm.org/D36179 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp

[PATCH] D36184: [clang-diff] Filter AST nodes

2017-08-11 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110687. johannes added a comment. clarify test/Tooling/clang-diff-ast.cpp https://reviews.llvm.org/D36184 Files: lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-json.cpp Index:

[PATCH] D36185: [clang-diff] Fix similarity computation

2017-08-11 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110688. johannes added a comment. newline in error message https://reviews.llvm.org/D36185 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-bottomup.cpp test/Tooling/clang-diff-opt.cpp

[PATCH] D36184: [clang-diff] Filter AST nodes

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: test/Tooling/clang-diff-ast.cpp:68 +// nodes from other files are excluded +// CHECK-NOT {{.}} +#include "clang-diff-ast.cpp" arphaman wrote: > 1) Missing ':' > 2) What exactly does this regex accomplish? Right now it

[PATCH] D36664: [analyzer] Make StmtDataCollector customizable

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added subscribers: xazax.hun, mgorny. Herald added 1 blocking reviewer(s): teemperor. This moves the data collection macro calls for Stmt nodes to lib/AST/StmtDataCollectors.inc Users can subclass ConstStmtVisitor and include StmtDataCollectors.inc to

[PATCH] D36186: [clang-diff] Improve and test getNodeValue

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110952. johannes added a comment. add test for delegating initializer and unwritten initializer https://reviews.llvm.org/D36186 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp

[PATCH] D36179: [clang-diff] Move printing of matches and changes to clang-diff

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110945. johannes added a comment. format https://reviews.llvm.org/D36179 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-basic.cpp

[PATCH] D36185: [clang-diff] Fix similarity computation

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110951. johannes added a comment. comment getJaccardSimilarity https://reviews.llvm.org/D36185 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-bottomup.cpp test/Tooling/clang-diff-opt.cpp

[PATCH] D36187: [clang-diff] Use the relative name for NamedDecls

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110962. johannes added a comment. rebase https://reviews.llvm.org/D36187 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-basic.cpp

[PATCH] D36688: [clang-diff] Fix matching for unnamed NamedDecs

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added a subscriber: klimek. This makes Node::getIdentifier return a valid value for special NamedDecl nodes that do not have a name, such as ctors, dtors and unnamed classes / namespaces. https://reviews.llvm.org/D36688 Files:

[PATCH] D36685: [clang-diff] HTML diff navigation

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. This adds shortcuts j and k to jump between changes. It is especially useful in diffs with few changes. https://reviews.llvm.org/D36685 Files: tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp

[PATCH] D36687: [clang-diff] Match nodes with the same parent and same value

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. This adds another pass to the matching algorithm that tries to match nodes with common parents, if they have similar values. https://reviews.llvm.org/D36687 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp

[PATCH] D36686: [clang-diff] Add option to compare files across git revisions

2017-08-14 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. This adds a command line option "-git-rev=". When it is used, only one filename is accepted. The file in its version in the specified revision is compared against the current version. Note that this calls `git checkout` in the current directory.

[PATCH] D36179: [clang-diff] Move printing of matches and changes to clang-diff

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110552. johannes added a comment. add test for 'Move' and 'Update and Move' in output https://reviews.llvm.org/D36179 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp

[PATCH] D36182: [clang-diff] Add HTML side-by-side diff output

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110553. johannes edited the summary of this revision. johannes added a comment. change tests https://reviews.llvm.org/D36182 Files: test/Tooling/Inputs/clang-diff-basic-src.cpp test/Tooling/clang-diff-basic.cpp test/Tooling/clang-diff-html.test

[PATCH] D36184: [clang-diff] Filter AST nodes

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110555. johannes added a comment. refactor isNodeExcluded https://reviews.llvm.org/D36184 Files: lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-json.cpp Index: test/Tooling/clang-diff-json.cpp

[PATCH] D36183: [clang-diff] Simplify mapping

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110554. johannes added a comment. remove unused https://reviews.llvm.org/D36183 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/Inputs/clang-diff-basic-src.cpp test/Tooling/clang-diff-basic.cpp Index:

[PATCH] D36187: [clang-diff] Use the relative name for NamedDecls

2017-08-10 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 110557. johannes added a comment. substr https://reviews.llvm.org/D36187 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp test/Tooling/clang-diff-basic.cpp

[PATCH] D34748: [clang-diff] Fix multiple mappings.

2017-07-09 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D34748#802037, @arphaman wrote: > 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

[PATCH] D34748: [clang-diff] improve mapping accuracy, HTML side-by-side diff.

2017-07-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 107479. johannes retitled this revision from "[clang-diff] Fix multiple mappings." to "[clang-diff] improve mapping accuracy, HTML side-by-side diff.". Herald added a subscriber: mgorny. https://reviews.llvm.org/D34748 Files:

[PATCH] D34748: [clang-diff] improve mapping accuracy

2017-07-26 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 108370. johannes retitled this revision from "[clang-diff] improve mapping accuracy, HTML side-by-side diff." to "[clang-diff] improve mapping accuracy". https://reviews.llvm.org/D34748 Files: include/clang/Tooling/ASTDiff/ASTDiff.h

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-30 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes marked an inline comment as done. johannes added a comment. In https://reviews.llvm.org/D34329#796574, @teemperor wrote: > I didn't have time to have a close look at this patch, but it seems you're > interested in the specific TU-independent data of a Stmt to compare them. So > if you

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-29 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104664. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-29 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes marked 2 inline comments as done. johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:439 +// Computes an optimal mapping between two trees. +class ZsMatcher { + const ASTDiff::Impl arphaman wrote: > Do you know the reason for

[PATCH] D34329: [clang-diff] Initial implementation.

2017-07-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 105059. johannes edited the summary of this revision. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt

[PATCH] D34329: [clang-diff] Initial implementation.

2017-07-03 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D34329#798377, @arphaman wrote: > @johannes > Are you planning to work on integration with the `StmtDataCollector` in this > patch or would you prefer to follow-up with additional patches? Later would be better

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104394. johannes added a comment. - remove unused struct - rename getNodeValueI -> getNodeValueImpl https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104395. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104401. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt

[PATCH] D34329: [clang-diff] Initial implementation.

2017-07-05 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 105161. johannes added a comment. - style fixes - correct getSimilarity() https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp

[PATCH] D34329: [clang-diff] Initial implementation.

2017-06-27 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104249. johannes added a comment. - pass Options as a const reference instead of a pointer - rename TreeComparator -> ASTDiff::Impl, rename Comparator -> DiffImpl - move declaration of ASTDiff::Impl from the header to the source file so that Options does

[PATCH] D36187: [clang-diff] Use the relative name for NamedDecls

2017-08-18 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 111695. johannes added a comment. only use Enums as namespace prefix in C++11 https://reviews.llvm.org/D36187 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp test/Tooling/clang-diff-ast.cpp

[PATCH] D36187: [clang-diff] Use the relative name for NamedDecls

2017-08-18 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:371 + std::string ContextPrefix; + if (auto *Namespace = dyn_cast(Context)) +ContextPrefix = Namespace->getQualifiedNameAsString(); arphaman wrote: > You don't need to check both

[PATCH] D36989: [clang-diff] Refactor stop-after command-line flag

2017-08-22 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D36989#848835, @jgravelle-google wrote: > If you have more stop-after options it'd probably be simpler to leave it as > one field. I'll just rename it to "stop-diff-after" to avoid the name > collision. Ok, you can go ahead. Or, if I

[PATCH] D35948: [CommonOptionsParser] Expose ArgumentsAdjustingCompilationDatabase

2017-08-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes accepted this revision. johannes added a comment. This revision is now accepted and ready to land. This has already landed. https://reviews.llvm.org/D35948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-19 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D34329#784090, @arphaman wrote: > Generally we shouldn't have untested code in trunk, so I think that we need > to find a way to test this before committing. We can start off by testing the > output of the diff tool. Since there will be a

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-19 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103147. johannes added a comment. - style fixes - do not compare nodes from system headers https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103320. johannes added a comment. - Fix a bug in getSimilarity() - Change terminology: `label` -> `value` - Define SNodeId: Now it cannot be implicitly constructed from an int, however it can be converted to int. Still feels a bit weird - Fix some issues

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes marked 10 inline comments as done. johannes added inline comments. Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:123 + +void runDiff(ASTContext , ASTContext ); + klimek wrote: > This is the main exposed interface? > > Generally, if all we want to

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-19 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103151. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt tools/CMakeLists.txt tools/clang-diff/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103163. johannes added a comment. - Add the option to not use compilation databases. - Add a basic test. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-21 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103432. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt test/Tooling/clang-diff-basic.cpp tools/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-21 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:57 +/// Within a tree, this identifies a node by its preorder offset. +using NodeId = int; + arphaman wrote: > I think that it's better to make make `NodeId` a structure as well

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-23 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:730 + +Mapping TreeComparator::matchTopDown() const { + PriorityList L1(T1); arphaman wrote: > Johannes, it seems to me that your implementation of the top-down portion of > the

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-26 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104032. johannes added a comment. refactor https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-26 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:730 + +Mapping TreeComparator::matchTopDown() const { + PriorityList L1(T1); johannes wrote: > arphaman wrote: > > Johannes, it seems to me that your implementation of the top-down

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes marked an inline comment as done. johannes added a comment. In https://reviews.llvm.org/D34329#785190, @arphaman wrote: > Looking at the output of the tool, I have the following suggestion: > > - We should avoid implicit expressions (We don't need to see things like > `Insert

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:303 +/// Identifies a node in this subtree by its postorder offset. +using SNodeId = int; + arphaman wrote: > What's the difference between `SNodeId` and `NodeId`? NodeId is the preorder

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:171 + +std::string TreeRoot::label(NodeId Id) const { + const Node = getNode(Id); arphaman wrote: > I believe that this method that you call `label` actually represents the > `value`

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-20 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103208. johannes marked 7 inline comments as done. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-21 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 103409. johannes marked 4 inline comments as done. johannes added a comment. - move some unnecessary things out of the public header Is this a proper way to declutter the header file? Using inheritance would also be possible. I have to define a destructor

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-21 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:157 + int Leaves = 0; + std::function Traverse = [&](NodeId Id) { +const Node = getNode(Id); arphaman wrote: > you should be able to use `auto` instead of

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-18 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added subscribers: mgorny, klimek. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt tools/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-18 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 102986. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt tools/CMakeLists.txt tools/clang-diff/CMakeLists.txt

[PATCH] D34329: [GSoC] Clang AST diffing

2017-06-27 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 104124. https://reviews.llvm.org/D34329 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTDiffInternal.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/CMakeLists.txt lib/Tooling/CMakeLists.txt

[PATCH] D37663: [AST] Make RecursiveASTVisitor visit CXXOperatorCallExpr in source order

2017-09-11 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/AST/RecursiveASTVisitor.h:334 +case OO_Arrow: +case OO_Call: +case OO_Subscript: klimek wrote: > Why do we need to swap for calls? The idea is that the opening parenthesis/bracket comes after

[PATCH] D37383: [AST] Add TableGen for StmtDataCollectors

2017-09-06 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. @teemperor ok for you? did phabricator make you a blocking reviewer because of the affected code, or did I do that somehow? https://reviews.llvm.org/D37383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D37663: [AST] Make RecursiveASTVisitor visit CXXOperatorCallExpr in source order

2017-09-13 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 115018. johannes added a comment. use CXXOperatorCallExpr::isPrefixOp() to determine whether it's infix or postfix directly traverse statement children instead of copying https://reviews.llvm.org/D37663 Files: include/clang/AST/ExprCXX.h

[PATCH] D37663: [AST] Make RecursiveASTVisitor visit CXXOperatorCallExpr in source order

2017-09-13 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/AST/RecursiveASTVisitor.h:327 + + SmallVector getStmtChildren(CXXOperatorCallExpr *CE) { +SmallVector Children(CE->children()); rsmith wrote: > The copy here is more expensive than I'd like. Instead

[PATCH] D37662: [AST] Make RecursiveASTVisitor visit TemplateDecls in source order

2017-09-09 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. This causes template arguments to be traversed before the templated declaration, which is useful for clients that expect the nodes in the same order as they are in the source code. Additionally, there seems to be no good reason not to do so. This was moved here

[PATCH] D37663: [AST] Make RecursiveASTVisitor visit CXXOperatorCallExpr in source order

2017-09-09 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. This adds a special case for traversing CXXOperatorCallExpr. Its children are traversed in the order in which they appear in the source code, so infix and postfix operators are visited after their first argument. This behavior was previously only in

[PATCH] D37072: [clang-diff] Properly clear the selection in HTML diff

2017-08-23 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. https://reviews.llvm.org/D37072 Files: tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp === --- tools/clang-diff/ClangDiff.cpp +++ tools/clang-diff/ClangDiff.cpp @@ -140,9

[PATCH] D37004: [clang-diff] Fix the html output for CXXOperatorCallExpr

2017-08-23 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112416. johannes added a comment. provide a test need to update the maxsize parameter to -s=200 here because the test file is expected to fit within this size https://reviews.llvm.org/D37004 Files: test/Tooling/Inputs/clang-diff-basic-src.cpp

[PATCH] D36686: [clang-diff] Add option to compare files across git revisions

2017-08-22 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112127. johannes added a comment. casing https://reviews.llvm.org/D36686 Files: tools/clang-diff/ClangDiff.cpp Index: tools/clang-diff/ClangDiff.cpp === --- tools/clang-diff/ClangDiff.cpp

  1   2   >