about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2019-09-11 16:05:45 -0300
committerSantiago Pastorino <spastorino@gmail.com>2019-09-11 16:28:06 -0300
commit87420cd1bc9b032290e55e1569c6c45398eec929 (patch)
tree230f22dd4efee22056bfcd729f349374da5e479d /src/librustc_codegen_ssa
parente73d189e4e2ad55fcea595a14f9adea0960c65a1 (diff)
downloadrust-87420cd1bc9b032290e55e1569c6c45398eec929.tar.gz
rust-87420cd1bc9b032290e55e1569c6c45398eec929.zip
Make Place Boxed on Statement to reduce size from 64 bytes to 32 bytes
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/mir/statement.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_codegen_ssa/mir/statement.rs b/src/librustc_codegen_ssa/mir/statement.rs
index b1bc57c2e90..dab7dfc0417 100644
--- a/src/librustc_codegen_ssa/mir/statement.rs
+++ b/src/librustc_codegen_ssa/mir/statement.rs
@@ -16,12 +16,12 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
 
         self.set_debug_loc(&mut bx, statement.source_info);
         match statement.kind {
-            mir::StatementKind::Assign(ref place, ref rvalue) => {
+            mir::StatementKind::Assign(box(ref place, ref rvalue)) => {
                 if let mir::Place {
                     base: mir::PlaceBase::Local(index),
                     projection: box [],
-                } = *place {
-                    match self.locals[index] {
+                } = place {
+                    match self.locals[*index] {
                         LocalRef::Place(cg_dest) => {
                             self.codegen_rvalue(bx, cg_dest, rvalue)
                         }
@@ -30,7 +30,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                         }
                         LocalRef::Operand(None) => {
                             let (mut bx, operand) = self.codegen_rvalue_operand(bx, rvalue);
-                            if let Some(name) = self.mir.local_decls[index].name {
+                            if let Some(name) = self.mir.local_decls[*index].name {
                                 match operand.val {
                                     OperandValue::Ref(x, ..) |
                                     OperandValue::Immediate(x) => {
@@ -44,7 +44,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                                     }
                                 }
                             }
-                            self.locals[index] = LocalRef::Operand(Some(operand));
+                            self.locals[*index] = LocalRef::Operand(Some(operand));
                             bx
                         }
                         LocalRef::Operand(Some(op)) => {
@@ -64,7 +64,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                     self.codegen_rvalue(bx, cg_dest, rvalue)
                 }
             }
-            mir::StatementKind::SetDiscriminant{ref place, variant_index} => {
+            mir::StatementKind::SetDiscriminant{box ref place, variant_index} => {
                 self.codegen_place(&mut bx, &place.as_ref())
                     .codegen_set_discr(&mut bx, variant_index);
                 bx