Merge pull request #4433 from kumpera/android-fixes
[mono.git] / mono / mini / method-to-ir.c
index 09bab4683ef57335c2209792745f8b4ea6546db0..5982e0c200851a771b00e243d5a71586c450c074 100644 (file)
@@ -348,14 +348,19 @@ mono_print_bb (MonoBasicBlock *bb, const char *msg)
 {
        int i;
        MonoInst *tree;
+       GString *str = g_string_new ("");
 
-       printf ("\n%s %d: [IN: ", msg, bb->block_num);
+       g_string_append_printf (str, "%s %d: [IN: ", msg, bb->block_num);
        for (i = 0; i < bb->in_count; ++i)
-               printf (" BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
-       printf (", OUT: ");
+               g_string_append_printf (str, " BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
+       g_string_append_printf (str, ", OUT: ");
        for (i = 0; i < bb->out_count; ++i)
-               printf (" BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
-       printf (" ]\n");
+               g_string_append_printf (str, " BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
+       g_string_append_printf (str, " ]\n");
+
+       g_print ("%s", str->str);
+       g_string_free (str, TRUE);
+
        for (tree = bb->code; tree; tree = tree->next)
                mono_print_ins_index (-1, tree);
 }
@@ -6708,7 +6713,7 @@ mini_get_method_allow_open (MonoMethod *m, guint32 token, MonoClass *klass, Mono
 {
        MonoMethod *method;
 
-       mono_error_init (error);
+       error_init (error);
 
        if (m->wrapper_type != MONO_WRAPPER_NONE) {
                method = (MonoMethod *)mono_method_get_wrapper_data (m, token);
@@ -6765,7 +6770,7 @@ mini_get_signature (MonoMethod *method, guint32 token, MonoGenericContext *conte
 {
        MonoMethodSignature *fsig;
 
-       mono_error_init (error);
+       error_init (error);
        if (method->wrapper_type != MONO_WRAPPER_NONE) {
                fsig = (MonoMethodSignature *)mono_method_get_wrapper_data (method, token);
        } else {
@@ -11585,7 +11590,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                        tclass, MONO_RGCTX_INFO_REFLECTION_TYPE);
                                        } else if (cfg->compile_aot) {
                                                if (method->wrapper_type) {
-                                                       mono_error_init (&error); //got to do it since there are multiple conditionals below
+                                                       error_init (&error); //got to do it since there are multiple conditionals below
                                                        if (mono_class_get_checked (tclass->image, tclass->type_token, &error) == tclass && !generic_context) {
                                                                /* Special case for static synchronized wrappers */
                                                                EMIT_NEW_TYPE_FROM_HANDLE_CONST (cfg, ins, tclass->image, tclass->type_token, generic_context);