[cfe-commits] [PATCH] AST matchers

Manuel Klimek klimek at google.com
Fri Jun 15 05:49:53 PDT 2012

... one of the final pieces that we have in the tooling branch are the AST

The main user interface is in ASTMatchers.h and ASTMatchFinder.h.

Note that the AST matchers are completely independent of the tooling
framework, but they are easy to plug into the tooling framework (see

(There's also a dynamic way to contruct matchers in the works by Samuel
Benzaquen, but it's not included in this patch, as it is a pure addition to
the  proposed matcher library)

We've been using the library to drive large scale changes, metrics and
analysis internally for > 1 year now.

One of the more nit-picky review questions that I don't know what to do
about is style:
Matchers are an in-language DSL. We use meta-programming techniques to be
able to contruct readable expressions without the need to spell out the
types all the time. This leads to the matcher constructions being boths
free-standing functions and call-able classes.
Internally, we've used CamelCase with an upper case first letter for the
matchers, but I'm fine with changing it either way.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120615/73eeb777/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ast-matchers.patch
Type: application/octet-stream
Size: 217956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120615/73eeb777/attachment.obj>

More information about the cfe-commits mailing list