Repository navigation
Conversation
The tag a producer reads for a variable's place is mirl.debug.Where, apart from the ir's source location mirl.ir.debug.Location, and a piece carries the salvage steps over what its location holds.
A value binding record gives a piece of its variable, a bit offset and size, or the whole. The records of one variable at one point, each of a piece, are its composite binding, so every edit of a record works on one piece and leaves the others. The text form writes a piece as `bind v0 piece 64 64 = %x`, the verifier refuses pieces that share a bit or reach past a base type's width, and body.split turns one record into several pieces at its point. Wide splitting binds every word of a split value, so a split alone leaves no record unavailable.
Selection gives each ir record a machine record before the first machine instruction made for the instruction it stood before, reading the value's virtual register or the constant. Allocation reads each register's home, the location it holds over its life or the slot a value in pieces lives in, and every later stage that writes a function anew carries the records to the instruction their own now begins at.
writes .debug_info, abbrev, str, str_offsets, addr, loclists and rnglists through masc's builder. types take their sizes and member offsets from the layout routine, a tagged union is a variant part, inlined code is an inlined subroutine of an abstract origin, and a variable's location list has an entry per range it is somewhere.
ranges are computed over the framed function from its value binding records, storage bindings become slot records at the entry, and the handover places labels at range ends and inline runs, hands each frame fact to masc at its instruction, states each change of source location to masc's line records, and writes the dwarf sections before finishing.
octalide
marked this pull request as ready for review
October 17, 2026 00:52
octalide
enabled auto-merge
October 17, 2026 00:53
3 tasks done
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.
Closes #45
What
J9: variable locations carried through selection, allocation and frames, composite bindings, a DWARF 5 producer, and line and frame facts handed to masc. Absorbs #46, #184, #197 and #200. It carries on from #249, which held only an empty start commit and is superseded by this PR.
Plan
mirl.debug.Where, named apart fromir.debug.Location.bind v piece <offset> <size> = ...). Records at one point compose, the verifier refuses overlapping pieces, andbody.splitturns one record into one record per part. Wide integer legalization uses it, so an i128 on RV64 keeps two pieces.mirl.machine.range: a forward dataflow over the framed function. It finds where each variable is per block, with pieces composed. A register write or a clobbering call ends a range.cfi_start,cfiandcfi_end, in order at their instructions.mirl.debug.dwarf: writes.debug_info,abbrev,str,str_offsets,addr,loclistsandrngliststhrough the builder.DW_TAG_variant_part.DW_TAG_inlined_subroutineof an abstract origin..debug_lineis written here. mink lowers it.Choices
DW_LANG_C11, since the IR names no source language.Moved to #342
llvm-dwarfdump --verifyover the examplesLimits
DW_AT_stmt_listis offset 0 with no relocation. That holds for one unit per object.Ran
mach fmt ., a cleanmach check . -a '*'andmach build . -a cli. No new tests were added, per the v7 process.Checklist