diff --git a/mach/proto/mcg/procedure.h b/mach/proto/mcg/procedure.h index de11c5458..2414db050 100644 --- a/mach/proto/mcg/procedure.h +++ b/mach/proto/mcg/procedure.h @@ -3,6 +3,8 @@ struct local { + int size; + int offset; bool is_register; }; @@ -16,6 +18,7 @@ struct procedure }; extern void procedure_compile(struct procedure* proc); +extern void procedure_update_bb_graph(struct procedure* proc); #endif diff --git a/mach/proto/mcg/treebuilder.c b/mach/proto/mcg/treebuilder.c index e8675e613..c99bb7edd 100644 --- a/mach/proto/mcg/treebuilder.c +++ b/mach/proto/mcg/treebuilder.c @@ -111,6 +111,7 @@ void tb_regvar(struct procedure* procedure, arith offset, int size, int type, in { struct local* local = calloc(1, sizeof(*local)); local->size = size; + local->offset = offset; local->is_register = true; imap_put(&procedure->locals, offset, local); } @@ -413,6 +414,16 @@ static void insn_ivalue(int opcode, arith value) change_by(new_localir(value), -1); break; + case op_zrl: + appendir( + new_ir2( + IR_STORE, EM_wordsize, + new_localir(value), + new_wordir(0) + ) + ); + break; + case op_loc: push( new_wordir(value)