This commit is contained in:
Folkert 2021-10-27 00:01:21 +02:00
parent 44b8b1ca4c
commit d561f2661d
4 changed files with 52 additions and 47 deletions

View file

@ -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