we can safely enable set_opt_sel_based_null_check_elim() because we use Sel's only...
[cparser] / driver / firm_cmdline.c
index 4195c6f..c7f563b 100644 (file)
 #include <libfirm/firm.h>
 #include <libfirm/be.h>
 
+#ifdef _WIN32
+#define DEFAULT_OS OS_SUPPORT_WIN32
+#else
+#define DEFAULT_OS OS_SUPPORT_LINUX
+#endif
+
 /* optimization settings */
 struct a_firm_opt firm_opt = {
   /* enabled         = */ TRUE,
@@ -24,7 +30,6 @@ struct a_firm_opt firm_opt = {
   /* gvn_pre         = */ FALSE,       /* currently buggy */
   /* cond_eval       = */ FALSE,
   /* if_conversion   = */ FALSE,
-  /* loop_unrolling  = */ FALSE,       /* currently buggy */
   /* func_calls      = */ TRUE,
   /* do_inline       = */ FALSE,
   /* auto_inline     = */ TRUE,
@@ -57,8 +62,10 @@ struct a_firm_opt firm_opt = {
   /* vrfy            = */ FIRM_VERIFICATION_ON,
   /* check_all       = */ FALSE,
   /* lower           = */ TRUE,
-  /* os_support      = */ OS_SUPPORT_LINUX,
+  /* os_support      = */ DEFAULT_OS,
   /* honor_restrict  = */ TRUE,
+  /* lower_bitfields = */ TRUE,
+  /* pic             = */ FALSE,
   /* ycomp_dbg       = */ FALSE,
   /* ycomp_host      = */ FIRM_YCOMP_DEFAULT_HOST,
   /* ycomp_port      = */ FIRM_YCOMP_DEFAULT_PORT,
@@ -104,13 +111,14 @@ static const struct params {
   const char *option;      /**< name of the option */
   int        opt_len;      /**< length of the option string */
   a_byte     *flag;        /**< address of variable to set/reset */
-  int        set;          /**< iff true, variable will be set, else reset */
+  a_byte     set;          /**< iff true, variable will be set, else reset */
   const char *description; /**< description of this option */
 } firm_options[] = {
   /* this must be first */
   { X("help"),                   NULL,                       0, "print FCC related help options" },
 
   /* firm optimization options */
+  { X("pic"),                    &firm_opt.pic,              1, "firm: generate position independent code" },
   { X("g0"),                     &firm_opt.debug_mode,       DBG_MODE_BACKSTORE, "firm: Debug Mode: use back stores" },
   { X("g1"),                     &firm_opt.debug_mode,       DBG_MODE_FULL,      "firm: Debug Mode: no register variables" },
   { X("no-opt"),                 NULL,                       0, "firm: disable all FIRM optimizations" },
@@ -128,8 +136,6 @@ static const struct params {
   { X("no-cond-eval"),           &firm_opt.cond_eval,        0, "firm: disable partial condition evaluation optimization" },
   { X("if-conv"),                &firm_opt.if_conversion,    1, "firm: enable if-conversion optimization" },
   { X("no-if-conv"),             &firm_opt.if_conversion,    0, "firm: disable if-conversion optimization" },
-  { X("opt-loop-unrolling"),     &firm_opt.loop_unrolling,   1, "firm: enable loop-unrolling optimization" },
-  { X("no-opt-loop-unrolling"),  &firm_opt.loop_unrolling,   0, "firm: disable loop-unrolling optimization" },
   { X("opt-func-call"),          &firm_opt.func_calls,       1, "firm: enable function call optimization" },
   { X("no-opt-func-call"),       &firm_opt.func_calls,       0, "firm: disable function call optimization" },
   { X("reassociation"),          &firm_opt.reassoc,          1, "firm: enable reassociation" },
@@ -239,7 +245,9 @@ static const struct params {
   { X("stat-pattern"),           &firm_dump.stat_pattern,    1, "misc: Firm statistic calculates most used pattern" },
   { X("stat-dag"),               &firm_dump.stat_dag,        1, "misc: Firm calculates DAG statistics" },
   { X("firm-asm"),               &firm_dump.gen_firm_asm,    1, "misc: output Firm assembler" },
-  { X("win32"),                  &firm_opt.os_support,       OS_SUPPORT_MINGW, "misc: generate MinGW code" },
+  { X("win32"),                  &firm_opt.os_support,       OS_SUPPORT_WIN32, "misc: generate Win32 code" },
+  { X("mac"),                    &firm_opt.os_support,       OS_SUPPORT_MACHO, "misc: generate MacOS code" },
+  { X("linux"),                  &firm_opt.os_support,       OS_SUPPORT_LINUX, "misc: generate Linux-ELF code" },
   { X("ycomp"),                  &firm_opt.ycomp_dbg,        1, "misc: enable yComp debugger extension" },
   { X("ycomp-host=<hostname>"),  NULL,                       0, "misc: yComp host" },
   { X("ycomp-port=<port>"),      NULL,                       0, "misc: yComp port" },
@@ -286,7 +294,6 @@ static void disable_opts(void) {
   firm_opt.gvn_pre         = FALSE;
   firm_opt.cond_eval       = FALSE;
   firm_opt.if_conversion   = FALSE;
-  firm_opt.loop_unrolling  = FALSE;
   firm_opt.func_calls      = FALSE;
   firm_opt.do_inline       = FALSE;
   firm_opt.auto_inline     = FALSE;
@@ -358,7 +365,7 @@ int firm_option(const char *opt)
       }
       /* statistic options do accumulate */
       if (firm_options[i].flag == &firm_dump.statistic)
-        *firm_options[i].flag |= firm_options[i].set;
+        *firm_options[i].flag = (a_byte) (*firm_options[i].flag | firm_options[i].set);
       else
         *firm_options[i].flag = firm_options[i].set;
 
@@ -372,12 +379,6 @@ int firm_option(const char *opt)
 #endif /* FIRM_BACKEND */
         return res;
       }
-#ifdef FIRM_BACKEND
-      /* OS option must be set to the backend */
-      else if (firm_options[i].flag == &firm_opt.os_support)
-        firm_be_option(firm_opt.os_support == OS_SUPPORT_MINGW ?
-          "ia32-gasmode=mingw" : "ia32-gasmode=linux");
-#endif /* FIRM_BACKEND */
       break;
     }
   }
@@ -409,8 +410,8 @@ void print_firm_version(FILE *f) {
 
   firm_get_version(&version);
 
-  fprintf(f, "Firm C-Compiler using libFirm (%d.%d", version.major, version.minor);
-  if(version.revision[0] != 0) {
+  fprintf(f, "Firm C-Compiler using libFirm (%u.%u", version.major, version.minor);
+  if (version.revision[0] != 0) {
        fputc(' ', f);
     fputs(version.revision, f);
   }
@@ -418,8 +419,8 @@ void print_firm_version(FILE *f) {
        fputc(' ', f);
     fputs(version.build, f);
   }
-  fputs(")\n", f);
-  fprintf(f, "(C) 2006-2007 Michael Beck\n"
-             "(C) 1995-2007 University of Karlsruhe\n"
+  fprintf(f, "}\n"
+                    "(C) 2005-2008 Michael Beck\n"
+             "(C) 1995-2008 University of Karlsruhe\n"
              "Using ");
 }  /* print_firm_version */