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

2018-08-27 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D34329#1213667, @sylvestre.ledru wrote: > @arphaman @johannes Is that normal that clang-diff isn't installed by cmake? > (like clang-format?) Yes, we did not add that. I don't know if anyone would use it. Repository: rL LLVM https://re

[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 tools/clang-diff/

[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 tools/clan

[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 lib/Tooling

[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 lo

[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 tools/clan

[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 lib/Tooling/ASTDiff/CMakeLists.txt

[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 &AST1, ASTContext &AST2); + klimek wrote: > This is the main exposed interface? > > Generally, if all w

[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 test/Tooling/clang-diff-

[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 ImplicitCa

[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 &N = 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 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 wit

[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 &N = getNode(Id); arphaman wrote: > you should be able to use `auto` instead of `std::function` here I

[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 tools/cl

[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 a

[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 GumTree

[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 porti

[PATCH] D37001: [clang-diff] Use data collectors for node comparison

2017-08-25 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D37001#852442, @arphaman wrote: > Can you remove `getNodeValue` now or do you still need it? It is only used in the client, I think it makes sense to move it there, or to remove it altogether. I think I'd keep it in the client for now, to d

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

2017-08-25 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: tools/clang-diff/ClangDiff.cpp:319 + "A Binary operator is supposed to have two arguments."); +for (int I : {1, 0, 2}) + Offset = printHtmlForNode(OS, Diff, Tree, IsLeft, Children[I], Offset); arphama

[PATCH] D36998: [AST] Traverse templates in LexicallyOrderedRecursiveASTVisitor

2017-08-25 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112707. johannes added a comment. test ordering, class template https://reviews.llvm.org/D36998 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h include/clang/AST/RecursiveASTVisitor.h unittests/Tooling/LexicallyOrderedRecursiveASTVisit

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-27 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added a subscriber: klimek. This affects overloaded operators, which are represented by a CXXOperatorCallExpr whose first child is always a DeclRefExpr referring to the operator. For infix, postfix and call operators we want the first argument to be traversed

[PATCH] D37201: [clang-diff] Use correct SourceRange for CXXConstructExpr

2017-08-27 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added a subscriber: klimek. This way the variable name of a declaration is not included https://reviews.llvm.org/D37201 Files: test/Tooling/Inputs/clang-diff-basic-src.cpp test/Tooling/clang-diff-basic.cpp test/Tooling/clang-diff-html.test Index: t

[PATCH] D37005: [clang-diff] Initial implementation of patching

2017-08-27 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112845. johannes retitled this revision from "Add include/clang/Tooling/ASTDiff/ASTPatch.h" to "[clang-diff] Initial implementation of patching". johannes edited the summary of this revision. johannes added a comment. use rewriter to patch a third AST htt

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h:75 + Derived &getDerived() { return *static_cast(this); } + arphaman wrote: > I don't think you need this since `getDerived` in RecursiveASTVisitor is > alread

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112885. johannes added a comment. use RecursiveASTVisitor::TraverseStmt https://reviews.llvm.org/D37200 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.cpp Index: unittests/Tooli

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112889. johannes added a comment. do call derived TraverseStmt for children of CXXOperatorCallExpr https://reviews.llvm.org/D37200 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h include/clang/AST/RecursiveASTVisitor.h unittests/Toolin

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. The previous version didn't call TraverseDecl of the derived class, this is fixed now. The public getDerived.TraverseStmt() does not accept a DataRecursionQueue, so this also could not be used (I think) I used the wrapper TraverseStmtBase, which should behave exactly a

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112894. johannes added a comment. detect prefix/postfix from number of arguments https://reviews.llvm.org/D37200 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h include/clang/AST/RecursiveASTVisitor.h unittests/Tooling/LexicallyOrdered

[PATCH] D37005: [clang-diff] Initial implementation of patching

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112926. johannes edited the summary of this revision. johannes added a comment. split to ASTDiff/ASTPatch https://reviews.llvm.org/D37005 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTPatch.h lib/Tooling/ASTDiff/ASTD

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 112951. johannes added a comment. use a specialized getStmtChildren to fix the order for CXXOperatorCallExpr https://reviews.llvm.org/D37200 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h include/clang/AST/RecursiveASTVisitor.h unitte

[PATCH] D37200: [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor

2017-08-28 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. Yeah, this seems to be the best solution for this. I think I ran into the same issue when working on the StmtDataCollector - basically there can only be two Traverse*, one in the Derived class and the other one needs to do all the magic with walking the specialisation

[PATCH] D36998: [AST] Traverse templates in LexicallyOrderedRecursiveASTVisitor

2017-08-29 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. This is currently broken, if a user provides a TraverseClassTemplateDecl, then the same method in this class will not be called, I think I will add a flag (probably not user visible) in RecursiveASTVisitor.h to switch the order for templates https://reviews.llvm.org/

[PATCH] D37005: [clang-diff] Initial implementation of patching

2017-08-29 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 113078. johannes added a comment. fixes https://reviews.llvm.org/D37005 Files: include/clang/Tooling/ASTDiff/ASTDiff.h include/clang/Tooling/ASTDiff/ASTPatch.h lib/Tooling/ASTDiff/ASTDiff.cpp lib/Tooling/ASTDiff/ASTPatch.cpp lib/Tooling/ASTDiff/C

[PATCH] D37005: [clang-diff] Initial implementation of patching

2017-08-29 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: include/clang/Tooling/ASTDiff/ASTDiff.h:73 public: + /// Empty (invalid) SyntaxTree. + SyntaxTree(); arphaman wrote: > Why do you need to create an empty tree? What about using llvm::Optional > instead? ok, i use op

[PATCH] D37001: [clang-diff] Use data collectors for node comparison

2017-09-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added inline comments. Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:537 + +#include "../../AST/DeclDataCollectors.inc" + arphaman wrote: > I didn't realize that you're including files from within `lib`. That's not > ideal. You should add a pre-commit tha

[PATCH] D36998: [AST] Traverse templates in LexicallyOrderedRecursiveASTVisitor

2017-09-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 113546. johannes added a comment. fix by adding an option in RecursiveASTVisitor https://reviews.llvm.org/D36998 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h include/clang/AST/RecursiveASTVisitor.h unittests/Tooling/LexicallyOrdered

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

2017-09-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added a subscriber: mgorny. Herald added 1 blocking reviewer(s): teemperor. This adds an option "-gen-clang-data-collectors" to the Clang TableGen that is used to generate StmtDataCollectors.inc. https://reviews.llvm.org/D37383 Files: include/clang/AST/C

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

2017-09-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D37383#858905, @teemperor wrote: > @arphaman I suggested tablegen in https://reviews.llvm.org/D36664 because I > remembered we had some CMake sanity check about not having an *.inc in our > include dir: > https://github.com/llvm-mirror/clan

[PATCH] D36998: [AST] Traverse templates in LexicallyOrderedRecursiveASTVisitor

2017-09-01 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes updated this revision to Diff 113581. johannes added a comment. undo visibility change https://reviews.llvm.org/D36998 Files: include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h include/clang/AST/RecursiveASTVisitor.h unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.

[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 http://lis

[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 fro

[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 LexicallyOrdere

[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] 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 include/clang/

[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 o

[PATCH] D40781: [DataCollection] Allow choosing between collection categories

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes created this revision. Herald added 1 blocking reviewer(s): teemperor. Herald added a subscriber: ilya-biryukov. This adds a list of collection categories to ClangDataCollectorsEmitter.cpp, in an aim to eventually unify the various AST hashing mechanisms (each one will get its own categor

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D40731#943469, @stettberger wrote: > @Eugene.Zelenko Thank you for pointing me out on these issues. I ran > clang-tidy and clang-format on CHashVisitor.h > > @rsmith You're right, there is already more than one implemenation of > {partial,un

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. So you can define a category for cHash and add `let cHash = [{ .. }]` or `let cHash = TypeIIClone;` if you just want to reuse it. With this patch you can also use !codeconcat to append some code: https://reviews.llvm.org/D40782 Repository: rC Clang https://reviews.

[PATCH] D40731: Integrate CHash into CLang

2017-12-04 Thread Johannes Altmanninger via Phabricator via cfe-commits
johannes added a comment. In https://reviews.llvm.org/D40731#943564, @stettberger wrote: > For my changes to StmtDataCollectors: I tried to leave the already existing > entries in StmtDataCollector.td untouched and the test-cases still work OK. > If there is something somebody could break by ch

[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 http://lists.llvm.org/cgi-bin/mailman/l

[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] 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 &Tree) = delete; ~SyntaxTree(); arphaman wrote: > It might be better to add a move co

[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 lib/Tooling

[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 test/Tooling/cl

[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: too

[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 test/Tooling/clang-diff-b

[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: tools/clang-diff/ClangDiff.

[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 tools/clang-diff/ClangDiff.c

[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 test/Tooli

[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] 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 tes

[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 test/Tooling/clang-diff

[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 test/Tooling/clang-dif

[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 &Tree) = delete; ~SyntaxTree(); arphaman wrote: > johannes wrote: > > arphaman wrote:

[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 lat

[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 work

[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 -no-co

[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 col

[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] 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] 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] 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 In

[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 test/Toolin

[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] 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] 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 tools/clang

[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] 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 t

[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 lib/Tooling/ASTDiff/A

[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 tes

[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 too

[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: te

[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] 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 test/Tooling/clang-diff-html

[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 test/Tooling/clang-diff-basic.cp

[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 w

[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: test/Tooling/clang-diff-json.cpp

[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 test/To

[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 define

[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 tools/clang-

[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 tes

[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 test/Tool

[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 test/Tooling/clang-diff-html

[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] 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. https://reviews.l

[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 test/Tooling/clang-di

[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: lib/Tooling/ASTDiff/ASTDiff

  1   2   >