arphaman added inline comments.

================
Comment at: lib/Tooling/ASTDiff/ASTDiff.cpp:299
   }
+// We want nodes to be in the same order as in the source code.
+// So we traverse template parameters before the remainder of the declaration.
----------------
Interesting, I didn't know that this iteration happened out-of-order. My 
https://reviews.llvm.org/D35012 patch (I'll commit it right now) has a 
RecursiveASTVisitor subclass that tries to traverse the tree in the source 
order, I think you should move this code:

```
  DEF_TRAVERSE_TMPL_DECL_(Class)
  DEF_TRAVERSE_TMPL_DECL_(Var)
  DEF_TRAVERSE_TMPL_DECL_(Function)
```

to `LexicallyOrderedRecursiveASTVisitor` subclass instead and change your 
visitor to derive from `LexicallyOrderedRecursiveASTVisitor`. You can probably 
repurpose https://reviews.llvm.org/D36998 and have both the visibility change 
and the move to `LexicallyOrderedRecursiveASTVisitor` in that patch.


https://reviews.llvm.org/D37003



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D37003: [cla... Johannes Altmanninger via Phabricator via cfe-commits
    • [PATCH] D37003:... Alex Lorenz via Phabricator via cfe-commits
    • [PATCH] D37003:... Johannes Altmanninger via Phabricator via cfe-commits

Reply via email to