Build mono runtime under none desktop Windows API family, adjustments and cleanup.
[mono.git] / mono / mini / graph.c
index 79e06a323686b67038949e75ac34bd62d588aeaa..95e1fff2bb42a59abeb32870870b8c718163494f 100644 (file)
@@ -6,6 +6,12 @@
  *
  * (C) 2003 Ximian, Inc.
  */
+
+#include <config.h>
+#include <mono/utils/mono-compiler.h>
+
+#ifndef DISABLE_JIT
+
 #include <string.h>
 #include <mono/metadata/debug-helpers.h>
 
@@ -15,7 +21,7 @@ static char *
 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++) {
@@ -190,15 +196,15 @@ mono_print_label (FILE *fp, MonoInst *tree) {
                mono_print_label (fp, tree->inst_newa_len);
                break;
        case OP_CALL:
-       case OP_CALLVIRT:
+       case OP_CALL_MEMBASE:
        case OP_FCALL:
-       case OP_FCALLVIRT:
+       case OP_FCALL_MEMBASE:
        case OP_LCALL:
-       case OP_LCALLVIRT:
+       case OP_LCALL_MEMBASE:
        case OP_VCALL:
-       case OP_VCALLVIRT:
+       case OP_VCALL_MEMBASE:
        case OP_VOIDCALL:
-       case OP_VOIDCALLVIRT: {
+       case OP_VOIDCALL_MEMBASE: {
                MonoCallInst *call = (MonoCallInst*)tree;
                if (call->method) {
                        if (mono_method_signature (call->method)->hasthis && tree->inst_left) {
@@ -309,6 +315,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+");
@@ -330,9 +337,19 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options)
 
        fclose (fp);
 
+#ifdef HAVE_SYSTEM
        //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);
+#else
+       g_assert_not_reached ();
+#endif
 }
 
+#else /* !DISABLE_JIT */
+
+MONO_EMPTY_SOURCE_FILE (graph);
+
+#endif /* !DISABLE_JIT */
+