Compute methods_with_llvm/without_llvm correctly even if --llvm is not given.
authorZoltan Varga <vargaz@gmail.com>
Thu, 19 Aug 2010 18:14:18 +0000 (20:14 +0200)
committerZoltan Varga <vargaz@gmail.com>
Thu, 19 Aug 2010 18:14:46 +0000 (20:14 +0200)
mono/mini/mini.c

index 38f502c7c969a8a8c84acfa0cb464dbb63195638..338bcf8592c8732cba0d74e18f8db0f187539fdf 100644 (file)
@@ -3947,7 +3947,6 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                                        printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
                                        //g_free (nm);
                                }
-                               InterlockedIncrement (&methods_without_llvm);
                                mono_destroy_compile (cfg);
                                try_llvm = FALSE;
                                goto restart_compile;
@@ -4523,14 +4522,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                                printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
                                //g_free (nm);
                        }
-                       InterlockedIncrement (&methods_without_llvm);
                        mono_destroy_compile (cfg);
                        try_llvm = FALSE;
                        goto restart_compile;
                }
 
-               InterlockedIncrement (&methods_with_llvm);
-
                if (cfg->verbose_level > 0 && !cfg->compile_aot) {
                        nm = mono_method_full_name (cfg->method, TRUE);
                        g_print ("LLVM Method %s emitted at %p to %p (code length %d) [%s]\n", 
@@ -4543,6 +4539,13 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                mono_codegen (cfg);
        }
 
+#ifdef ENABLE_LLVM
+       if (COMPILE_LLVM (cfg))
+               InterlockedIncrement (&methods_with_llvm);
+       else
+               InterlockedIncrement (&methods_without_llvm);
+#endif
+
        if (cfg->verbose_level >= 2) {
                char *id =  mono_method_full_name (cfg->method, FALSE);
                mono_disassemble_code (cfg, cfg->native_code, cfg->code_len, id + 3);