Page MenuHomePhabricator

[clang-diff] Support templates
Needs ReviewPublic

Authored by johannes on Aug 22 2017, 2:16 AM.

Details

Reviewers
arphaman
Summary

TemplateName and TemplateArgument are now treated as nodes.

Event Timeline

johannes created this revision.Aug 22 2017, 2:16 AM
arphaman added inline comments.Aug 24 2017, 6:46 AM
lib/Tooling/ASTDiff/ASTDiff.cpp
295

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.

johannes updated this revision to Diff 112673.Aug 25 2017, 3:03 AM
johannes edited the summary of this revision. (Show Details)

use LexicallyOrderedRecursiveASTVisitor