Skip to content

Commit b7a1031

Browse files
committed
Add clif ir comment for write_cvalue
1 parent 78f63f7 commit b7a1031

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/abi/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb:
329329
.collect::<Vec<(Local, ArgKind, Ty)>>();
330330

331331
fx.bcx.switch_to_block(start_ebb);
332+
fx.bcx.ins().nop();
332333

333334
#[cfg(debug_assertions)]
334335
self::comments::add_locals_header_comment(fx);

src/value_and_place.rs

+13
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,19 @@ impl<'tcx> CPlace<'tcx> {
367367
}
368368

369369
pub fn write_cvalue(self, fx: &mut FunctionCx<'_, 'tcx, impl Backend>, from: CValue<'tcx>) {
370+
#[cfg(debug_assertions)]
371+
{
372+
use cranelift::codegen::cursor::{Cursor, CursorPosition};
373+
let cur_ebb = match fx.bcx.cursor().position() {
374+
CursorPosition::After(ebb) => ebb,
375+
_ => unreachable!(),
376+
};
377+
fx.add_comment(
378+
fx.bcx.func.layout.last_inst(cur_ebb).unwrap(),
379+
format!("write_cvalue: {:?} <- {:?}",self, from),
380+
);
381+
}
382+
370383
let from_ty = from.layout().ty;
371384
let to_ty = self.layout().ty;
372385

0 commit comments

Comments
 (0)