clean up some other dependencies

This commit is contained in:
Folkert 2021-11-10 16:25:03 +01:00
parent 5632e3159d
commit 2262dcb3f9
6 changed files with 39 additions and 64 deletions

View file

@ -1,8 +1,46 @@
/// UNUSED
///
/// but kept for future reference
///
///
// pub fn optimize_refcount_operations<'i, T>(
// arena: &'a Bump,
// home: ModuleId,
// ident_ids: &'i mut IdentIds,
// procs: &mut MutMap<T, Proc<'a>>,
// ) {
// use crate::expand_rc;
//
// let deferred = expand_rc::Deferred {
// inc_dec_map: Default::default(),
// assignments: Vec::new_in(arena),
// decrefs: Vec::new_in(arena),
// };
//
// let mut env = expand_rc::Env {
// home,
// arena,
// ident_ids,
// layout_map: Default::default(),
// alias_map: Default::default(),
// constructor_map: Default::default(),
// deferred,
// };
//
// for (_, proc) in procs.iter_mut() {
// let b = expand_rc::expand_and_cancel_proc(
// &mut env,
// arena.alloc(proc.body.clone()),
// proc.args,
// );
// proc.body = b.clone();
// }
// }
use crate::ir::{BranchInfo, Expr, ModifyRc, Stmt};
use crate::layout::{Layout, UnionLayout};
use bumpalo::collections::Vec;
use bumpalo::Bump;
use linked_hash_map::LinkedHashMap;
// use linked_hash_map::LinkedHashMap;
use roc_collections::all::MutMap;
use roc_module::symbol::{IdentIds, ModuleId, Symbol};

View file

@ -370,40 +370,6 @@ impl<'a> Proc<'a> {
}
}
pub fn optimize_refcount_operations<'i, T>(
arena: &'a Bump,
home: ModuleId,
ident_ids: &'i mut IdentIds,
procs: &mut MutMap<T, Proc<'a>>,
) {
use crate::expand_rc;
let deferred = expand_rc::Deferred {
inc_dec_map: Default::default(),
assignments: Vec::new_in(arena),
decrefs: Vec::new_in(arena),
};
let mut env = expand_rc::Env {
home,
arena,
ident_ids,
layout_map: Default::default(),
alias_map: Default::default(),
constructor_map: Default::default(),
deferred,
};
for (_, proc) in procs.iter_mut() {
let b = expand_rc::expand_and_cancel_proc(
&mut env,
arena.alloc(proc.body.clone()),
proc.args,
);
proc.body = b.clone();
}
}
fn make_tail_recursive(&mut self, env: &mut Env<'a, '_>) {
let mut args = Vec::with_capacity_in(self.args.len(), env.arena);
let mut proc_args = Vec::with_capacity_in(self.args.len(), env.arena);

View file

@ -4,7 +4,6 @@
pub mod alias_analysis;
pub mod borrow;
pub mod expand_rc;
pub mod inc_dec;
pub mod ir;
pub mod layout;