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
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:
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
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
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
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:
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:
> >
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
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
===
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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;
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
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
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
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
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
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
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:
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
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
>
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
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
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
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:
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
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
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
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
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
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
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
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:
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
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
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.
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
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
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
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:
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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`
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 - 100 of 180 matches
Mail list logo