Build erased load in llvm

This commit is contained in:
Ayaz Hafiz 2023-07-06 15:50:54 -05:00
parent fcb907b0c9
commit f37cc48e88
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 35 additions and 2 deletions

View file

@ -1134,7 +1134,14 @@ pub(crate) fn build_exp_expr<'a, 'ctx>(
let callee = scope.load_symbol(callee).into_pointer_value();
erased::build(env, value, callee).into()
}
ErasedLoad { .. } => todo_lambda_erasure!(),
ErasedLoad { symbol, field } => {
let value = scope.load_symbol(symbol).into_struct_value();
let wanted_llvm_type =
basic_type_from_layout(env, layout_interner, layout_interner.get_repr(layout))
.into_pointer_type();
erased::load(env, value, *field, wanted_llvm_type).into()
}
Reset {
symbol,