Display the IL 'tail.' prefix in C# output - #3818
Merged
Merged
Conversation
F# emits tail calls pervasively, but the 'tail.' prefix was dropped entirely at the C# output stage, so the information never reached the decompiled text. Render it inline as '/*tail.*/' before the call, mirroring the existing 'constrained.' prefix comment in CallBuilder. Fix #3817 Assisted-by: Claude:claude-opus-4-8:Claude Code
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.
Fixes #3817.
F# emits tail calls pervasively, but the IL
tail.prefix was dropped entirely at the C# output stage, so the information never reached the decompiled text. This surfaces it as an inline/*tail.*/marker before the call:The flag (
CallInstruction.IsTail) was already tracked end-to-end through the IL pipeline; it was simply discarded when the call became a C# invocation. The implementation mirrors the existingconstrained.-prefix comment already emitted inCallBuilder.Notes
tail.opcode (the "tail" hits in the F# fixtures areget_TailOrNull()substrings), so the change has zero churn on the rest of the suite.calli(CallIndirect) does not modelIsTail, so tail-prefixed indirect calls are not marked (rare; out of scope).Test
New ILPretty fixture
TailCall.il/TailCall.csexercising atail. callfollowed byret.🤖 This PR was prepared by Claude Code (claude-opus-4-8) on behalf of @siegfriedpammer.