X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=driver%2Ffirm_cmdline.c;h=c3e34ffc6eb30f230bf9a9b46851b12fc39be0b6;hb=e53f30472457acff3fcac2c70385307c70e41873;hp=955813d55d54987900c801310f3f59485d3931f7;hpb=31b78ca8ffddd0f74a9fa9fb18e001fd8651be5a;p=cparser diff --git a/driver/firm_cmdline.c b/driver/firm_cmdline.c index 955813d..c3e34ff 100644 --- a/driver/firm_cmdline.c +++ b/driver/firm_cmdline.c @@ -12,6 +12,14 @@ #include #include +#ifdef _WIN32 +#define DEFAULT_OS OS_SUPPORT_MINGW +#elif defined(__APPLE__) +#define DEFAULT_OS OS_SUPPORT_MACHO +#else +#define DEFAULT_OS OS_SUPPORT_LINUX +#endif + /* optimization settings */ struct a_firm_opt firm_opt = { /* enabled = */ TRUE, @@ -20,8 +28,9 @@ struct a_firm_opt firm_opt = { /* reassoc = */ TRUE, /* cse = */ TRUE, /* control_flow = */ TRUE, - /* code_place = */ TRUE, - /* gvn_pre = */ FALSE, /* currently buggy */ + /* combo = */ TRUE, + /* gcse = */ TRUE, + /* gvn_pre = */ FALSE, /* cond_eval = */ FALSE, /* if_conversion = */ FALSE, /* func_calls = */ TRUE, @@ -40,13 +49,12 @@ struct a_firm_opt firm_opt = { /* precise_exc = */ FALSE, /* never needed for C */ /* use_DivMod = */ FALSE, /* remove_unused = */ TRUE, - /* jmp_tbls = */ TRUE, /* cloning = */ FALSE, /* auto_sync = */ TRUE, /* alias_analysis = */ TRUE, /* strict_alias = */ FALSE, /* no_alias = */ FALSE, - /* luffig = */ FALSE, + /* sync = */ TRUE, /* deconv = */ FALSE, /* cc_opt = */ TRUE, /* bool_opt = */ FALSE, @@ -56,7 +64,7 @@ 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, @@ -122,8 +130,10 @@ static const struct params { { X("no-const-fold"), &firm_opt.const_folding, 0, "firm: disable constant folding" }, { X("control_flow"), &firm_opt.control_flow, 1, "firm: enable control flow optimization" }, { X("no-control-flow"), &firm_opt.control_flow, 0, "firm: disable control flow optimization" }, - { X("code-place"), &firm_opt.code_place, 1, "firm: enable GCSE and code placement" }, - { X("no-code-place"), &firm_opt.code_place, 0, "firm: disable GCSE and code placement" }, + { X("combo"), &firm_opt.combo, 1, "firm: enable combined CCE, UCE and GVN" }, + { X("no-combo"), &firm_opt.combo, 0, "firm: disable combined CCE, UCE and GVN" }, + { X("gcse"), &firm_opt.gcse, 1, "firm: enable global common subexpression elimination" }, + { X("no-gcse"), &firm_opt.gcse, 0, "firm: disable global common subexpression elimination" }, { X("gvn-pre"), &firm_opt.gvn_pre, 1, "firm: enable GVN partial redundancy elimination" }, { X("no-gvn-pre"), &firm_opt.gvn_pre, 0, "firm: disable GVN partial redundancy elimination" }, { X("cond-eval"), &firm_opt.cond_eval, 1, "firm: enable partial condition evaluation optimization" }, @@ -156,8 +166,6 @@ static const struct params { { X("no-opt-load-store"), &firm_opt.load_store, 0, "firm: disable load store optimization" }, { X("opt-modes"), &firm_opt.modes, 1, "firm: optimize integer modes" }, { X("no-opt-modes"), &firm_opt.modes, 0, "firm: disable integer modes optimization" }, - { X("jmptbls"), &firm_opt.jmp_tbls, 1, "firm: create jump table for switch" }, - { X("no-jmptbls"), &firm_opt.jmp_tbls, 0, "firm: do not create jump table for switch" }, { X("sync"), &firm_opt.auto_sync, 1, "firm: automatically create Sync nodes" }, { X("no-sync"), &firm_opt.auto_sync, 0, "firm: do not create Sync nodes" }, { X("opt-alias"), &firm_opt.alias_analysis, 1, "firm: enable alias analysis" }, @@ -178,8 +186,8 @@ static const struct params { { X("fp-precise"), &firm_opt.fp_model, fp_model_precise, "firm: precise fp model" }, { X("fp-fast"), &firm_opt.fp_model, fp_model_fast, "firm: fast fp model" }, { X("fp-strict"), &firm_opt.fp_model, fp_model_strict, "firm: strict fp model" }, - { X("luffig"), &firm_opt.luffig, 1, "firm: enable the fluffy load/store optimization" }, - { X("no-luffig"), &firm_opt.luffig, 0, "firm: disable the fluffy load/store optimization" }, + { X("sync"), &firm_opt.sync, 1, "firm: use Syncs to remove unnecessary memory dependencies" }, + { X("no-sync"), &firm_opt.sync, 0, "firm: do not use Syncs to remove unnecessary memory dependencies" }, { X("deconv"), &firm_opt.deconv, 1, "firm: enable the conv node optimization" }, { X("no-deconv"), &firm_opt.deconv, 0, "firm: disable the conv node optimization" }, { X("opt-cc"), &firm_opt.cc_opt, 1, "firm: enable calling conventions optimization" }, @@ -239,7 +247,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_MINGW, "misc: generate MinGW 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="), NULL, 0, "misc: yComp host" }, { X("ycomp-port="), NULL, 0, "misc: yComp port" }, @@ -282,7 +292,7 @@ static void disable_opts(void) { firm_opt.reassoc = FALSE; firm_opt.cse = FALSE; /* firm_opt.control_flow */ - firm_opt.code_place = FALSE; + firm_opt.gcse = FALSE; firm_opt.gvn_pre = FALSE; firm_opt.cond_eval = FALSE; firm_opt.if_conversion = FALSE; @@ -305,7 +315,7 @@ static void disable_opts(void) { firm_opt.alias_analysis = FALSE; firm_opt.strict_alias = FALSE; firm_opt.no_alias = FALSE; - firm_opt.luffig = FALSE; + firm_opt.sync = FALSE; firm_opt.deconv = FALSE; firm_opt.cc_opt = FALSE; firm_opt.bool_opt = FALSE; @@ -365,18 +375,10 @@ int firm_option(const char *opt) if (firm_opt.debug_mode == DBG_MODE_FULL) disable_opts(); res = 1; -#ifdef FIRM_BACKEND res &= firm_be_option("omitfp=0"); res &= firm_be_option("stabs"); -#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; } }