Add a log-invalid-remappings switch for ABI-illegal remappings#747
Closed
tannergooding wants to merge 1 commit into
Closed
Add a log-invalid-remappings switch for ABI-illegal remappings#747tannergooding wants to merge 1 commit into
tannergooding wants to merge 1 commit into
Conversation
Emits a DiagnosticLevel.Info diagnostic for each configured remapping whose value is a fixed-size-buffer shape that is not directly expressible in an unmanaged signature, naming the applied pointer lowering. The lowering logic is shared with GetRemappedTypeName so the two sites cannot drift. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Dropping this — not high enough value relative to the number of ABI edge cases it would need to cover to be trustworthy. |
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.
This adds a new opt-in
--log-invalid-remappingsconfig switch that emits aDiagnosticLevel.Infodiagnostic for each configured remapping whose value is structurally not a legal unmanaged type name, scoped precisely to the array/fixed-buffer shape (a numeric subscript[<digit>, the same rule as the lowering, so a managedint[]with an empty subscript is left untouched).The message names the remapping and states the applied lowering, e.g.:
The lowering used to compute the shown pointer is factored into a shared
TryLowerFixedSizeBufferRemappinghelper so the diagnostic andGetRemappedTypeNamecan't drift.This builds on #745 (the fixed-size-buffer-to-pointer lowering), which has since merged; the branch is based directly on that commit so the diff here is just the diagnostic feature.