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

Manuel Klimek klimek at google.com
Mon Jul 23 05:06:10 PDT 2012


On Mon, Jul 23, 2012 at 1:24 PM, Daniel Jasper <djasper at google.com> wrote:
> -/// To and T are in the same type hierarchy, and thus dyn_cast can be
> -/// called to convert a To to a T.
> +///   ArgumentAdaptingMatcher<HasMatcher, T>(InnerMatcher);
>
> I'd keep the "To and T ..." sentence, as it helps understanding.

Reworded the new example. The dyncast example was out-of-date due to
the dyncast matchers actually not requiring the argument adjustment...

> Also please include an explanation of the CXXMemberCall change in the commit
> message, as it is a somewhat unrelated change.

Willdo.

> The rest looks good to me.
>
> Cheers,
> Daniel
>
>
> On Thu, Jul 19, 2012 at 7:26 PM, Manuel Klimek <klimek at google.com> wrote:
>>
>> 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: 14040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120723/51518731/attachment.obj>


More information about the cfe-commits mailing list