clean up sjlj code gen

This commit is contained in:
Folkert 2021-08-29 17:09:32 +02:00
parent 53c8500d11
commit 32ef95e3d0
2 changed files with 3 additions and 16 deletions

View file

@ -3101,21 +3101,6 @@ pub fn get_sjlj_buffer<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerValu
.into_pointer_value() .into_pointer_value()
} }
pub fn get_sjlj_message_buffer<'a, 'ctx, 'env>(env: &Env<'a, 'ctx, 'env>) -> PointerValue<'ctx> {
let type_ = env.context.i8_type().ptr_type(AddressSpace::Generic);
let global = match env.module.get_global("roc_sjlj_message_buffer") {
Some(global) => global,
None => env
.module
.add_global(type_, None, "roc_sjlj_message_buffer"),
};
global.set_initializer(&type_.const_zero());
global.as_pointer_value()
}
fn set_jump_and_catch_long_jump<'a, 'ctx, 'env, F, T>( fn set_jump_and_catch_long_jump<'a, 'ctx, 'env, F, T>(
env: &Env<'a, 'ctx, 'env>, env: &Env<'a, 'ctx, 'env>,
parent: FunctionValue<'ctx>, parent: FunctionValue<'ctx>,

View file

@ -139,7 +139,9 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
} }
} }
add_sjlj_roc_panic(env) if env.is_gen_test {
add_sjlj_roc_panic(env)
}
} }
pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) { pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) {