ymandel added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:286
+
+ virtual llvm::Optional TraversalKind() const
{
+return {};
aaron.ballman wrote:
> `traversalKind()`
Stephen -- What was the resolution on this comment? I came
steveire added a comment.
I tried using DenseMap, but couldn't make it compile. I stuck with std::map for
now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61837/new/
https://reviews.llvm.org/D61837
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0a717d5b5d31: Make it possible control matcher traversal
kind with ASTContext (authored by stephenkelly).
Changed prior to commit:
https://reviews.llvm.org/D61837?vs=230678&id=232661#toc
Repository:
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM with a few minor nits.
Comment at: clang/include/clang/AST/ASTContext.h:3009
class ParentMap;
- std::unique_ptr Parents;
+ std::map> Parents;
--
steveire updated this revision to Diff 230678.
steveire added a comment.
Rebase and update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61837/new/
https://reviews.llvm.org/D61837
Files:
clang/include/clang/AST/ASTContext.h
clang/include/clang
steveire marked an inline comment as done.
steveire added inline comments.
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:240
+
+ assert(RestrictKind.isBaseOf(NodeKind));
+ if (Implementation->dynMatches(N, Finder, Builder)) {
aaron.ballman wrote:
> stevei
aaron.ballman added inline comments.
Comment at: lib/AST/ASTContext.cpp:120
+ASTContext::TraverseIgnored(const ast_type_traits::DynTypedNode &N) {
+ if (auto E = N.get()) {
+return ast_type_traits::DynTypedNode::create(*TraverseIgnored(E));
aaron.ballman wro
steveire marked an inline comment as done.
steveire added inline comments.
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:240
+
+ assert(RestrictKind.isBaseOf(NodeKind));
+ if (Implementation->dynMatches(N, Finder, Builder)) {
aaron.ballman wrote:
> Add an
aaron.ballman added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:718
+template
+internal::Matcher traverse(ast_type_traits::TraversalKind TK,
+ const internal::Matcher &InnerMatcher) {
steveire wrote:
> aaron.
steveire marked 2 inline comments as done.
steveire added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:718
+template
+internal::Matcher traverse(ast_type_traits::TraversalKind TK,
+ const internal::Matcher &InnerMatcher) {
---
steveire updated this revision to Diff 199884.
steveire added a comment.
Update
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61837/new/
https://reviews.llvm.org/D61837
Files:
include/clang/AST/ASTContext.h
include/clang/AST/ASTNodeTraverser.h
include/clan
aaron.ballman added inline comments.
Comment at: include/clang/AST/ASTContext.h:562-563
public:
+ ast_type_traits::TraversalKind GetTraversalKind() const { return Traversal; }
+ void SetTraversalKind(ast_type_traits::TraversalKind TK) { Traversal = TK; }
+
ste
steveire added inline comments.
Comment at: include/clang/AST/ASTContext.h:562-563
public:
+ ast_type_traits::TraversalKind GetTraversalKind() const { return Traversal; }
+ void SetTraversalKind(ast_type_traits::TraversalKind TK) { Traversal = TK; }
+
aaron.ba
steveire updated this revision to Diff 199875.
steveire marked 10 inline comments as done.
steveire added a comment.
Update
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61837/new/
https://reviews.llvm.org/D61837
Files:
include/clang/AST/ASTContext.h
include
aaron.ballman added a comment.
Thanks for this -- it looks like really interesting functionality! I've mostly
found nits thus far, but did have a question about clang-query support for it.
Comment at: include/clang/AST/ASTContext.h:562-563
public:
+ ast_type_traits::Traversa
steveire updated this revision to Diff 199185.
steveire added a comment.
Format
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61837/new/
https://reviews.llvm.org/D61837
Files:
include/clang/AST/ASTContext.h
include/clang/AST/ASTNodeTraverser.h
include/clan
steveire updated this revision to Diff 199181.
steveire added a comment.
Format
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61837/new/
https://reviews.llvm.org/D61837
Files:
include/clang/AST/ASTContext.h
include/clang/AST/ASTNodeTraverser.h
include/clan
steveire added a comment.
@klimek This includes a test for the memoization case you were interested in at
EuroLLVM.
In this iteration of the API, the traversal kind is changed by using a new
`traverse` matcher, which gives the user control over whether
invisible/implicit nodes are skipped or n
steveire created this revision.
steveire added reviewers: klimek, aaron.ballman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This will eventually allow traversal of an AST while ignoring invisible
AST nodes. Currently it depends on the available enum values for
Traversa
19 matches
Mail list logo