ox

The Ox programming language, compiler and tools (WIP)
Log | Files | Refs | README | LICENSE

gen.h (479B)


      1 #pragma once
      2 
      3 #include <unistd.h> // for libgccjit
      4 #include <libgccjit.h>
      5 
      6 #include "parser.h"
      7 #include "sem.h"
      8 
      9 typedef struct {
     10 	gcc_jit_context *ctx;
     11 	gcc_jit_function *prev_func;
     12 	gcc_jit_function *curr_func;
     13 	gcc_jit_function* printf_fn;
     14 	gcc_jit_function* puts_fn;
     15 	gcc_jit_block *prev_block;
     16 	gcc_jit_block *curr_block;
     17 	// gcc_jit_type *type_kind; need type too?
     18 	Scope *scope;
     19 	const char *src;
     20 } Gen;
     21 
     22 Gen gen_init(Scope *, const char *);
     23 void gen_next(Gen *, Node *);