aboutsummaryrefslogtreecommitdiff
path: root/include/ssa
diff options
context:
space:
mode:
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