Skip to main content

print

Function print 

Source
pub fn print(
    funcs: &[Func],
    globals: &Globals,
    aliases: &[Alias],
    names: &Interner,
    target: &TargetInfo,
    unwind: bool,
    output: Output,
) -> Result<String, Error>
Expand description

Every function and every variable, as assembly text.

The functions first and the variables after them, which is the order every toolchain writes a file in and the order a person reading one expects. The second names come last, because a .set says nothing until the thing it names has been written down.

unwind is whether a function is described to an unwinder, which is rucc_session::Options::unwinds and is asked of the build rather than worked out here, so that this and the byte writer cannot answer it differently for one function.

output is whether each function and each variable is given a section of its own and what the file says it was built to have checked, which are the other things about this listing the caller decides: everything else is worked out from the functions and the target.

ยงErrors

Error::Machine for an architecture nothing here writes, and the two internal errors for a function that should not have got this far. See Error.