-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IRGen] Other instructions whose ops/results have packs may allocate pack metadata. #67569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When it's a tuple containing a pack.
Add the recursive property.
@swift-ci please test |
@swift-ci please test linux platform |
lib/AST/Type.cpp
Outdated
RecursiveTypeProperties::HasArchetype, InterfaceType, | ||
ConformsTo, Superclass, Layout, GenericEnv) { | ||
RecursiveTypeProperties::HasArchetype | | ||
RecursiveTypeProperties::HasConcretePack, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s actually PackExpansionType that leads us into this situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's a PackExpansionType whose pattern is a PackArchetypeType:
(tuple_type num_elements=1
(tuple_type_elt
(pack_expansion_type
(pattern=pack_archetype_type address=0x127045b10
(interface_type=dependent_member_type assoc_type=Swift.(file).Sequence.Element
(base=generic_type_param_type depth=0 index=0 decl=main.(file).tupleExpansionWithMemberType(seqs:elts:)[email protected]:1:47 pack)) name=(each T).Element
)
(count=pack_archetype_type address=0x127045880
(interface_type=generic_type_param_type depth=0 index=0 decl=main.(file).tupleExpansionWithMemberType(seqs:elts:)[email protected]:1:47 pack) conforms_to=Swift.(file).Sequence name=each T
))))
Eliminated HasConcretePack and added HasPack and HasPackArchetype. Renamed the old `hasPack` to `hasAnyPack`; as before, it means that the type has a parameter pack, a pack, or a pack archetype.
@swift-ci please test |
b4f32b4
to
b0911d1
Compare
Instead of assuming that the list of instructions known to allocate pack metadata is exhaustive and returning false from mayRequirePackMetadata for all others, consider the types of the results and operands of other instructions and look for packs.
b0911d1
to
928bcf3
Compare
@swift-ci please test |
Based on #67567 .
Instead of assuming that the list of instructions known to allocate pack metadata is exhaustive and returning false from mayRequirePackMetadata for all others, consider the types of the results and operands of other instructions and look for packs.