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?
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
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 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