formatting

This commit is contained in:
Folkert 2021-05-16 20:25:18 +02:00
parent ebd62485df
commit 3540a048d8
3 changed files with 12 additions and 14 deletions

View file

@ -410,6 +410,7 @@ impl<'a> BorrowInfState<'a> {
LowLevel { LowLevel {
op, op,
opt_closure_layout, opt_closure_layout,
..
} => { } => {
use roc_module::low_level::LowLevel::*; use roc_module::low_level::LowLevel::*;
match op { match op {

View file

@ -1,4 +1,4 @@
use crate::borrow::{ParamMap, BORROWED, OWNED}; use crate::borrow::{ParamMap, BORROWED};
use crate::ir::{Expr, JoinPointId, ModifyRc, Param, Proc, Stmt}; use crate::ir::{Expr, JoinPointId, ModifyRc, Param, Proc, Stmt};
use crate::layout::Layout; use crate::layout::Layout;
use bumpalo::collections::Vec; use bumpalo::collections::Vec;
@ -471,10 +471,11 @@ impl<'a> Context<'a> {
let mut b = Stmt::Let(z, v, l, b); let mut b = Stmt::Let(z, v, l, b);
if !ps[1].borrow { if !ps[1].borrow {
b = Stmt::Refcounting( // b = Stmt::Refcounting(
ModifyRc::Inc(arguments[2], 2), // ModifyRc::Inc(arguments[2], 2),
self.arena.alloc(b), // self.arena.alloc(b),
) // )
todo!();
} }
&*self.arena.alloc(b) &*self.arena.alloc(b)
@ -799,10 +800,7 @@ impl<'a> Context<'a> {
use crate::ir::CallType; use crate::ir::CallType;
let stmt = match &call.call_type { let stmt = match &call.call_type {
CallType::LowLevel { CallType::LowLevel { op, .. } => {
op,
opt_closure_layout: _,
} => {
let ps = crate::borrow::lowlevel_borrow_signature(self.arena, *op); let ps = crate::borrow::lowlevel_borrow_signature(self.arena, *op);
self.add_dec_after_lowlevel(call.arguments, ps, cont, &invoke_live_vars) self.add_dec_after_lowlevel(call.arguments, ps, cont, &invoke_live_vars)
} }

View file

@ -1061,10 +1061,7 @@ impl<'a> Call<'a> {
.text("CallByPointer ") .text("CallByPointer ")
.append(alloc.intersperse(it, " ")) .append(alloc.intersperse(it, " "))
} }
LowLevel { LowLevel { op: lowlevel, .. } => {
op: lowlevel,
opt_closure_layout: _,
} => {
let it = arguments.iter().map(|s| symbol_to_doc(alloc, *s)); let it = arguments.iter().map(|s| symbol_to_doc(alloc, *s));
alloc alloc
@ -2668,7 +2665,9 @@ macro_rules! match_on_closure_argument {
lambda_set, lambda_set,
$closure_data_symbol, $closure_data_symbol,
|top_level_function, closure_data, function_layout| self::Call { |top_level_function, closure_data, function_layout| self::Call {
call_type: CallType::LowLevel { op: $op, opt_closure_layout: Some(function_layout) }, call_type: CallType::LowLevel {
op: $op, opt_closure_layout: Some(function_layout),
},
arguments: arena.alloc([$($x,)* top_level_function, closure_data]), arguments: arena.alloc([$($x,)* top_level_function, closure_data]),
}, },
arena.alloc(top_level).full(), arena.alloc(top_level).full(),