Add/fix comments

This commit is contained in:
Dmitry Stogov 2022-11-02 16:27:16 +03:00
parent d619efa0ad
commit 364669a0a1

3
ir.c
View File

@ -910,9 +910,10 @@ ir_ref ir_bind(ir_ctx *ctx, ir_ref var, ir_ref def)
ctx->binding = ir_mem_malloc(sizeof(ir_hashtab));;
ir_hashtab_init(ctx->binding, 16);
}
/* Node may be bound some VAR node or to some special spill slot (using negative "var") */
/* Node may be bound to some VAR node or to some special spill slot (using negative "var") */
IR_ASSERT(var < 0 || (var < ctx->insns_count && ctx->ir_base[var].op == IR_VAR));
if (!ir_hashtab_add(ctx->binding, def, var)) {
/* Add a copy with different binding */
def = ir_emit2(ctx, IR_OPT(IR_COPY, ctx->ir_base[def].type), def, 1);
ir_hashtab_add(ctx->binding, def, var);
}