32 lines
785 B
C
32 lines
785 B
C
#ifndef __SPL_AST2IR_H__
|
|
#define __SPL_AST2IR_H__
|
|
|
|
#include "spl_ir.h"
|
|
#include "spl_sema.h"
|
|
|
|
typedef MAP(spl_def_id_t, spl_ir_node_ref_t) spl_def2ir_map_t;
|
|
|
|
typedef struct {
|
|
usize cont_blk;
|
|
usize brk_blk;
|
|
spl_ir_node_ref_vec_t breaks;
|
|
} spl_loop_ctx_t;
|
|
typedef VEC(spl_loop_ctx_t) spl_loop_ctx_vec_t;
|
|
|
|
typedef VEC(spl_ast_node_ref_t) spl_defer_stack_t;
|
|
|
|
typedef struct {
|
|
const spl_sema_t *sema;
|
|
spl_ir_builder_t *ir;
|
|
spl_def2ir_map_t def2ir_map;
|
|
spl_loop_ctx_vec_t loop_stack;
|
|
spl_defer_stack_t defer_stack;
|
|
int err_count;
|
|
} spl_ast2ir_t;
|
|
|
|
void spl_ast2ir_init(spl_ast2ir_t *ast2ir, spl_ir_builder_t *ir, const spl_sema_t *sema);
|
|
void spl_ast2ir_drop(spl_ast2ir_t *ast2ir);
|
|
|
|
void spl_ast2ir_run(spl_ast2ir_t *ast2ir);
|
|
|
|
#endif /* __SPL_AST2IR_H__ */ |