aboutsummaryrefslogtreecommitdiff
path: root/include/ssa
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-12 22:18:43 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit2d2c31cc18aa9af2cdf26fa462edf7a164d45328 (patch)
tree687402ac43f28260a3ac7b9934522ae891b09557 /include/ssa
parent385e2b95cb635976aded7368c6f7ac29585b38e7 (diff)
Refactor ssa
Diffstat (limited to 'include/ssa')
-rw-r--r--include/ssa/ssa.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/ssa/ssa.h b/include/ssa/ssa.h
index e5bd86b..a21b45a 100644
--- a/include/ssa/ssa.h
+++ b/include/ssa/ssa.h
@@ -4,6 +4,9 @@
#include "../std/buffer.h"
#include "../std/hash_map.h"
#include "../std/defs.h"
+#include "../defs.h"
+
+#include <setjmp.h>
typedef enum {
SSA_ASSIGN_INTER,
@@ -53,4 +56,14 @@ CHECK_RESULT int ssa_ins_func_end(Ssa *self);
CHECK_RESULT int ssa_ins_push(Ssa *self, SsaRegister reg);
CHECK_RESULT int ssa_ins_call(Ssa *self, SsaFuncIndex func, SsaRegister *result);
+
+typedef struct {
+ jmp_buf env;
+ Parser *parser;
+ Ssa ssa;
+} SsaCompilerContext;
+
+/* longjump to compiler env on failure */
+void scope_generate_ssa(Scope *self, SsaCompilerContext *context);
+
#endif