From 17792b76b7879450cc37db8968fa71fb5ab67941 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 23 Feb 2022 11:04:35 +0800 Subject: [PATCH] rename exception symbols --- nac3core/src/codegen/stmt.rs | 16 ++++++++-------- nac3core/src/toplevel/composer.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nac3core/src/codegen/stmt.rs b/nac3core/src/codegen/stmt.rs index 7793d54cf..f04f36ff9 100644 --- a/nac3core/src/codegen/stmt.rs +++ b/nac3core/src/codegen/stmt.rs @@ -426,16 +426,16 @@ pub fn get_builtins<'ctx, 'a, G: CodeGenerator>( ) -> FunctionValue<'ctx> { ctx.module.get_function(symbol).unwrap_or_else(|| { let ty = match symbol { - "__artiq_raise" => ctx + "__nac3_raise" => ctx .ctx .void_type() .fn_type(&[ctx.get_llvm_type(generator, ctx.primitives.exception).into()], false), - "__artiq_resume" => ctx.ctx.void_type().fn_type(&[], false), - "__artiq_end_catch" => ctx.ctx.void_type().fn_type(&[], false), + "__nac3_resume" => ctx.ctx.void_type().fn_type(&[], false), + "__nac3_end_catch" => ctx.ctx.void_type().fn_type(&[], false), _ => unimplemented!(), }; let fun = ctx.module.add_function(symbol, ty, None); - if symbol == "__artiq_raise" || symbol == "__artiq_resume" { + if symbol == "__nac3_raise" || symbol == "__nac3_resume" { fun.add_attribute( AttributeLoc::Function, ctx.ctx.create_enum_attribute(Attribute::get_named_enum_kind_id("noreturn"), 1), @@ -557,11 +557,11 @@ pub fn gen_raise<'ctx, 'a, G: CodeGenerator>( ctx.builder.build_store(name_ptr, fun_name); } - let raise = get_builtins(generator, ctx, "__artiq_raise"); + let raise = get_builtins(generator, ctx, "__nac3_raise"); let exception = *exception; ctx.build_call_or_invoke(raise, &[exception], "raise"); } else { - let resume = get_builtins(generator, ctx, "__artiq_resume"); + let resume = get_builtins(generator, ctx, "__nac3_resume"); ctx.build_call_or_invoke(resume, &[], "resume"); } ctx.builder.build_unreachable(); @@ -706,8 +706,8 @@ pub fn gen_try<'ctx, 'a, G: CodeGenerator>( &mut redirect_lambda as &mut dyn FnMut(&mut CodeGenContext<'ctx, 'a>, BasicBlock<'ctx>, BasicBlock<'ctx>) }; - let resume = get_builtins(generator, ctx, "__artiq_resume"); - let end_catch = get_builtins(generator, ctx, "__artiq_end_catch"); + let resume = get_builtins(generator, ctx, "__nac3_resume"); + let end_catch = get_builtins(generator, ctx, "__nac3_end_catch"); if let Some((continue_target, break_target)) = ctx.loop_target.take() { let break_proxy = ctx.ctx.append_basic_block(current_fun, "try.break"); let continue_proxy = ctx.ctx.append_basic_block(current_fun, "try.continue"); diff --git a/nac3core/src/toplevel/composer.rs b/nac3core/src/toplevel/composer.rs index f917e4b94..70c03c536 100644 --- a/nac3core/src/toplevel/composer.rs +++ b/nac3core/src/toplevel/composer.rs @@ -145,7 +145,7 @@ impl TopLevelComposer { self.unifier.get_shared_unifier(), self.primitives_ty, )])), - personality_symbol: Some("__artiq_personality".into()), + personality_symbol: Some("__nac3_personality".into()), } }