diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/base.rs | 2 | ||||
| -rw-r--r-- | src/value_and_place.rs | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/base.rs b/src/base.rs index 0adca5bee8b..81ca47fe645 100644 --- a/src/base.rs +++ b/src/base.rs @@ -269,7 +269,7 @@ fn trans_stmt<'tcx>( fx.set_debug_loc(stmt.source_info); - #[cfg(false_debug_assertions)] + #[cfg(debug_assertions)] match &stmt.kind { StatementKind::StorageLive(..) | StatementKind::StorageDead(..) => {} // Those are not very useful _ => { diff --git a/src/value_and_place.rs b/src/value_and_place.rs index 6f0c615c950..39eb7d24707 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -362,6 +362,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; |
