Skip to content

Commit c3daf6d

Browse files
committed
Add clif ir comment for write_cvalue
1 parent 2920cc4 commit c3daf6d

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
@@ -346,6 +346,19 @@ impl<'tcx> CPlace<'tcx> {
346346
}
347347

348348
pub fn write_cvalue(self, fx: &mut FunctionCx<'_, 'tcx, impl Backend>, from: CValue<'tcx>) {
349+
#[cfg(debug_assertions)]
350+
{
351+
use cranelift_codegen::cursor::{Cursor, CursorPosition};
352+
let cur_ebb = match fx.bcx.cursor().position() {
353+
CursorPosition::After(ebb) => ebb,
354+
_ => unreachable!(),
355+
};
356+
fx.add_comment(
357+
fx.bcx.func.layout.last_inst(cur_ebb).unwrap(),
358+
format!("write_cvalue: {:?} <- {:?}",self, from),
359+
);
360+
}
361+
349362
let from_ty = from.layout().ty;
350363
let to_ty = self.layout().ty;
351364

0 commit comments

Comments
 (0)