[PATCH] ASTMatcher for Attr

Jacques Pienaar jpienaar at google.com
Thu Aug 21 16:10:56 PDT 2014


It is to make the interface a bit easier. The dynamic matcher is at runtime
where we don't have access to the constants. So the string conversion
allows referring to attributes via a name instead of raw the enum value.
On Aug 21, 2014 4:03 PM, "Manuel Klimek" <klimek at google.com> wrote:

>
>
> On Thu Aug 21 2014 at 3:54:28 PM Aaron Ballman <aaron at aaronballman.com>
> wrote:
>
>> On Thu, Aug 21, 2014 at 6:45 PM, Manuel Klimek <klimek at google.com> wrote:
>> >
>> >
>> > On Thu Aug 21 2014 at 3:37:22 PM Aaron Ballman <aaron at aaronballman.com>
>> > wrote:
>> >>
>> >> On Thu, Aug 21, 2014 at 5:56 PM, Manuel Klimek <klimek at google.com>
>> wrote:
>> >> > +richard, since this is now touching lib/Basic...
>> >> >
>> >> > Looks good to me, but I want Richard to take a look whether this
>> makes
>> >> > sense or should be solved differently.
>> >>
>> >> I am confused as to why the solution switched away from using the
>> >> AttrKind enum value and is now using a string.
>> >
>> >
>> > Note that the string is only for the dynamic matchers - the normal C++
>> > matchers still use the enum.
>>
>> I hadn't noticed that; thank you for pointing it out! But at the risk
>> of demonstrating my ignorance, I guess I still don't understand why
>> the string is an improvement. AttrKinds.h is in Basic, so it's
>> available everywhere.
>>
>
> I'm not sure what you mean - for the dynamic matchers we definitely need
> to be able to construct them from a string...
>
>
>>
>> ~Aaron
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140821/9e14049f/attachment.html>


More information about the cfe-commits mailing list