From dc79a225bd2d5580b03e2084cf5e24bce09de36f Mon Sep 17 00:00:00 2001 From: tsai Date: Tue, 8 Oct 2024 12:39:10 +0800 Subject: [PATCH] Update create_absent_func.ex --- lib/charms/defm/pass/create_absent_func.ex | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/charms/defm/pass/create_absent_func.ex b/lib/charms/defm/pass/create_absent_func.ex index e59989a..0f36a92 100644 --- a/lib/charms/defm/pass/create_absent_func.ex +++ b/lib/charms/defm/pass/create_absent_func.ex @@ -42,18 +42,17 @@ defmodule Charms.Defm.Pass.CreateAbsentFunc do name_str <- MLIR.StringRef.to_string(name), false <- MapSet.member?(created, name_str) do mlir ctx: ctx, block: block do - ft = + {arg_types, ret_types} = if s = Beaver.ENIF.signature(ctx, String.to_atom(name_str)) do - {arg_types, ret_types} = s - Type.function(arg_types, ret_types) + s else - Type.function(arg_types, ret_types) + {arg_types, ret_types} end Func.func _( sym_name: MLIR.Attribute.string(name_str), sym_visibility: MLIR.Attribute.string("private"), - function_type: ft + function_type: Type.function(arg_types, ret_types) ) do region do end