mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
speedups
This commit is contained in:
parent
44b8b1ca4c
commit
d561f2661d
4 changed files with 52 additions and 47 deletions
|
@ -10,7 +10,8 @@ use roc_module::symbol::Symbol;
|
|||
use std::convert::TryFrom;
|
||||
|
||||
use crate::ir::{
|
||||
Call, CallType, Expr, HostExposedLayouts, ListLiteralElement, Literal, ModifyRc, Proc, Stmt,
|
||||
Call, CallType, Expr, HostExposedLayouts, ListLiteralElement, Literal, ModifyRc, OptLevel,
|
||||
Proc, Stmt,
|
||||
};
|
||||
use crate::layout::{Builtin, Layout, ListLayout, RawFunctionLayout, UnionLayout};
|
||||
|
||||
|
@ -109,6 +110,7 @@ fn bytes_as_ascii(bytes: &[u8]) -> String {
|
|||
}
|
||||
|
||||
pub fn spec_program<'a, I>(
|
||||
opt_level: OptLevel,
|
||||
entry_point: crate::ir::EntryPoint<'a>,
|
||||
procs: I,
|
||||
) -> Result<morphic_lib::Solutions>
|
||||
|
@ -239,7 +241,10 @@ where
|
|||
eprintln!("{}", program.to_source_string());
|
||||
}
|
||||
|
||||
morphic_lib::solve(program)
|
||||
match opt_level {
|
||||
OptLevel::Development | OptLevel::Normal => morphic_lib::solve_trivial(program),
|
||||
OptLevel::Optimize => morphic_lib::solve(program),
|
||||
}
|
||||
}
|
||||
|
||||
/// if you want an "escape hatch" which allows you construct "best-case scenario" values
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue