summaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-07-13 15:00:45 +0900
committerYukihiro Matsumoto <[email protected]>2012-07-13 15:00:45 +0900
commit737eaea038af56794b8fdb5a66bb4138dbd446f6 (patch)
tree00cd7c3d021325fd0adad67a32aee0aac2fb5461 /src/codegen.c
parentbbec03bb7af3fb0277a267e4ec5d38b58aa5cb46 (diff)
downloadmruby-737eaea038af56794b8fdb5a66bb4138dbd446f6.tar.gz
mruby-737eaea038af56794b8fdb5a66bb4138dbd446f6.zip
allow DISABLE/ENABLE_SATDIO
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 3ef52a0d4..6db09f310 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -94,7 +94,9 @@ codegen_error(codegen_scope *s, const char *message)
s = s->prev;
}
mrb_pool_close(s->mpool);
+#ifdef ENABLE_STDIO
fprintf(stderr, "codegen error: %s\n", message);
+#endif
longjmp(s->jmp, 1);
}
@@ -270,7 +272,9 @@ dispatch(codegen_scope *s, int pc)
case OP_ONERR:
break;
default:
+#ifdef ENABLE_STDIO
fprintf(stderr, "bug: dispatch on non JMP op\n");
+#endif
scope_error(s);
}
s->iseq[pc] = MKOP_AsBx(c, GETARG_A(i), diff);
@@ -739,7 +743,9 @@ gen_assignment(codegen_scope *s, node *node, int sp, int val)
break;
default:
+#ifdef ENABLE_STDIO
printf("unknown lhs %d\n", type);
+#endif
break;
}
if (val) push();
@@ -2047,6 +2053,7 @@ loop_pop(codegen_scope *s, int val)
static void
codedump(mrb_state *mrb, int n)
{
+#ifdef ENABLE_STDIO
mrb_irep *irep = mrb->irep[n];
int i;
mrb_code c;
@@ -2342,6 +2349,7 @@ codedump(mrb_state *mrb, int n)
}
}
printf("\n");
+#endif
}
void