From 7212ea877ed85d3b85af90c902639df44fc493f2 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 24 Aug 2019 00:48:40 +0200 Subject: Add exported variable (only functions for now), export main func, start execution from main func --- include/ssa/ssa.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/ssa/ssa.h') diff --git a/include/ssa/ssa.h b/include/ssa/ssa.h index b2c8065..ed147bf 100644 --- a/include/ssa/ssa.h +++ b/include/ssa/ssa.h @@ -49,11 +49,17 @@ typedef struct { BufferView name; } SsaExternFunc; +typedef struct { + FunctionSignature *func_sig; + BufferView name; +} SsaExportFunc; + typedef i16 JumpOffset; typedef i16 SsaRegister; typedef u16 SsaIntermediateIndex; typedef u16 SsaStringIndex; typedef u16 SsaExternFuncIndex; +typedef u16 SsaExportFuncIndex; typedef u16 SsaFuncIndex; typedef struct { @@ -64,9 +70,11 @@ typedef struct { Buffer/*BufferView*/ strings; HashMapType(BufferView, SsaExternFuncIndex) extern_funcs_map; Buffer/*SsaExternFunc*/ extern_funcs; + Buffer/*SsaExportFunc*/ export_funcs; SsaIntermediateIndex intermediate_counter; SsaStringIndex string_counter; SsaExternFuncIndex extern_func_counter; + SsaExportFuncIndex export_func_counter; SsaRegister reg_counter; SsaRegister param_counter; SsaFuncIndex func_counter; @@ -85,8 +93,7 @@ typedef struct { } SsaInsForm2; typedef struct { - SsaFuncIndex func_index; - u16 num_params_regs; + u8 flags; u16 num_local_vars_regs; } SsaInsFuncStart; -- cgit v1.2.3