2009-12-03 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / driver.c
index 30dc3f88105f472d04e325e8979ad5a3a59233b9..627603588facd2ed05bdab735d02a081239256b4 100644 (file)
@@ -61,7 +61,7 @@ static FILE *mini_stats_fd = NULL;
 
 static void mini_usage (void);
 
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
 /* Need this to determine whether to detach console */
 #include <mono/metadata/cil-coff.h>
 /* This turns off command line globbing under win32 */
@@ -1123,6 +1123,7 @@ mini_usage (void)
                "                           mode is one of cas, core-clr, verifiable or validil\n"
                "    --attach=OPTIONS       Pass OPTIONS to the attach agent in the runtime.\n"
                "                           Currently the only supported option is 'disable'.\n"
+               "    --llvm                 Controls whenever the runtime uses LLVM compiled code.\n"
          );
 }
 
@@ -1196,7 +1197,7 @@ static const char info[] =
 #define error_if_aot_unsupported()
 #endif
 
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
 BOOL APIENTRY DllMain (HMODULE module_handle, DWORD reason, LPVOID reserved)
 {
        if (!GC_DllMain (module_handle, reason, reserved))
@@ -1534,6 +1535,13 @@ mono_main (int argc, char* argv[])
 #ifdef MONO_JIT_INFO_TABLE_TEST
                } else if (strcmp (argv [i], "--test-jit-info-table") == 0) {
                        test_jit_info_table = TRUE;
+#endif
+               } else if (strcmp (argv [i], "--llvm") == 0) {
+#ifndef MONO_ARCH_LLVM_SUPPORTED
+                       fprintf (stderr, "--llvm not supported on this platform.\n");
+                       return 1;
+#else
+                       mono_use_llvm = TRUE;
 #endif
                } else {
                        fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
@@ -1551,7 +1559,7 @@ mono_main (int argc, char* argv[])
 
 #ifdef MONO_CROSS_COMPILE
        if (!mono_compile_aot) {
-                  fprintf (stderr, "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.");
+                  fprintf (stderr, "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.\n");
                   exit (1);
        }
 #if SIZEOF_VOID_P == 8 && defined(TARGET_ARM)
@@ -1704,7 +1712,7 @@ mono_main (int argc, char* argv[])
                        exit (1);
                }
 
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
                /* Detach console when executing IMAGE_SUBSYSTEM_WINDOWS_GUI on win32 */
                if (!enable_debugging && !mono_compile_aot && ((MonoCLIImageInfo*)(mono_assembly_get_image (assembly)->image_info))->cli_header.nt.pe_subsys_required == IMAGE_SUBSYSTEM_WINDOWS_GUI)
                        FreeConsole ();