aboutsummaryrefslogtreecommitdiff
path: root/include/ssa
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-24 00:48:40 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit7212ea877ed85d3b85af90c902639df44fc493f2 (patch)
treec76d73e9882a832f82cef977efb6fb26fb0e4984 /include/ssa
parentd6f368a3f400fea3e89280262a8147e7ce5d855c (diff)
Add exported variable (only functions for now), export main func, start execution from main func
Diffstat (limited to 'include/ssa')
-rw-r--r--include/ssa/ssa.h11
1 files changed, 9 insertions, 2 deletions
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;