6.2: [InlineArray] Fix outlining metadata collection. #83711
Merged
+14
−0
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.
Explanation: Fix a compiler crash when emitting outlined value functions for
InlineArray<_, Tuple>
.When an
InlineArray
is handled indirectly (e.g. it has a dynamic layout--via generics, resilient types, or an integer generic size--or it's passed as an argument and is "large") and is copied, destroyed, or released, an outlined value function is emitted for that operation. That function needs access to the types used in the element type of theInlineArray
to perform its work. The metadata for such types that can't be discovered within the function (e.g.T
) are passed as arguments.Previously, it happened to get access to them some of the time, but not always, which resulted in compiler crashes when performing value operations on indirect
InlineArray<_, Tuple>
s. Here, this is fixed by ensuring the metadata required for the element type is passed to the outlined value functions.Scope: Affects
InlineArray
.Issue: rdar://155668963
Original PR: #83683
Risk: Low, just adds a missing override in IRGen's representation of
InlineArray
. The implementation results in more types being passed to the outline value functions. If the implementation is wrong, it will either be because 1. not all the types required for the function are passed in which case the same style of crash as already happens will occur or 2. more types than are necessary are passed to the function in which case there will be a small code-size cost.Testing: Added a test.
Reviewer: Dario Rexin ( @drexin )