Details
- Reviewers
aaron.ballman ilya-biryukov sammccall martong - Commits
- rZORG08949dedaf15: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rZORG94e36858bf08: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rG08949dedaf15: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rG94e36858bf08: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rGad3314b14659: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rL361117: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rC361117: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rG0855896c687a: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rC361033: Add a Visit overload for DynTypedNode to ASTNodeTraverser
rL361033: Add a Visit overload for DynTypedNode to ASTNodeTraverser
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 31789 Build 31788: arc lint + arc unit
Event Timeline
Any code which has a DynTypedNode and wishes to traverse it.
I envisage this as a more-flexible DynTypedNode::dump that the user does not have to implement themselves in order to use the ASTNodeTraverser.
Do we currently have any such code that's using this functionality, though? I'm mostly concerned that this is dead code with no testing, currently. The functionality itself seems reasonable enough and the code looks correct enough, so if this is part of a series of planned changes, that'd be good information to have for the review.
Ah, yes. This is supposed to be 'useful public API' like the other Visit methods for use inside and outside the codebase. A follow-up patch will use it, but it's provided for external use too anyway.
I'll add a unit test.
Ahh, thank you! It makes a lot more sense to me now. LGTM aside from some nits.
include/clang/AST/ASTNodeTraverser.h | ||
---|---|---|
208 | Can you add a comment here: // FIXME: Improve this with a switch or a visitor pattern. (We have a similar comment in similar-looking code in ASTMatchFinder.cpp:476.) | |
unittests/AST/ASTTraverserTest.cpp | ||
75 ↗ | (On Diff #199992) | Did clang-format produce this formatting? (If not, run through clang-format.) |
89 ↗ | (On Diff #199992) | Name instead |
97 ↗ | (On Diff #199992) | DumpString -- same elsewhere. |
unittests/AST/ASTTraverserTest.cpp | ||
---|---|---|
75 ↗ | (On Diff #199992) | Yep, clang-format made it like this. |
unittests/AST/ASTTraverserTest.cpp | ||
---|---|---|
75 ↗ | (On Diff #199992) | Weird that it added the extra whitespace -- I think this is the only instance where we have whitespace to either side of the adornments, which is what caught me by surprise. |
Can you add a comment here: // FIXME: Improve this with a switch or a visitor pattern. (We have a similar comment in similar-looking code in ASTMatchFinder.cpp:476.)