about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2019-12-31 15:59:49 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2019-12-31 15:59:49 +0100
commit4c7abd504ce2c534e3f2eedfeecf466f83c693da (patch)
tree5e94d73c8a1e70760298faea499284e3db58774c /src
parentdbb118a5bccc4a1fd71503abb777f684c3ccce68 (diff)
downloadrust-4c7abd504ce2c534e3f2eedfeecf466f83c693da.tar.gz
rust-4c7abd504ce2c534e3f2eedfeecf466f83c693da.zip
Revert some changes
Diffstat (limited to 'src')
-rw-r--r--src/base.rs2
-rw-r--r--src/value_and_place.rs13
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;