Fix compilation warnings

This commit is contained in:
Dmitry Stogov 2022-09-05 22:43:27 +03:00
parent 7f703fb176
commit 76028e8855
5 changed files with 10 additions and 5 deletions

5
ir.g
View File

@ -125,7 +125,7 @@ ir_func_prototype(ir_parser_ctx *p):
ir_insn(ir_parser_ctx *p):
{const char *str, *str2 = NULL, *func;}
{size_t len, len2, func_len;}
{size_t len, len2 = 0, func_len;}
{uint8_t op;}
{uint8_t t = 0;}
{ir_ref op1 = IR_UNUSED;}
@ -147,7 +147,8 @@ ir_insn(ir_parser_ctx *p):
ID(&str, &len)
)
"="
( const(t, &val)
( {val.u64 = 0;}
const(t, &val)
{ref = ir_const(p->ctx, val, t);}
| "func" "(" ID(&func, &func_len)
{flags.u64 = 0;}

2
ir.h
View File

@ -588,7 +588,7 @@ void ir_dump_live_ranges(ir_ctx *ctx, FILE *f);
int ir_emit_c(ir_ctx *ctx, FILE *f);
/* IR verification API (implementation in ir_check.c) */
void ir_check(ir_ctx *ctx);
bool ir_check(ir_ctx *ctx);
void ir_consistency_check(void);
/* IR Memmory Allocation */

View File

@ -33,7 +33,7 @@ void ir_consistency_check(void)
IR_ASSERT(IR_ADD + 1 == IR_SUB);
}
void ir_check(ir_ctx *ctx)
bool ir_check(ir_ctx *ctx)
{
//TODO:
ir_ref i, j, n, *p, use;
@ -179,4 +179,5 @@ void ir_check(ir_ctx *ctx)
}
IR_ASSERT(ok);
return ok;
}

View File

@ -548,6 +548,7 @@ restart:
}
new_insn->op3 = ref;
if (n > 3) {
ir_ref *ops = new_insn->ops;
for (k = 3, p = insn->ops + 3; k <= n; k++, p++) {
ref = *p;
ref = _xlat[ref];
@ -556,7 +557,7 @@ restart:
lists[ref].count++;
edges_count++;
}
new_insn->ops[k] = ref;
ops[k] = ref;
}
}
break;

View File

@ -1273,6 +1273,7 @@ IR_ALWAYS_INLINE ir_live_pos ir_ival_end(ir_live_interval *ival)
#endif
}
#ifdef IR_DEBUG
static bool ir_ival_covers(ir_live_interval *ival, ir_live_pos position)
{
ir_live_range *live_range = &ival->range;
@ -1286,6 +1287,7 @@ static bool ir_ival_covers(ir_live_interval *ival, ir_live_pos position)
return 0;
}
#endif
static bool ir_ival_has_hole_between(ir_live_interval *ival, ir_live_pos from, ir_live_pos to)
{