stage1 重构代码 重构nob构建方式
This commit is contained in:
1 parent
3714c2d142
commit
4c0317fcb5
14 files changed
+4004
-2160
No files matched your search
+93
-154
@@ -33,98 +33,116 @@ static spl_ir_node_ref_t rw(inline_ctx_t *c, spl_ir_node_ref_t r) {
|
||||
return r + c->shift;
|
||||
}
|
||||
|
||||
static void rw_vec(inline_ctx_t *c, spl_ir_node_ref_vec_t *v) {
|
||||
typedef spl_ir_node_ref_t (*ref_xform_t)(void *ud, spl_ir_node_ref_t ref);
|
||||
|
||||
static void xform_vec(spl_ir_node_ref_vec_t *v, ref_xform_t fx, void *ud) {
|
||||
for (usize i = 0; i < vec_size(*v); i++)
|
||||
vec_at(*v, i) = rw(c, vec_at(*v, i));
|
||||
vec_at(*v, i) = fx(ud, vec_at(*v, i));
|
||||
}
|
||||
|
||||
static void rw_node(inline_ctx_t *c, spl_ir_node_t *n) {
|
||||
/* 对节点的所有「值引用」字段应用 fx;块标签字段不在此列(由调用方单独处理)。 */
|
||||
static void xform_node_value_refs(spl_ir_node_t *n, ref_xform_t fx, void *ud) {
|
||||
switch (n->kind) {
|
||||
case SPL_IR_ARITH_ADD: case SPL_IR_ARITH_SUB: case SPL_IR_ARITH_MUL:
|
||||
case SPL_IR_ARITH_DIV: case SPL_IR_ARITH_REM: case SPL_IR_ARITH_NEG:
|
||||
case SPL_IR_ARITH_ABS: case SPL_IR_ARITH_AND: case SPL_IR_ARITH_OR:
|
||||
case SPL_IR_ARITH_XOR: case SPL_IR_ARITH_SHL: case SPL_IR_ARITH_SHR:
|
||||
case SPL_IR_ARITH_NOT:
|
||||
n->arith.left = rw(c, n->arith.left);
|
||||
n->arith.right = rw(c, n->arith.right);
|
||||
n->arith.left = fx(ud, n->arith.left);
|
||||
n->arith.right = fx(ud, n->arith.right);
|
||||
break;
|
||||
case SPL_IR_CMP_EQ: case SPL_IR_CMP_NE: case SPL_IR_CMP_LT:
|
||||
case SPL_IR_CMP_LE: case SPL_IR_CMP_GT: case SPL_IR_CMP_GE:
|
||||
n->cmp.a = rw(c, n->cmp.a);
|
||||
n->cmp.b = rw(c, n->cmp.b);
|
||||
n->cmp.a = fx(ud, n->cmp.a);
|
||||
n->cmp.b = fx(ud, n->cmp.b);
|
||||
break;
|
||||
case SPL_IR_CAST_TRUNC: case SPL_IR_CAST_ZEXT: case SPL_IR_CAST_SEXT:
|
||||
case SPL_IR_CAST_FEXT: case SPL_IR_CAST_FTRUNC: case SPL_IR_CAST_BITCAST:
|
||||
case SPL_IR_CAST_PTR2INT: case SPL_IR_CAST_INT2PTR: case SPL_IR_CAST_BOOL2INT:
|
||||
case SPL_IR_CASE_INT2FLOAT: case SPL_IR_CASE_FLOAT2INT:
|
||||
n->cast.val = rw(c, n->cast.val);
|
||||
n->cast.val = fx(ud, n->cast.val);
|
||||
break;
|
||||
case SPL_IR_MEM_ALLOCA:
|
||||
n->mem_alloc.count = rw(c, n->mem_alloc.count);
|
||||
n->mem_alloc.count = fx(ud, n->mem_alloc.count);
|
||||
break;
|
||||
case SPL_IR_MEM_GLOBAL_ALLOC:
|
||||
n->mem_global_alloc.const_node = rw(c, n->mem_global_alloc.const_node);
|
||||
n->mem_global_alloc.const_node = fx(ud, n->mem_global_alloc.const_node);
|
||||
break;
|
||||
case SPL_IR_MEM_LOAD:
|
||||
n->mem_load.ptr = rw(c, n->mem_load.ptr);
|
||||
n->mem_load.ptr = fx(ud, n->mem_load.ptr);
|
||||
break;
|
||||
case SPL_IR_MEM_STORE:
|
||||
n->mem_store.ptr = rw(c, n->mem_store.ptr);
|
||||
n->mem_store.val = rw(c, n->mem_store.val);
|
||||
n->mem_store.ptr = fx(ud, n->mem_store.ptr);
|
||||
n->mem_store.val = fx(ud, n->mem_store.val);
|
||||
break;
|
||||
case SPL_IR_MEM_OFFSET:
|
||||
n->mem_offset.ptr = rw(c, n->mem_offset.ptr);
|
||||
n->mem_offset.offset = rw(c, n->mem_offset.offset);
|
||||
n->mem_offset.ptr = fx(ud, n->mem_offset.ptr);
|
||||
n->mem_offset.offset = fx(ud, n->mem_offset.offset);
|
||||
break;
|
||||
case SPL_IR_MEM_FIELD_PTR:
|
||||
n->mem_field_ptr.agg = rw(c, n->mem_field_ptr.agg);
|
||||
n->mem_field_ptr.agg = fx(ud, n->mem_field_ptr.agg);
|
||||
break;
|
||||
case SPL_IR_MEM_COPY:
|
||||
n->mem_copy.dst = rw(c, n->mem_copy.dst);
|
||||
n->mem_copy.src = rw(c, n->mem_copy.src);
|
||||
n->mem_copy.size = rw(c, n->mem_copy.size);
|
||||
n->mem_copy.dst = fx(ud, n->mem_copy.dst);
|
||||
n->mem_copy.src = fx(ud, n->mem_copy.src);
|
||||
n->mem_copy.size = fx(ud, n->mem_copy.size);
|
||||
break;
|
||||
case SPL_IR_MEM_SET:
|
||||
n->mem_set.dst = rw(c, n->mem_set.dst);
|
||||
n->mem_set.val = rw(c, n->mem_set.val);
|
||||
n->mem_set.size = rw(c, n->mem_set.size);
|
||||
n->mem_set.dst = fx(ud, n->mem_set.dst);
|
||||
n->mem_set.val = fx(ud, n->mem_set.val);
|
||||
n->mem_set.size = fx(ud, n->mem_set.size);
|
||||
break;
|
||||
case SPL_IR_TYPE_OFFSETOF:
|
||||
n->ir_offsetof.field_idx = rw(c, n->ir_offsetof.field_idx);
|
||||
n->ir_offsetof.field_idx = fx(ud, n->ir_offsetof.field_idx);
|
||||
break;
|
||||
case SPL_IR_AGG_CONSTRUCT:
|
||||
rw_vec(c, &n->agg_construct.fields);
|
||||
xform_vec(&n->agg_construct.fields, fx, ud);
|
||||
break;
|
||||
case SPL_IR_AGG_EXTRACT:
|
||||
n->agg_extract.val = rw(c, n->agg_extract.val);
|
||||
n->agg_extract.val = fx(ud, n->agg_extract.val);
|
||||
break;
|
||||
case SPL_IR_AGG_INSERT:
|
||||
n->agg_insert.agg = rw(c, n->agg_insert.agg);
|
||||
n->agg_insert.field = rw(c, n->agg_insert.field);
|
||||
n->agg_insert.agg = fx(ud, n->agg_insert.agg);
|
||||
n->agg_insert.field = fx(ud, n->agg_insert.field);
|
||||
break;
|
||||
case SPL_IR_CONTROL_SELECT:
|
||||
n->control_select.cond = rw(c, n->control_select.cond);
|
||||
n->control_select.true_val = rw(c, n->control_select.true_val);
|
||||
n->control_select.false_val = rw(c, n->control_select.false_val);
|
||||
n->control_select.cond = fx(ud, n->control_select.cond);
|
||||
n->control_select.true_val = fx(ud, n->control_select.true_val);
|
||||
n->control_select.false_val = fx(ud, n->control_select.false_val);
|
||||
break;
|
||||
case SPL_IR_CONTROL_BR:
|
||||
n->control_br.cond = rw(c, n->control_br.cond);
|
||||
n->control_br.cond = fx(ud, n->control_br.cond);
|
||||
break;
|
||||
case SPL_IR_CONTROL_PARAM:
|
||||
n->control_param.idx = fx(ud, n->control_param.idx);
|
||||
break;
|
||||
case SPL_IR_CONTROL_RET:
|
||||
n->control_ret.val = fx(ud, n->control_ret.val);
|
||||
break;
|
||||
case SPL_IR_CONTROL_CALL:
|
||||
n->control_call.func = fx(ud, n->control_call.func);
|
||||
xform_vec(&n->control_call.params, fx, ud);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static spl_ir_node_ref_t rw_thunk(void *ud, spl_ir_node_ref_t r) {
|
||||
return rw((inline_ctx_t *)ud, r);
|
||||
}
|
||||
|
||||
/* 克隆体旧 ref -> 新 ref;块标签也参与平移。 */
|
||||
static void rw_node(inline_ctx_t *c, spl_ir_node_t *n) {
|
||||
xform_node_value_refs(n, rw_thunk, c);
|
||||
switch (n->kind) {
|
||||
case SPL_IR_CONTROL_BR:
|
||||
n->control_br.true_label = rw(c, n->control_br.true_label);
|
||||
n->control_br.false_label = rw(c, n->control_br.false_label);
|
||||
break;
|
||||
case SPL_IR_CONTROL_JMP:
|
||||
n->control_jmp.label = rw(c, n->control_jmp.label);
|
||||
break;
|
||||
case SPL_IR_CONTROL_PARAM:
|
||||
n->control_param.idx = rw(c, n->control_param.idx);
|
||||
break;
|
||||
case SPL_IR_CONTROL_RET:
|
||||
n->control_ret.val = rw(c, n->control_ret.val);
|
||||
break;
|
||||
case SPL_IR_CONTROL_CALL:
|
||||
n->control_call.func = rw(c, n->control_call.func);
|
||||
rw_vec(c, &n->control_call.params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -174,14 +192,11 @@ static spl_ir_func_ref_t call_callee(spl_ir_t *ir, spl_ir_func_ref_t fid, spl_ir
|
||||
}
|
||||
|
||||
static bool reaches(spl_ir_t *ir, spl_ir_func_ref_t from, spl_ir_func_ref_t target,
|
||||
unsigned char *mark) {
|
||||
if (from == 0)
|
||||
return false;
|
||||
if (from == target)
|
||||
return true;
|
||||
if (mark[from])
|
||||
return false;
|
||||
mark[from] = 1;
|
||||
unsigned char *mark);
|
||||
|
||||
/* from 的任一直接被调者能否到达 target。 */
|
||||
static bool callees_reach(spl_ir_t *ir, spl_ir_func_ref_t from, spl_ir_func_ref_t target,
|
||||
unsigned char *mark) {
|
||||
spl_ir_func_t *f = spl_ir_func(ir, from);
|
||||
if (!f)
|
||||
return false;
|
||||
@@ -197,22 +212,22 @@ static bool reaches(spl_ir_t *ir, spl_ir_func_ref_t from, spl_ir_func_ref_t targ
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 从 from 的直接被调者出发是否能到达 target(用于判断 from 自身是否递归/自可达)。 */
|
||||
static bool reaches(spl_ir_t *ir, spl_ir_func_ref_t from, spl_ir_func_ref_t target,
|
||||
unsigned char *mark) {
|
||||
if (from == 0)
|
||||
return false;
|
||||
if (from == target)
|
||||
return true;
|
||||
if (mark[from])
|
||||
return false;
|
||||
mark[from] = 1;
|
||||
return callees_reach(ir, from, target, mark);
|
||||
}
|
||||
|
||||
/* 从 from 的直接被调者出发是否能到达 target(用于判断 from 自身是否自可达)。 */
|
||||
static bool reaches_succ(spl_ir_t *ir, spl_ir_func_ref_t from, spl_ir_func_ref_t target,
|
||||
unsigned char *mark) {
|
||||
spl_ir_func_t *f = spl_ir_func(ir, from);
|
||||
if (!f)
|
||||
return false;
|
||||
usize n = vec_size(f->nodes);
|
||||
for (usize i = 1; i < n; i++) {
|
||||
spl_ir_node_t *x = nd(ir, from, i);
|
||||
if (x && x->kind == SPL_IR_CONTROL_CALL) {
|
||||
spl_ir_func_ref_t c = call_callee(ir, from, x);
|
||||
if (c != 0 && reaches(ir, c, target, mark))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return callees_reach(ir, from, target, mark);
|
||||
}
|
||||
|
||||
/* ---- 内联一个调用点 ---- */
|
||||
@@ -242,6 +257,17 @@ static spl_ir_node_ref_t find_const_src(spl_ir_t *ir, spl_ir_func_ref_t fid) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 值引用定点替换:等于 ci 的改为 ret_new。 */
|
||||
typedef struct {
|
||||
spl_ir_node_ref_t ci;
|
||||
spl_ir_node_ref_t ret_new;
|
||||
} replace_one_t;
|
||||
|
||||
static spl_ir_node_ref_t replace_one(void *ud, spl_ir_node_ref_t r) {
|
||||
replace_one_t *p = ud;
|
||||
return r == p->ci ? p->ret_new : r;
|
||||
}
|
||||
|
||||
static bool try_inline(spl_ir_t *ir, spl_ir_func_ref_t caller, spl_ir_node_ref_t ci,
|
||||
spl_ir_func_ref_t callee) {
|
||||
spl_ir_func_t *cf = spl_ir_func(ir, caller);
|
||||
@@ -430,99 +456,12 @@ static bool try_inline(spl_ir_t *ir, spl_ir_func_ref_t caller, spl_ir_node_ref_t
|
||||
call->kind = SPL_IR_CONTROL_JMP;
|
||||
call->control_jmp.label = body_entry;
|
||||
|
||||
/* 使用者替换:只把等于 ci 的引用改为 ret_new(不动其它 ref) */
|
||||
/* 使用者替换:只把等于 ci 的值引用改为 ret_new(块标签不动) */
|
||||
replace_one_t rep = {.ci = ci, .ret_new = ret_new};
|
||||
for (usize j = 1; j < orig_len; j++) {
|
||||
spl_ir_node_t *x = nd(ir, caller, j);
|
||||
if (!x)
|
||||
continue;
|
||||
switch (x->kind) {
|
||||
case SPL_IR_ARITH_ADD: case SPL_IR_ARITH_SUB: case SPL_IR_ARITH_MUL:
|
||||
case SPL_IR_ARITH_DIV: case SPL_IR_ARITH_REM: case SPL_IR_ARITH_NEG:
|
||||
case SPL_IR_ARITH_ABS: case SPL_IR_ARITH_AND: case SPL_IR_ARITH_OR:
|
||||
case SPL_IR_ARITH_XOR: case SPL_IR_ARITH_SHL: case SPL_IR_ARITH_SHR:
|
||||
case SPL_IR_ARITH_NOT:
|
||||
if (x->arith.left == ci) x->arith.left = ret_new;
|
||||
if (x->arith.right == ci) x->arith.right = ret_new;
|
||||
break;
|
||||
case SPL_IR_CMP_EQ: case SPL_IR_CMP_NE: case SPL_IR_CMP_LT:
|
||||
case SPL_IR_CMP_LE: case SPL_IR_CMP_GT: case SPL_IR_CMP_GE:
|
||||
if (x->cmp.a == ci) x->cmp.a = ret_new;
|
||||
if (x->cmp.b == ci) x->cmp.b = ret_new;
|
||||
break;
|
||||
case SPL_IR_CAST_TRUNC: case SPL_IR_CAST_ZEXT: case SPL_IR_CAST_SEXT:
|
||||
case SPL_IR_CAST_FEXT: case SPL_IR_CAST_FTRUNC: case SPL_IR_CAST_BITCAST:
|
||||
case SPL_IR_CAST_PTR2INT: case SPL_IR_CAST_INT2PTR: case SPL_IR_CAST_BOOL2INT:
|
||||
case SPL_IR_CASE_INT2FLOAT: case SPL_IR_CASE_FLOAT2INT:
|
||||
if (x->cast.val == ci) x->cast.val = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_ALLOCA:
|
||||
if (x->mem_alloc.count == ci) x->mem_alloc.count = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_GLOBAL_ALLOC:
|
||||
if (x->mem_global_alloc.const_node == ci) x->mem_global_alloc.const_node = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_LOAD:
|
||||
if (x->mem_load.ptr == ci) x->mem_load.ptr = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_STORE:
|
||||
if (x->mem_store.ptr == ci) x->mem_store.ptr = ret_new;
|
||||
if (x->mem_store.val == ci) x->mem_store.val = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_OFFSET:
|
||||
if (x->mem_offset.ptr == ci) x->mem_offset.ptr = ret_new;
|
||||
if (x->mem_offset.offset == ci) x->mem_offset.offset = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_FIELD_PTR:
|
||||
if (x->mem_field_ptr.agg == ci) x->mem_field_ptr.agg = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_COPY:
|
||||
if (x->mem_copy.dst == ci) x->mem_copy.dst = ret_new;
|
||||
if (x->mem_copy.src == ci) x->mem_copy.src = ret_new;
|
||||
if (x->mem_copy.size == ci) x->mem_copy.size = ret_new;
|
||||
break;
|
||||
case SPL_IR_MEM_SET:
|
||||
if (x->mem_set.dst == ci) x->mem_set.dst = ret_new;
|
||||
if (x->mem_set.val == ci) x->mem_set.val = ret_new;
|
||||
if (x->mem_set.size == ci) x->mem_set.size = ret_new;
|
||||
break;
|
||||
case SPL_IR_TYPE_OFFSETOF:
|
||||
if (x->ir_offsetof.field_idx == ci) x->ir_offsetof.field_idx = ret_new;
|
||||
break;
|
||||
case SPL_IR_AGG_CONSTRUCT:
|
||||
for (usize k = 0; k < vec_size(x->agg_construct.fields); k++)
|
||||
if (vec_at(x->agg_construct.fields, k) == ci)
|
||||
vec_at(x->agg_construct.fields, k) = ret_new;
|
||||
break;
|
||||
case SPL_IR_AGG_EXTRACT:
|
||||
if (x->agg_extract.val == ci) x->agg_extract.val = ret_new;
|
||||
break;
|
||||
case SPL_IR_AGG_INSERT:
|
||||
if (x->agg_insert.agg == ci) x->agg_insert.agg = ret_new;
|
||||
if (x->agg_insert.field == ci) x->agg_insert.field = ret_new;
|
||||
break;
|
||||
case SPL_IR_CONTROL_SELECT:
|
||||
if (x->control_select.cond == ci) x->control_select.cond = ret_new;
|
||||
if (x->control_select.true_val == ci) x->control_select.true_val = ret_new;
|
||||
if (x->control_select.false_val == ci) x->control_select.false_val = ret_new;
|
||||
break;
|
||||
case SPL_IR_CONTROL_BR:
|
||||
if (x->control_br.cond == ci) x->control_br.cond = ret_new;
|
||||
break;
|
||||
case SPL_IR_CONTROL_CALL:
|
||||
if (x->control_call.func == ci) x->control_call.func = ret_new;
|
||||
for (usize k = 0; k < vec_size(x->control_call.params); k++)
|
||||
if (vec_at(x->control_call.params, k) == ci)
|
||||
vec_at(x->control_call.params, k) = ret_new;
|
||||
break;
|
||||
case SPL_IR_CONTROL_PARAM:
|
||||
if (x->control_param.idx == ci) x->control_param.idx = ret_new;
|
||||
break;
|
||||
case SPL_IR_CONTROL_RET:
|
||||
if (x->control_ret.val == ci) x->control_ret.val = ret_new;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (x)
|
||||
xform_node_value_refs(x, replace_one, &rep);
|
||||
}
|
||||
|
||||
free(c.param_ref);
|
||||
|
||||
+698
-713
File diff suppressed because it is too large.
Load diff
@@ -5,9 +5,6 @@ typedef struct {
|
||||
const char *fname;
|
||||
int line;
|
||||
int col;
|
||||
|
||||
const char *dbg_name;
|
||||
// TODO
|
||||
} spl_dbg_node_t;
|
||||
|
||||
#define SPL_FATAL(dbg, fmt, ...) \
|
||||
|
||||
+4
-1
@@ -223,6 +223,9 @@ typedef struct {
|
||||
usize frame_bytes;
|
||||
} frame_layout_t;
|
||||
|
||||
/* panic 数据区:fmt slice + msg slice,各 2 words(ptr + len)。 */
|
||||
enum { IR2VM_PANIC_WORDS = 4 };
|
||||
|
||||
/* 结果槽存标量;聚合/大对象额外分配一块数据区(data_off)。 */
|
||||
static usize node_data_size(spl_ir2vm_t *ctx, const spl_ir_func_t *f, const spl_ir_node_t *node) {
|
||||
switch (node->kind) {
|
||||
@@ -254,7 +257,7 @@ static usize node_data_size(spl_ir2vm_t *ctx, const spl_ir_func_t *f, const spl_
|
||||
return ir_type_size(ctx, node->mem_load.tid);
|
||||
return 0;
|
||||
case SPL_IR_DBG_PANIC:
|
||||
return sizeof(spl_vm_val_t) * 4; /* TODO: fmt slice + msg slice */
|
||||
return sizeof(spl_vm_val_t) * IR2VM_PANIC_WORDS;
|
||||
case SPL_IR_CONTROL_CALL:
|
||||
if (ir_is_aggregate(ctx, node->control_call.tid))
|
||||
return ir_type_size(ctx, node->control_call.tid);
|
||||
|
||||
@@ -252,8 +252,6 @@ static void resolve_type(spl_layout_t *layout, spl_type_t *type, spl_type_id_t i
|
||||
switch (tn->kind) {
|
||||
case SPL_TYPE_ERROR:
|
||||
case SPL_TYPE_INFER:
|
||||
case SPL_TYPE_FORALL:
|
||||
case SPL_TYPE_EXISTS:
|
||||
case SPL_TYPE_NEVER:
|
||||
case SPL_TYPE_UNIT:
|
||||
info->size_bits = 0;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ typedef struct {
|
||||
} spl_layout_info_t;
|
||||
|
||||
typedef struct {
|
||||
enum { SPL_BIG_ENDIAN, SPL_LITTLE_ENDIAN } endian; // TODO 更多位存储方式
|
||||
enum { SPL_BIG_ENDIAN, SPL_LITTLE_ENDIAN } endian;
|
||||
usize ptr_size;
|
||||
usize ptr_align;
|
||||
} spl_layout_target_t;
|
||||
|
||||
+2
-1
@@ -465,7 +465,8 @@ spl_tok_vec_t spl_lex(const char *source, const char *fname) {
|
||||
TRY_OP1('$', TOK_DOLLAR);
|
||||
TRY_OP1('?', TOK_COND);
|
||||
|
||||
// TODO
|
||||
LOG_ERROR("%s:%zu:%zu: unknown character '%c' (0x%02x)", fname ? fname : "<null>", line, col,
|
||||
(c >= 32 && c < 127) ? c : '?', (unsigned char)c);
|
||||
spl_tok_t tok;
|
||||
memset(&tok, 0, sizeof(tok));
|
||||
tok.type = TOK_UNKNOWN;
|
||||
|
||||
+1055
-955
File diff suppressed because it is too large.
Load diff
@@ -9,8 +9,6 @@ static usize spl_type_hash(spl_type_node_t n) {
|
||||
case SPL_TYPE_ANY:
|
||||
case SPL_TYPE_NEVER:
|
||||
case SPL_TYPE_INFER:
|
||||
case SPL_TYPE_FORALL:
|
||||
case SPL_TYPE_EXISTS:
|
||||
case SPL_TYPE_BOOL:
|
||||
break;
|
||||
case SPL_TYPE_INT:
|
||||
@@ -61,8 +59,6 @@ static int spl_type_eq(spl_type_node_t n1, spl_type_node_t n2) {
|
||||
case SPL_TYPE_ANY:
|
||||
case SPL_TYPE_NEVER:
|
||||
case SPL_TYPE_INFER:
|
||||
case SPL_TYPE_FORALL:
|
||||
case SPL_TYPE_EXISTS:
|
||||
case SPL_TYPE_BOOL:
|
||||
return 0;
|
||||
case SPL_TYPE_INT:
|
||||
@@ -253,10 +249,6 @@ static void spl_type_pure_dump_rec(spl_type_t *type, spl_type_id_t id, spl_type_
|
||||
case SPL_TYPE_INFER:
|
||||
printf("infer");
|
||||
break;
|
||||
case SPL_TYPE_FORALL:
|
||||
case SPL_TYPE_EXISTS:
|
||||
printf("quant");
|
||||
break;
|
||||
case SPL_TYPE_BOOL:
|
||||
printf("bool");
|
||||
break;
|
||||
|
||||
@@ -42,8 +42,6 @@ typedef enum {
|
||||
SPL_TYPE_UNION,
|
||||
SPL_TYPE_ENUM,
|
||||
SPL_TYPE_FN,
|
||||
SPL_TYPE_FORALL, // TODO delete
|
||||
SPL_TYPE_EXISTS, // TODO delete
|
||||
SPL_TYPE_SHAPE,
|
||||
} spl_type_node_kind_t;
|
||||
|
||||
|
||||
Reference in new issue
Block a user