aboutsummaryrefslogtreecommitdiff
path: root/include/ssa
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-24 23:31:14 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitd9f652919961a2947452ad3c4af4659f3d2fb330 (patch)
tree2db541db311a9b5a83d3f2c9b199f6d5c3341555 /include/ssa
parent40652d7dbf701eda83fa8323b42a6b5bf0ca6bdd (diff)
Add if/else/elseif/while, including the final assembly
Diffstat (limited to 'include/ssa')
-rw-r--r--include/ssa/ssa.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/ssa/ssa.h b/include/ssa/ssa.h
index ed147bf..9d6949d 100644
--- a/include/ssa/ssa.h
+++ b/include/ssa/ssa.h
@@ -28,7 +28,8 @@ typedef enum {
SSA_CALL_EXTERN,
SSA_JUMP_ZERO,
SSA_JUMP,
- SSA_RET
+ SSA_RET,
+ SSA_LABEL
} SsaInstruction;
typedef enum {
@@ -61,6 +62,7 @@ typedef u16 SsaStringIndex;
typedef u16 SsaExternFuncIndex;
typedef u16 SsaExportFuncIndex;
typedef u16 SsaFuncIndex;
+typedef u16 SsaLabelIndex;
typedef struct {
Buffer/*instruction data*/ instructions;
@@ -78,6 +80,7 @@ typedef struct {
SsaRegister reg_counter;
SsaRegister param_counter;
SsaFuncIndex func_counter;
+ SsaLabelIndex label_counter;
Parser *parser; /* Borrowed */
} Ssa;
@@ -111,11 +114,11 @@ typedef struct {
typedef struct {
SsaRegister condition_reg;
- JumpOffset jump_offset;
+ SsaLabelIndex target_label;
} SsaInsJumpZero;
typedef struct {
- JumpOffset jump_offset;
+ SsaLabelIndex target_label;
} SsaInsJump;
/* None of these functions are thread-safe */