31 lines
712 B
C
31 lines
712 B
C
#ifndef __SPL_IR2VM_H__
|
|
#define __SPL_IR2VM_H__
|
|
|
|
#include "spl_ir.h"
|
|
#include "spl_type.h"
|
|
|
|
#include "../stage0/spl_mcode.h"
|
|
|
|
typedef struct {
|
|
spl_ir_func_ref_t fid;
|
|
VEC(usize) node_first_ip;
|
|
} spl_ir2vm_fdbg_t;
|
|
typedef VEC(spl_ir2vm_fdbg_t) spl_ir2vm_fdbg_vec_t;
|
|
|
|
// MAP()
|
|
typedef struct {
|
|
const spl_ir_t *ir;
|
|
const spl_type_t *type;
|
|
spl_prog_t prog;
|
|
|
|
// spl_ir2vm_fdbg_vec_t fdbg; /* ir2vm_run 后填充;splc0 -g 读取生成 debug 段 */
|
|
} spl_ir2vm_t;
|
|
|
|
void spl_ir2vm_init(spl_ir2vm_t *ctx, const spl_ir_t *ir, const spl_type_t *type);
|
|
void spl_ir2vm_drop(spl_ir2vm_t *ctx);
|
|
|
|
int spl_ir2vm_run(spl_ir2vm_t *ctx);
|
|
void spl_ir2vm_dump(spl_ir2vm_t *ctx);
|
|
|
|
#endif /* __SPL_IR2VM_H__ */
|