[cfe-commits] [PATCH] Adds a .bind("id") method to bind AST matchers to replace the id("id", ...) matcher

Manuel Klimek klimek at google.com
Thu Jul 19 10:26:09 PDT 2012


This patch implements one of Chandler's wishes:

You can now say:
record(hasName("::X")).bind("x")
instead of
id("x", record(hasName("::X"))

We also now allow binding only on the dynamic cast matchers (which are
the ones named with nouns in the language),
as those don't introduce ambiguities on which part is bound (the node
the matcher is a predicate on, or the node
the matcher's submatchers will be matched on).

Also fixes some minor issues that were in the way of the bind change.

We don't change all users of id() yet - I first want to merge the
tooling branch and make sure we don't run into anything
unexpected.

Cheers,
/Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bind.patch
Type: application/octet-stream
Size: 13561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120719/1ac5cabc/attachment.obj>


More information about the cfe-commits mailing list