X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=driver%2Ffirm_cmdline.c;h=d15e13f2830334c0d17a038c2a2ef585e2c2a7d9;hb=c29f6cc2814aaa0c7a3f25ff1785baf35dbf83f3;hp=663c1a0d65e20218fef61d76f20ea1726cb231ab;hpb=82d978b5f7ddefeea8123bc5da97677603056ceb;p=cparser diff --git a/driver/firm_cmdline.c b/driver/firm_cmdline.c index 663c1a0..d15e13f 100644 --- a/driver/firm_cmdline.c +++ b/driver/firm_cmdline.c @@ -14,6 +14,8 @@ #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 @@ -52,10 +54,11 @@ struct a_firm_opt firm_opt = { /* alias_analysis = */ TRUE, /* strict_alias = */ FALSE, /* no_alias = */ FALSE, - /* sync = */ FALSE, + /* sync = */ TRUE, /* deconv = */ FALSE, /* cc_opt = */ TRUE, /* bool_opt = */ FALSE, + /* end_melt = */ FALSE, /* freestanding; = */ FALSE, /* fp_model = */ fp_model_precise, /* lower_ll = */ FALSE, @@ -70,6 +73,8 @@ struct a_firm_opt firm_opt = { /* ycomp_host = */ FIRM_YCOMP_DEFAULT_HOST, /* ycomp_port = */ FIRM_YCOMP_DEFAULT_PORT, /* clone_threshold = */ DEFAULT_CLONE_THRESHOLD, + /* inline_maxsize = */ 750, + /* inline_threshold= */ 0, /* vrfy_edges = */ FALSE, /* grs_simd_opt = */ 0, /* grs_create_pattern = */ 0, @@ -144,6 +149,8 @@ static const struct params { { X("no-reassociation"), &firm_opt.reassoc, 0, "firm: disable reassociation" }, { X("inline"), &firm_opt.do_inline, 1, "firm: enable FIRM inlining" }, { X("no-inline"), &firm_opt.do_inline, 0, "firm: disable FIRM inlining" }, + { X("inline-max-size="), NULL, 0, "firm: set maximum size for function inlining" }, + { X("inline-threshold="),NULL, 0, "firm: set benefice threshold for function inlining" }, { X("tail-rec"), &firm_opt.tail_rec, 1, "firm: enable tail-recursion optimization" }, { X("no-tail-rec"), &firm_opt.tail_rec, 0, "firm: disable tail-recursion optimization" }, { X("strength-red"), &firm_opt.strength_red, 1, "firm: enable strength reduction for loops" }, @@ -152,11 +159,11 @@ static const struct params { { X("no-scalar-replace"), &firm_opt.scalar_replace, 0, "firm: disable scalar replacement" }, { X("confirm"), &firm_opt.confirm, 1, "firm: enable Confirm optimization" }, { X("no-confirm"), &firm_opt.confirm, 0, "firm: disable Confirm optimization" }, - { X("opt-mul"), &firm_opt.muls, 0, "firm: enable multiplication optimization" }, + { X("opt-mul"), &firm_opt.muls, 1, "firm: enable multiplication optimization" }, { X("no-opt-mul"), &firm_opt.muls, 0, "firm: disable multiplication optimization" }, - { X("opt-div"), &firm_opt.divs, 0, "firm: enable division optimization" }, + { X("opt-div"), &firm_opt.divs, 1, "firm: enable division optimization" }, { X("no-opt-div"), &firm_opt.divs, 0, "firm: disable division optimization" }, - { X("opt-mod"), &firm_opt.mods, 0, "firm: enable remainder optimization" }, + { X("opt-mod"), &firm_opt.mods, 1, "firm: enable remainder optimization" }, { X("no-opt-mod"), &firm_opt.mods, 0, "firm: disable remainder optimization" }, { X("opt-fragile-ops"), &firm_opt.fragile_ops, 1, "firm: enable fragile ops optimization" }, { X("no-opt-fragile-ops"), &firm_opt.fragile_ops, 0, "firm: disable fragile ops optimization" }, @@ -192,6 +199,8 @@ static const struct params { { X("no-opt-cc"), &firm_opt.cc_opt, 0, "firm: disable calling conventions optimization" }, { X("bool"), &firm_opt.bool_opt, 1, "firm: enable bool simplification optimization" }, { X("no-bool"), &firm_opt.bool_opt, 0, "firm: disable bool simplification optimization" }, + { X("end-melt"), &firm_opt.end_melt, 1, "firm: enable end block melting" }, + { X("no-end-melt"), &firm_opt.end_melt, 0, "firm: disable end block melting" }, { X("freestanding"), &firm_opt.freestanding, 1, "firm: freestanding environment" }, { X("hosted"), &firm_opt.freestanding, 0, "firm: hosted environment" }, @@ -317,6 +326,7 @@ static void disable_opts(void) { firm_opt.deconv = FALSE; firm_opt.cc_opt = FALSE; firm_opt.bool_opt = FALSE; + firm_opt.end_melt = FALSE; firm_opt.freestanding = TRUE; } /* disable_opts */ @@ -339,6 +349,14 @@ int firm_option(const char *opt) firm_opt.cloning = TRUE; return 1; } + else if (strncmp("inline-max-size=", opt, 16) == 0) { + sscanf(&opt[16], "%u", &firm_opt.inline_maxsize); + return 1; + } + else if (strncmp("inline-threshold=", opt, 17) == 0) { + sscanf(&opt[17], "%u", &firm_opt.inline_threshold); + return 1; + } else if (strncmp("ycomp-host=", opt, 11) == 0) { opt = &opt[11]; set_ycomp_host(opt);