This is an archive of the discontinued LLVM Phabricator instance.

[ASTMatchers] Make Param functors variadic
ClosedPublic

Authored by steveire on Feb 21 2021, 9:57 AM.

Diff Detail

Event Timeline

steveire requested review of this revision.Feb 21 2021, 9:57 AM
steveire created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2021, 9:57 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This was part of an early attempt to implement mapAnyOf. It's not needed, but it seems like a better idea to have one variadic class than multiple Param1/2 classes.

steveire updated this revision to Diff 325319.Feb 21 2021, 10:01 AM

Update comments

njames93 requested changes to this revision.Feb 21 2021, 1:15 PM
njames93 added a reviewer: klimek.

This change is going to break the dump_ast_matchers script. So that will need updating to ensure everything is all correct.

This revision now requires changes to proceed.Feb 21 2021, 1:15 PM
steveire updated this revision to Diff 325409.Feb 22 2021, 3:06 AM

Update dump script

Good catch! Updated the docs generating script.

Is it not nicer to name the class PolymorphicMatcher and do away with WithParamN, It may require partial specialization for the empty parameters case.
But I think it would be worth it.

Is it not nicer to name the class PolymorphicMatcher and do away with WithParamN, It may require partial specialization for the empty parameters case.
But I think it would be worth it.

I'm not sure any partial specialization is needed?

njames93 accepted this revision.Mar 2 2021, 2:20 PM

LGTM, assuming none of the later changes have effected the documentation script.

Is it not nicer to name the class PolymorphicMatcher and do away with WithParamN, It may require partial specialization for the empty parameters case.
But I think it would be worth it.

I'm not sure any partial specialization is needed?

Oh neat, I wasn't sure if the empty tuple would cause some issues.

This revision is now accepted and ready to land.Mar 2 2021, 2:20 PM
This revision was landed with ongoing or failed builds.Mar 3 2021, 3:41 AM
This revision was automatically updated to reflect the committed changes.