X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgraph.c;h=f13530082174053e8e7ef6fae8b7ce887ce66635;hb=081280659abccd2ff89056572bd6cd192d7747fe;hp=08d2891f87c239c138f3d1e48284f3f8c8399aef;hpb=e137ff6f7e2594d3ce96b4c74b528d26cc80e11d;p=mono.git diff --git a/mono/mini/graph.c b/mono/mini/graph.c index 08d2891f87c..f1353008217 100644 --- a/mono/mini/graph.c +++ b/mono/mini/graph.c @@ -1,5 +1,6 @@ -/* - * 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) @@ -8,6 +9,7 @@ */ #include +#include #ifndef DISABLE_JIT @@ -154,121 +156,6 @@ mono_draw_cfg (MonoCompile *cfg, FILE *fp) 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) { @@ -346,5 +233,9 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options) #endif } -#endif /* DISABLE_JIT */ +#else /* !DISABLE_JIT */ + +MONO_EMPTY_SOURCE_FILE (graph); + +#endif /* !DISABLE_JIT */