From 9771520fae154447ba69158735a9d7b6b6ed7a1f Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 6 Oct 2010 08:40:31 +0000 Subject: [PATCH] allow_ifconv callback may not be NULL anymore [r28033] --- ir/be/TEMPLATE/bearch_TEMPLATE.c | 11 ++++++++++- ir/be/amd64/bearch_amd64.c | 11 ++++++++++- ir/be/arm/bearch_arm.c | 3 +-- ir/be/sparc/bearch_sparc.c | 11 ++++++++++- ir/opt/ifconv.c | 19 ++----------------- 5 files changed, 33 insertions(+), 22 deletions(-) diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE.c b/ir/be/TEMPLATE/bearch_TEMPLATE.c index 67eff55b0..e9466c6d1 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE.c +++ b/ir/be/TEMPLATE/bearch_TEMPLATE.c @@ -359,6 +359,15 @@ static void TEMPLATE_lower_for_target(void) { } +static int TEMPLATE_is_mux_allowed(ir_node *sel, ir_node *mux_false, + ir_node *mux_true) +{ + (void) sel; + (void) mux_false; + (void) mux_true; + return false; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -370,7 +379,7 @@ static const backend_params *TEMPLATE_get_backend_params(void) 0, /* 0: little-endian, 1: big-endian */ TEMPLATE_lower_for_target, /* lowering for target */ NULL, /* architecture dependent settings, will be set later */ - NULL, /* parameter for if conversion */ + TEMPLATE_is_mux_allowed, /* parameter for if conversion */ NULL, /* float arithmetic mode */ 0, /* no trampoline support: size 0 */ 0, /* no trampoline support: align 0 */ diff --git a/ir/be/amd64/bearch_amd64.c b/ir/be/amd64/bearch_amd64.c index 4b006c112..e00890fee 100644 --- a/ir/be/amd64/bearch_amd64.c +++ b/ir/be/amd64/bearch_amd64.c @@ -518,6 +518,15 @@ static void amd64_lower_for_target(void) { } +static int amd64_is_mux_allowed(ir_node *sel, ir_node *mux_false, + ir_node *mux_true) +{ + (void) sel; + (void) mux_false; + (void) mux_true; + return false; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -528,7 +537,7 @@ static const backend_params *amd64_get_backend_params(void) { 0, /* little endian */ amd64_lower_for_target, /* lowering callback */ NULL, /* will be set later */ - NULL, /* parameter for if conversion */ + amd64_is_mux_allowed, /* parameter for if conversion */ NULL, /* float arithmetic mode */ 0, /* no trampoline support: size 0 */ 0, /* no trampoline support: align 0 */ diff --git a/ir/be/arm/bearch_arm.c b/ir/be/arm/bearch_arm.c index cb4d57dfb..e99743365 100644 --- a/ir/be/arm/bearch_arm.c +++ b/ir/be/arm/bearch_arm.c @@ -543,8 +543,7 @@ static int arm_is_mux_allowed(ir_node *sel, ir_node *mux_false, (void) sel; (void) mux_false; (void) mux_true; - - return 0; + return false; } static asm_constraint_flags_t arm_parse_asm_constraint(const char **c) diff --git a/ir/be/sparc/bearch_sparc.c b/ir/be/sparc/bearch_sparc.c index fc2dd0225..54db717e4 100644 --- a/ir/be/sparc/bearch_sparc.c +++ b/ir/be/sparc/bearch_sparc.c @@ -553,6 +553,15 @@ static void sparc_lower_for_target(void) } } +static int sparc_is_mux_allowed(ir_node *sel, ir_node *mux_false, + ir_node *mux_true) +{ + (void) sel; + (void) mux_false; + (void) mux_true; + return false; +} + /** * Returns the libFirm configuration parameter for this backend. */ @@ -573,7 +582,7 @@ static const backend_params *sparc_get_backend_params(void) 1, /* big endian */ sparc_lower_for_target, /* lowering callback */ &arch_dep, /* will be set later */ - NULL, /* parameter for if conversion */ + sparc_is_mux_allowed, /* parameter for if conversion */ NULL, /* float arithmetic mode */ 0, /* no trampoline support: size 0 */ 0, /* no trampoline support: align 0 */ diff --git a/ir/opt/ifconv.c b/ir/opt/ifconv.c index 1d4bab051..ee24f4804 100644 --- a/ir/opt/ifconv.c +++ b/ir/opt/ifconv.c @@ -54,18 +54,6 @@ typedef struct walker_env { DEBUG_ONLY(static firm_dbg_module_t *dbg); -/** - * Default callback for Mux creation: don't allow any Mux nodes - */ -static int default_allow_ifconv(ir_node *sel, ir_node *mux_false, - ir_node *mux_true) -{ - (void) sel; - (void) mux_false; - (void) mux_true; - return 0; -} - /** * Returns non-zero if a Block can be emptied. * @@ -482,11 +470,8 @@ void opt_if_conv(ir_graph *irg) const backend_params *be_params = be_get_backend_param(); /* get the parameters */ - if (be_params->allow_ifconv != NULL) - env.allow_ifconv = be_params->allow_ifconv; - else - env.allow_ifconv = default_allow_ifconv; - env.changed = false; + env.allow_ifconv = be_params->allow_ifconv; + env.changed = false; FIRM_DBG_REGISTER(dbg, "firm.opt.ifconv"); -- 2.20.1