From ce3fefb5f0fd0d7b6582b8788ca32adb93b07f40 Mon Sep 17 00:00:00 2001 From: Folkert Date: Sun, 9 Aug 2020 01:05:29 +0200 Subject: [PATCH] fix trailing whitespace --- compiler/mono/src/inc_dec.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/compiler/mono/src/inc_dec.rs b/compiler/mono/src/inc_dec.rs index 41ecfb537e..9010d47f94 100644 --- a/compiler/mono/src/inc_dec.rs +++ b/compiler/mono/src/inc_dec.rs @@ -239,7 +239,7 @@ impl<'a> Context<'a> { } // if this symbol is never a reference, don't emit - if !info.reference { + if !info.reference { return stmt; } @@ -255,7 +255,7 @@ impl<'a> Context<'a> { } // if this symbol is never a reference, don't emit - if !info.reference { + if !info.reference { return stmt; } @@ -280,16 +280,14 @@ impl<'a> Context<'a> { // number of times the argument is used (in the body?) let num_consumptions = get_num_consumptions(*x, xs, consume_param_pred.clone()); - let lives_on = - // `x` is not a variable that must be consumed by the current procedure - !info.consume || - // `x` is live after executing instruction - live_vars_after.contains(x) || - // `x` is used in a position that is passed as a borrow reference - is_borrow_param_help(*x, xs, consume_param_pred.clone()); + // `x` is not a variable that must be consumed by the current procedure + // `x` is live after executing instruction + // `x` is used in a position that is passed as a borrow reference + let lives_on = !info.consume + || live_vars_after.contains(x) + || is_borrow_param_help(*x, xs, consume_param_pred.clone()); - - let num_incs = if lives_on { + let num_incs = if lives_on { num_consumptions } else { num_consumptions - 1 @@ -493,7 +491,6 @@ impl<'a> Context<'a> { self.arena.alloc(Stmt::Let(z, v, l, b)) } - EmptyArray | FunctionPointer(_, _) | Literal(_) | RuntimeErrorFunction(_) => { // EmptyArray is always stack-allocated // function pointers are persistent @@ -737,8 +734,7 @@ impl<'a> Context<'a> { (switch, case_live_vars) } - RuntimeError(_) | Inc(_,_) | Dec(_,_) => (stmt, MutSet::default()), - + RuntimeError(_) | Inc(_, _) | Dec(_, _) => (stmt, MutSet::default()), } } }