1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

mjit_compile.c: fix inconsistent indentation

and style of generated code.

I've used 2-space indentation at first but at some moment I started to
use insns.def contents for generated code. So the 4-space indentation
was introduced. But it does no longer make sense.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-02-06 14:27:15 +00:00
parent 3cb196f404
commit d409017bc6
2 changed files with 11 additions and 11 deletions

View file

@ -137,7 +137,7 @@ mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *func
status.success = TRUE;
status.compiled_for_pos = ZALLOC_N(int, body->iseq_size);
fprintf(f, "VALUE %s(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp) {\n", funcname);
fprintf(f, "VALUE\n%s(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp)\n{\n", funcname);
fprintf(f, " VALUE *stack = reg_cfp->sp;\n");
/* Simulate `opt_pc` in setup_parameters_complex */
@ -159,7 +159,7 @@ mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *func
fprintf(f, " }\n");
compile_insns(f, body, 0, 0, &status);
fprintf(f, "}\n");
fprintf(f, "\n} /* end of %s */\n", funcname);
xfree(status.compiled_for_pos);
return status.success;

View file

@ -63,4 +63,4 @@ switch (insn) {
/* if next_pos is already compiled, next instruction won't be compiled in C code and needs `goto`. */
if ((next_pos < body->iseq_size && status->compiled_for_pos[next_pos]))
fprintf(f, " goto label_%d;\n", next_pos);
fprintf(f, "goto label_%d;\n", next_pos);