Add clif ir comment for write_cvalue

This commit is contained in:
bjorn3 2019-12-23 16:48:43 +01:00
parent 2920cc48e6
commit c3daf6d220
2 changed files with 14 additions and 0 deletions

View File

@ -329,6 +329,7 @@ pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb:
.collect::<Vec<(Local, ArgKind, Ty)>>();
fx.bcx.switch_to_block(start_ebb);
fx.bcx.ins().nop();
#[cfg(debug_assertions)]
self::comments::add_locals_header_comment(fx);

View File

@ -346,6 +346,19 @@ impl<'tcx> CPlace<'tcx> {
}
pub fn write_cvalue(self, fx: &mut FunctionCx<'_, 'tcx, impl Backend>, from: CValue<'tcx>) {
#[cfg(debug_assertions)]
{
use cranelift_codegen::cursor::{Cursor, CursorPosition};
let cur_ebb = match fx.bcx.cursor().position() {
CursorPosition::After(ebb) => ebb,
_ => unreachable!(),
};
fx.add_comment(
fx.bcx.func.layout.last_inst(cur_ebb).unwrap(),
format!("write_cvalue: {:?} <- {:?}",self, from),
);
}
let from_ty = from.layout().ty;
let to_ty = self.layout().ty;