debug logic

This commit is contained in:
Folkert 2023-06-14 15:49:06 +02:00 committed by Ayaz Hafiz
parent daaa1a3720
commit 05eb489b14
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 21 additions and 5 deletions

View file

@ -336,10 +336,12 @@ where
eprintln!("{}", program.to_source_string());
}
match opt_level {
OptLevel::Development | OptLevel::Normal => morphic_lib::solve_trivial(program),
OptLevel::Optimize | OptLevel::Size => morphic_lib::solve(program),
}
// match opt_level {
// OptLevel::Development | OptLevel::Normal => morphic_lib::solve_trivial(program),
// OptLevel::Optimize | OptLevel::Size => morphic_lib::solve(program),
// }
morphic_lib::solve_trivial(program)
}
/// if you want an "escape hatch" which allows you construct "best-case scenario" values

View file

@ -4958,7 +4958,7 @@ fn build_proc_header<'a, 'ctx>(
fn_val.add_attribute(AttributeLoc::Function, enum_attr);
}
if false {
if true {
let kind_id = Attribute::get_named_enum_kind_id("noinline");
debug_assert!(kind_id > 0);
let enum_attr = env.context.create_enum_attribute(kind_id, 1);
@ -5431,6 +5431,20 @@ pub fn call_roc_function<'a, 'ctx>(
let result_type = basic_type_from_layout(env, layout_interner, result_layout);
let result_alloca = entry_block_alloca_zerofill(env, result_type, "result_value");
match layout_interner.get_repr(result_layout) {
LayoutRepr::LambdaSet(_) => {
let size = layout_interner.stack_size(result_layout);
if size == 152 {
dbg!(size, result_layout);
dbg!(layout_interner.dbg(result_layout));
env.builder
.build_store(result_alloca, result_type.const_zero());
}
}
_ => {}
}
arguments.push(result_alloca.into());
debug_assert_eq!(