pic_state is not used in pic_dump_*

This commit is contained in:
Yuichi Nishiwaki 2014-03-19 19:44:45 +09:00
parent e80c3cc60b
commit bc602aa767
3 changed files with 9 additions and 11 deletions

View File

@ -72,11 +72,9 @@ struct pic_irep {
pic_value pic_analyze(pic_state *, pic_value);
struct pic_irep *pic_codegen(pic_state *, pic_value);
inline void
pic_dump_code(pic_state *pic, pic_code c)
static inline void
pic_dump_code(pic_code c)
{
UNUSED(pic);
printf("[%2d] ", c.insn);
switch (c.insn) {
case OP_NOP:
@ -184,8 +182,8 @@ pic_dump_code(pic_state *pic, pic_code c)
}
}
inline void
pic_dump_irep(pic_state *pic, struct pic_irep *irep)
static inline void
pic_dump_irep(struct pic_irep *irep)
{
unsigned i;
@ -197,11 +195,11 @@ pic_dump_irep(pic_state *pic, struct pic_irep *irep)
}
for (i = 0; i < irep->clen; ++i) {
printf("%02x ", i);
pic_dump_code(pic, irep->code[i]);
pic_dump_code(irep->code[i]);
}
for (i = 0; i < irep->ilen; ++i) {
pic_dump_irep(pic, irep->irep[i]);
pic_dump_irep(irep->irep[i]);
}
}

View File

@ -1460,7 +1460,7 @@ pic_compile(pic_state *pic, pic_value obj)
irep = pic_codegen(pic, obj);
#if DEBUG
fprintf(stdout, "## codegen completed\n");
pic_dump_irep(pic, irep);
pic_dump_irep(irep);
#endif
#if DEBUG

View File

@ -443,7 +443,7 @@ pic_apply_argv(pic_state *pic, struct pic_proc *proc, size_t argc, ...)
}
#if VM_DEBUG
# define OPCODE_EXEC_HOOK pic_dump_code(pic, c)
# define OPCODE_EXEC_HOOK pic_dump_code(c)
#else
# define OPCODE_EXEC_HOOK ((void)0)
#endif
@ -654,7 +654,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, pic_value argv)
puts(")");
if (! pic_proc_func_p(proc)) {
printf(" irep = ");
pic_dump_irep(pic, proc->u.irep);
pic_dump_irep(proc->u.irep);
}
else {
printf(" cfunc = %p\n", (void *)proc->u.func.f);