pipe a list of expects to llvm codegen

This commit is contained in:
Folkert 2022-07-10 20:04:08 +02:00
parent 5df489ba23
commit 67cbe6a590
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 17 additions and 17 deletions

View file

@ -4180,24 +4180,10 @@ pub fn build_procedures_return_main<'a, 'ctx, 'env>(
pub fn build_procedures_expose_expects<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
opt_level: OptLevel,
expects: &[Symbol],
procedures: MutMap<(Symbol, ProcLayout<'a>), roc_mono::ir::Proc<'a>>,
entry_point: EntryPoint<'a>,
) -> Vec<'a, &'a str> {
use bumpalo::collections::CollectIn;
// this is not entirely accurate: it will treat every top-level bool value (turned into a
// zero-argument thunk) as an expect.
let expects: Vec<_> = procedures
.keys()
.filter_map(|(symbol, proc_layout)| {
if proc_layout.arguments.is_empty() && proc_layout.result == Layout::UNIT {
Some(*symbol)
} else {
None
}
})
.collect_in(env.arena);
let mod_solutions = build_procedures_help(
env,
opt_level,