mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
clean up sjlj code gen
This commit is contained in:
parent
53c8500d11
commit
32ef95e3d0
2 changed files with 3 additions and 16 deletions
|
@ -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>,
|
||||||
|
|
|
@ -139,7 +139,9 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if env.is_gen_test {
|
||||||
add_sjlj_roc_panic(env)
|
add_sjlj_roc_panic(env)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) {
|
pub fn add_sjlj_roc_panic(env: &Env<'_, '_, '_>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue