[cfe-commits] [PATCH] Implements hasAncestor.

Manuel Klimek reviews at llvm-reviews.chandlerc.com
Wed Sep 5 06:53:42 PDT 2012


Hi djasper, mdiamond,

A first shot at implementing the hasAncestor matcher. This builds
on the previous patch that introduced DynTypedNode to build up
a parent map for an dditional degree of freedom in the AST traversal.

The map is only built once we hit an hasAncestor matcher, in order
to not slow down matching for cases where this is not needed.

We could implement some speed-ups for special cases, like building up
the parent map as we go and only building up the full map if we break
out of the already visited part of the tree, but that is probably
not going to be worth it, and would make the code significantly more
complex.

http://llvm-reviews.chandlerc.com/D36

Files:
  include/clang/ASTMatchers/ASTMatchers.h
  include/clang/ASTMatchers/ASTMatchersInternal.h
  include/clang/ASTMatchers/ASTTypeTraits.h
  lib/ASTMatchers/ASTMatchFinder.cpp
  unittests/ASTMatchers/ASTMatchersTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36.1.patch
Type: text/x-patch
Size: 13755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120905/02bd9172/attachment.bin>


More information about the cfe-commits mailing list