Cleanups after self-review

- Fix clippy warnings
- Improve a comment
- Delete commented-out lines in Cargo.toml
- Checkin Cargo.lock
This commit is contained in:
Brian Carroll 2021-09-01 19:07:01 +01:00
parent 3bf94e020c
commit 9ba7076d8e
4 changed files with 358 additions and 337 deletions

View file

@ -6,7 +6,7 @@ use parity_wasm::elements::Internal;
use roc_collections::all::{MutMap, MutSet};
use roc_module::symbol::{Interns, Symbol};
use roc_mono::ir::{CallType, Expr, Proc, ProcLayout, Stmt};
use roc_mono::ir::{Proc, ProcLayout};
use roc_mono::layout::LayoutIds;
use crate::backend::WasmBackend;
@ -45,18 +45,3 @@ pub fn build_module<'a>(
.to_bytes()
.map_err(|e| -> String { format!("Error serialising Wasm module {:?}", e) })
}
// TODO: use something like this for very simple inlining
// Create a HashMap of inlined Procs, generate each call with different Symbol arguments
fn _is_lowlevel_wrapper<'a>(proc: Proc<'a>) -> bool {
match proc.body {
Stmt::Let(_, expr, _, Stmt::Ret(..)) => match expr {
Expr::Call(roc_mono::ir::Call { call_type, .. }) => match call_type {
CallType::LowLevel { .. } => true,
_ => false,
},
_ => false,
},
_ => false,
}
}