[super! 2/6] Give each convention a single overload type - #67
Open
mingxwa wants to merge 1 commit into
Open
Conversation
A convention used to carry a tuple-like overload_types, so adding a convention had to search Cs for an existing convention with the same is_direct and dispatch_type and merge the overload lists into it. That merge is the only reason add_conv_t, merge_conv_t, add_conv_reduction, and conv_specialization_t exist. Replace overload_types with a single overload_type, so add_convention contributes one convention per overload and merging a convention into Cs becomes deduplicating concatenation. Duplicates are still collapsed, so build() is unaffected at both compile time and run time. Accessors still have to be formed per dispatch type, or a dispatch with several overloads would contribute several accessor bases instead of one overload set. Regroup the conventions by dispatch type via conv_group and conv_groups_merge_t just before generating the accessors, which also keeps overload shadowing working. Generalize the reduction helpers to carry extra arguments (reduction_t) and add flattening_merge_t, which merge_tuples_t and conv_groups_merge_t are both expressed in terms of. This changes the ProBasicConvention and ProConvention requirements, so a hand-written convention type must be updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A convention carried a tuple-like
overload_types, so adding a convention had to searchCsfor an existing convention with the sameis_directanddispatch_typeand merge the overload lists into it. That merge is the only reasonadd_conv_t,merge_conv_t,add_conv_reduction, andconv_specialization_texist.overload_typesbecomes a singleoverload_type.add_conventioncontributes one convention per overload, and merging a convention intoCsbecomes deduplicating concatenation. Duplicates are still collapsed, so build is unaffected at both compile time and run time.conv_groupandconv_groups_merge_tregroup the conventions by dispatch type just before generating the accessors, which also keeps overload shadowing working.reduction_t) and addsflattening_merge_t, whichmerge_tuples_tandconv_groups_merge_tare both expressed in terms of.Breaking change. ProBasicConvention and ProConvention change, so a hand-written convention type must be updated.