[jit] Fix fbd9fd71679f626fabe0b1bd7f923836f98252b4, a wrong version was commited.
[mono.git] / mono / mini / graph.c
index c693784aa4c4454f983848823c0d69a1328508cd..09917f93e4b9b8e39a157fc5c540da1bf0ae0d88 100644 (file)
@@ -6,6 +6,11 @@
  *
  * (C) 2003 Ximian, Inc.
  */
+
+#include <config.h>
+
+#ifndef DISABLE_JIT
+
 #include <string.h>
 #include <mono/metadata/debug-helpers.h>
 
@@ -149,6 +154,8 @@ mono_draw_cfg (MonoCompile *cfg, FILE *fp)
        fprintf (fp, "}\n");
 }
 
+#if 0
+
 static void
 mono_print_label (FILE *fp, MonoInst *tree) {
        int arity;
@@ -187,8 +194,8 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                fprintf (fp, "[%s]",  tree->inst_newa_class->name);
                mono_print_label (fp, tree->inst_newa_len);
                break;
-       case CEE_CALL:
-       case CEE_CALLVIRT:
+       case OP_CALL:
+       case OP_CALLVIRT:
        case OP_FCALL:
        case OP_FCALLVIRT:
        case OP_LCALL:
@@ -217,8 +224,6 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                fprintf (fp, ")]");
                break;
        }
-       case OP_RENAME:
-       case OP_RETARG:
        case OP_NOP:
        case OP_JMP:
        case OP_BREAK:
@@ -226,10 +231,9 @@ mono_print_label (FILE *fp, MonoInst *tree) {
        case OP_BR:
                fprintf (fp, "[B%d]", tree->inst_target_bb->block_num);
                break;
-       case CEE_SWITCH:
+       case OP_SWITCH:
        case CEE_ISINST:
        case CEE_CASTCLASS:
-       case OP_OUTARG:
        case OP_CALL_REG:
        case OP_FCALL_REG:
        case OP_LCALL_REG:
@@ -263,6 +267,8 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                fprintf (fp, ")");
 }
 
+#endif
+
 static void
 mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
 {
@@ -289,8 +295,8 @@ mono_draw_code_cfg (MonoCompile *cfg, FILE *fp)
 
                fprintf (fp, "BB%d [%sshape=record,labeljust=l,label=\"{BB%d|", bb->block_num, color, bb->block_num);
                        
-               for (inst = bb->code; inst; inst = inst->next) {
-                       mono_print_label (fp, inst);
+               MONO_BB_FOR_EACH_INS (bb, inst) {
+                       //mono_print_label (fp, inst);
                        fprintf (fp, "\\n");                    
                }
 
@@ -308,6 +314,7 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options)
        char *com;
        const char *fn;
        FILE *fp;
+       int _i G_GNUC_UNUSED;
 
        fn = "/tmp/minidtree.graph";
        fp = fopen (fn, "w+");
@@ -331,7 +338,9 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options)
 
        //com = g_strdup_printf ("dot %s -Tpng -o %s.png; eog %s.png", fn, fn, fn);
        com = g_strdup_printf ("dot %s -Tps -o %s.ps;gv %s.ps", fn, fn, fn);
-       system (com);
+       _i = system (com);
        g_free (com);
 }
 
+#endif /* DISABLE_JIT */
+