Support for debug-labels. (#27)

Support for debug-labels.

If the client adds labels to vregs across ranges of instructions in the
input program, the regalloc will provide metadata in the `Output` that
describes the `Allocation`s in which each such vreg is stored for those
ranges. This allows the client to emit debug metadata telling a debugger
where to find program values at each point in the program.
This commit is contained in:
Chris Fallin
2022-03-03 16:58:33 -08:00
committed by GitHub
parent d9d97451f8
commit 14442df3fc
5 changed files with 125 additions and 48 deletions

View File

@@ -958,7 +958,14 @@ pub trait Function {
/// match -- specifically, the returned metadata may cover only a
/// subset of the requested ranges -- if the value is not live for
/// the entire requested ranges.
fn debug_value_labels(&self) -> &[(Inst, Inst, VReg, u32)] {
///
/// The instruction indices imply a program point just *before*
/// the instruction.
///
/// Preconditions: we require this slice to be sorted in
/// lexicographic order (i.e., first by vreg, then by instruction
/// index), and we require the ranges to be non-overlapping.
fn debug_value_labels(&self) -> &[(VReg, Inst, Inst, u32)] {
&[]
}