[cfe-commits] [PATCH] First step towards adding a parent map to the ASTContext.

Manuel Klimek klimek at google.com
Tue Jan 8 04:31:55 PST 2013


This does not yet implement the LimitNode approach discussed via email,
but I want to get some opinions in what that interface should look like
and how we'd want it to behave. If there's agreement that this is
generally desirable, I'll pull the ASTTypeTraits into AST/.

The impact of this is an O(n) in the number of nodes in the AST
reduction of complexity for certain kinds of matchers (as otherwise the
parent map gets recreated for every new MatchFinder).

Open questions:
- if we implement a second version with a LimitNode, do we want to cache
  those results at all (it's hard, because of the
  multiple-parents-problem).
- do we want to leave the RAV implementation in ASTContext (which is
  already large), or pull it out into an ASTContextInternal header (or
  similar)?
- this introduces ast_type_traits::DynTypedNode into a more prominent
  location - if there's problems with that approach, now is the time to
  point it out to me :)

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

Files:
  include/clang/AST/ASTContext.h
  include/clang/ASTMatchers/ASTTypeTraits.h
  lib/ASTMatchers/ASTMatchFinder.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D267.1.patch
Type: text/x-patch
Size: 11317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130108/460219d1/attachment.bin>


More information about the cfe-commits mailing list