mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
clean up some other dependencies
This commit is contained in:
parent
5632e3159d
commit
2262dcb3f9
6 changed files with 39 additions and 64 deletions
|
@ -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};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue