-/*
- * graph.c: Helper routines to graph various internal states of the code generator
+/**
+ * \file
+ * Helper routines to graph various internal states of the code generator
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*/
#include <config.h>
+#include <mono/utils/mono-compiler.h>
#ifndef DISABLE_JIT
convert_name (const char *str)
{
int i, j, len = strlen (str);
- char *res = g_malloc (len * 2);
+ char *res = (char *)g_malloc (len * 2);
j = 0;
for (i = 0; i < len; i++) {
fprintf (fp, "}\n");
}
-#if 0
-
-static void
-mono_print_label (FILE *fp, MonoInst *tree) {
- int arity;
-
- if (!tree)
- return;
-
- arity = mono_burg_arity [tree->opcode];
-
- fprintf (fp, "\\ %s%s", arity? "(": "", mono_inst_name (tree->opcode));
-
- switch (tree->opcode) {
- case OP_ICONST:
- fprintf (fp, "[%ld]", (long)tree->inst_c0);
- break;
- case OP_I8CONST:
- fprintf (fp, "[%lld]", (long long)tree->inst_l);
- break;
- case OP_R8CONST:
- fprintf (fp, "[%f]", *(double*)tree->inst_p0);
- break;
- case OP_R4CONST:
- fprintf (fp, "[%f]", *(float*)tree->inst_p0);
- break;
- case OP_ARG:
- case OP_LOCAL:
- fprintf (fp, "[%d]", (int)tree->inst_c0);
- break;
- case OP_REGOFFSET:
- fprintf (fp, "[0x%x(%s)]", (int)tree->inst_offset, mono_arch_regname (tree->inst_basereg));
- break;
- case OP_REGVAR:
- fprintf (fp, "[%s]", mono_arch_regname (tree->dreg));
- break;
- case CEE_NEWARR:
- fprintf (fp, "[%s]", tree->inst_newa_class->name);
- mono_print_label (fp, tree->inst_newa_len);
- break;
- case OP_CALL:
- case OP_CALL_MEMBASE:
- case OP_FCALL:
- case OP_FCALL_MEMBASE:
- case OP_LCALL:
- case OP_LCALL_MEMBASE:
- case OP_VCALL:
- case OP_VCALL_MEMBASE:
- case OP_VOIDCALL:
- case OP_VOIDCALL_MEMBASE: {
- MonoCallInst *call = (MonoCallInst*)tree;
- if (call->method) {
- if (mono_method_signature (call->method)->hasthis && tree->inst_left) {
- mono_print_label (fp, tree->inst_left);
- }
- fprintf (fp, "[%s]", call->method->name);
- }
- break;
- }
- case OP_PHI: {
- int i;
- fprintf (fp, "[%d\\ (", (int)tree->inst_c0);
- for (i = 0; i < tree->inst_phi_args [0]; i++) {
- if (i)
- fprintf (fp, ",\\ ");
- fprintf (fp, "%d", tree->inst_phi_args [i + 1]);
- }
- fprintf (fp, ")]");
- break;
- }
- case OP_NOP:
- case OP_JMP:
- case OP_BREAK:
- break;
- case OP_BR:
- fprintf (fp, "[B%d]", tree->inst_target_bb->block_num);
- break;
- case OP_SWITCH:
- case CEE_ISINST:
- case CEE_CASTCLASS:
- case OP_CALL_REG:
- case OP_FCALL_REG:
- case OP_LCALL_REG:
- case OP_VCALL_REG:
- case OP_VOIDCALL_REG:
- mono_print_label (fp, tree->inst_left);
- break;
- case CEE_BNE_UN:
- case CEE_BEQ:
- case CEE_BLT:
- case CEE_BLT_UN:
- case CEE_BGT:
- case CEE_BGT_UN:
- case CEE_BGE:
- case CEE_BGE_UN:
- case CEE_BLE:
- case CEE_BLE_UN:
- fprintf (fp, "[B%dB%d]", tree->inst_true_bb->block_num, tree->inst_false_bb->block_num);
- mono_print_label (fp, tree->inst_left);
- break;
- default:
- if (arity) {
- mono_print_label (fp, tree->inst_left);
- if (arity > 1)
- mono_print_label (fp, tree->inst_right);
- }
- break;
- }
-
- if (arity)
- fprintf (fp, ")");
-}
-
-#endif
-
static void
mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
{
#endif
}
-#endif /* DISABLE_JIT */
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (graph);
+
+#endif /* !DISABLE_JIT */