Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawSumma committed May 13, 2024
1 parent 6339e28 commit 7784ff7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions main/minivm.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ int main(int argc, char **argv) {
config->dump_tb_opt = true;
} else if (!strcmp(arg, "asm")) {
config->dump_asm = true;
} else if (!strcmp(arg, "c")) {
config->dump_c = true;
} else if (!strcmp(arg, "args")) {
config->dump_args = true;
} else if (!strcmp(arg, "time")) {
Expand Down
2 changes: 1 addition & 1 deletion vm/backend/tb.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ vm_std_value_t vm_tb_run_repl(vm_config_t *config, vm_block_t *entry, vm_blocks_
tb_c_print_prelude(cbuf, mod);
tb_c_print_function(cbuf, fun, worklist, tmp_arena);
const char *buf = tb_c_buf_to_data(cbuf);
if (config->dump_asm) {
if (config->dump_c) {
printf("\n--- c ---\n%s", buf);
}
TCCState *state = tcc_new();
Expand Down
2 changes: 1 addition & 1 deletion vm/backend/tb_dyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ vm_tb_dyn_func_t *vm_tb_dyn_comp(vm_tb_dyn_state_t *state, vm_block_t *entry) {
}
}
const char *buf = tb_c_buf_to_data(cbuf);
if (state->config->dump_asm) {
if (state->config->dump_c) {
printf("\n--- c ---\n%s", buf);
}
TCCState *state = tcc_new();
Expand Down
2 changes: 1 addition & 1 deletion vm/backend/tb_ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ static void *vm_tb_ver_rfunc_comp(vm_rblock_t *rblock) {
tb_c_print_prelude(cbuf, state->module);
tb_c_print_function(cbuf, f, worklist, state->tmp_arena);
const char *buf = tb_c_buf_to_data(cbuf);
if (state->config->dump_asm) {
if (state->config->dump_c) {
printf("\n--- c ---\n%s", buf);
}
TCCState *state = tcc_new();
Expand Down
1 change: 1 addition & 0 deletions vm/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct vm_config_t {
bool dump_tb : 1;
bool dump_tb_opt : 1;
bool dump_asm : 1;
bool dump_c : 1;
bool dump_args : 1;
bool dump_time : 1;

Expand Down

0 comments on commit 7784ff7

Please sign in to comment.