Merge branch 'main' into Frame-Limited

This commit is contained in:
J.Teeuwissen 2023-03-31 20:46:39 +02:00
commit 7759ce6fc4
No known key found for this signature in database
GPG key ID: DB5F7A1ED8D478AD
31 changed files with 476 additions and 418 deletions

View file

@ -1082,6 +1082,12 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
match expr {
Literal(literal) => build_exp_literal(env, layout_interner, parent, layout, literal),
NullPointer => {
let basic_type = basic_type_from_layout(env, layout_interner, layout);
debug_assert!(basic_type.is_pointer_type());
basic_type.into_pointer_type().const_zero().into()
}
Call(call) => build_exp_call(
env,

View file

@ -41,6 +41,8 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
// The type of this function (but not the implementation) should have
// already been defined by the builtins, which rely on it.
let fn_val = module.get_function("roc_alloc").unwrap();
fn_val.set_linkage(Linkage::Internal);
let mut params = fn_val.get_param_iter();
let size_arg = params.next().unwrap();
let _alignment_arg = params.next().unwrap();
@ -135,6 +137,8 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
// The type of this function (but not the implementation) should have
// already been defined by the builtins, which rely on it.
let fn_val = module.get_function("roc_dealloc").unwrap();
fn_val.set_linkage(Linkage::Internal);
let mut params = fn_val.get_param_iter();
let ptr_arg = params.next().unwrap();
let _alignment_arg = params.next().unwrap();