[cfe-dev] Suggestion for new AST-matchers

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 11 09:32:41 PDT 2020


On Wed, Mar 11, 2020 at 10:21 AM Kim Viggedal <kimviggedal at gmail.com> wrote:
>
> I think these matchers could be useful in many cases, or maybe just the one tidy check, I think it's hard to tell myself.
> So I guess I'll just start out with trying them out as local matchers for one check and take it from there if I can find more uses for them.

I think that's a good approach. We often start with a local matcher in
a clang-tidy check and then hoist it out to be a global matcher once
we've found a second need for it. That seems to strike a pretty good
balance.

~Aaron

>
> Den ons 11 mars 2020 kl 13:06 skrev Aaron Ballman <aaron at aaronballman.com>:
>>
>> On Wed, Mar 11, 2020 at 7:11 AM Kim Viggedal via cfe-dev
>> <cfe-dev at lists.llvm.org> wrote:
>> >
>> > I was thinking it might be worthwhile to add a few AST-matchers, something like
>> > isAssociativeOperator, isCommutativeOperator and maybe isDistributiveOperator.
>> >
>> > I'm still quite new in the clang community so before starting to work on them I would like to check if they have potential to be accepted.
>> >
>> > So, might these matchers be relevant for clang?
>>
>> It's possible! When we add new AST matchers, we typically want there
>> to be some obvious uses for the matcher (for instance, clang-tidy
>> checks that could be refactored to use them, new clang-tidy checks
>> made possible, etc). It's not immediately obvious to me what these
>> matchers would be used for in general as opposed to being a local
>> matcher used by 1-2 checks, however, you may have other ideas in mind
>> that I'm not thinking of.
>>
>> ~Aaron
>>
>> >
>> > --
>> > /Kim Viggedal
>> > _______________________________________________
>> > cfe-dev mailing list
>> > cfe-dev at lists.llvm.org
>> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
>
> --
> /Kim Viggedal


More information about the cfe-dev mailing list