fn write_const(f: &mut File, constant: P<Value>, loc: P<Value>) {
    use std::io::Write;

    // label
    let label = match loc.v {
        Value_::Memory(MemoryLocation::Symbolic { ref label, .. }) => label.clone(),
        _ => {
            panic!(
                "expecing a symbolic memory location for constant {}, found {}",
                constant,
                loc
            )
        }
    };
    write_align(f, MAX_ALIGN);
    writeln!(f, "{}:", symbol(&mangle_name(label))).unwrap();

    // actual value
    write_const_value(f, constant);
}
/// writes a constant to assembly output
writes a constant to assembly output
writes a constant to assembly output
fn write_const(f: &mut File, constant: P<Value>, loc: P<Value>) {
    use std::io::Write;
    // label
    let label = match loc.v {
        Value_::Memory(MemoryLocation::Symbolic { ref label, .. }) => label.clone(),
        _ => {
            panic!(
                "expecing a symbolic memory location for constant {}, found {}",
                constant,
                loc
            )
        }
    };
    write_align(f, MAX_ALIGN);
    writeln!(f, "{}:", symbol(&mangle_name(label))).unwrap();
    // actual value
    write_const_value(f, constant);
}
fn write_const ( f : & mut File , constant : P < Value > , loc : P < Value > ) { use std :: io :: Write ; // label let label = match loc . v { Value_ :: Memory ( MemoryLocation :: Symbolic { ref label , .. } ) => label . clone ( ) , _ => { panic ! ( " " constant loc ) } } ; write_align ( f , MAX_ALIGN ) ; writeln ! ( f " " symbol ( mangle_name ( label ) ) ) . unwrap ( ) ; // actual value write_const_value ( f , constant ) ; }
writes a constant to assembly output
writes a constant to assembly output
f
&mut File
constant
P<Value>
loc
P<Value>
f
&mut File
constant
P<Value>
loc
P<Value>