From 09cc69761cce64b2f7e2b346f0cdaf269ec00407 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Mon, 28 Feb 2011 19:48:29 +0100 Subject: [PATCH] fix warnings because compare_attr gets const nodes now --- ir/be/TEMPLATE/TEMPLATE_new_nodes.c | 2 +- ir/be/arm/arm_new_nodes.c | 20 ++++++++++---------- ir/be/scripts/generate_new_opcodes.pl | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ir/be/TEMPLATE/TEMPLATE_new_nodes.c b/ir/be/TEMPLATE/TEMPLATE_new_nodes.c index 61cd30580..0d2517ff6 100644 --- a/ir/be/TEMPLATE/TEMPLATE_new_nodes.c +++ b/ir/be/TEMPLATE/TEMPLATE_new_nodes.c @@ -121,7 +121,7 @@ static void set_TEMPLATE_value(ir_node *node, ir_tarval *value) attr->value = value; } -static int TEMPLATE_compare_attr(ir_node *a, ir_node *b) +static int TEMPLATE_compare_attr(const ir_node *a, const ir_node *b) { const TEMPLATE_attr_t *attr_a = get_TEMPLATE_attr_const(a); const TEMPLATE_attr_t *attr_b = get_TEMPLATE_attr_const(b); diff --git a/ir/be/arm/arm_new_nodes.c b/ir/be/arm/arm_new_nodes.c index 400df4a74..4f6ca20a2 100644 --- a/ir/be/arm/arm_new_nodes.c +++ b/ir/be/arm/arm_new_nodes.c @@ -516,7 +516,7 @@ const arm_cmp_attr_t *get_arm_cmp_attr_const(const ir_node *node) return (const arm_cmp_attr_t*) get_irn_generic_attr_const(node); } -static int cmp_attr_arm_load_store(ir_node *a, ir_node *b) +static int cmp_attr_arm_load_store(const ir_node *a, const ir_node *b) { const arm_load_store_attr_t *attr_a; const arm_load_store_attr_t *attr_b; @@ -524,8 +524,8 @@ static int cmp_attr_arm_load_store(ir_node *a, ir_node *b) if (cmp_attr_arm(a, b)) return 1; - attr_a = get_arm_load_store_attr(a); - attr_b = get_arm_load_store_attr(b); + attr_a = get_arm_load_store_attr_const(a); + attr_b = get_arm_load_store_attr_const(b); if (attr_a->entity != attr_b->entity || attr_a->entity_sign != attr_b->entity_sign || attr_a->offset != attr_b->offset) @@ -534,7 +534,7 @@ static int cmp_attr_arm_load_store(ir_node *a, ir_node *b) return 0; } -static int cmp_attr_arm_shifter_operand(ir_node *a, ir_node *b) +static int cmp_attr_arm_shifter_operand(const ir_node *a, const ir_node *b) { const arm_shifter_operand_t *attr_a; const arm_shifter_operand_t *attr_b; @@ -542,8 +542,8 @@ static int cmp_attr_arm_shifter_operand(ir_node *a, ir_node *b) if (cmp_attr_arm(a, b)) return 1; - attr_a = get_arm_shifter_operand_attr(a); - attr_b = get_arm_shifter_operand_attr(b); + attr_a = get_arm_shifter_operand_attr_const(a); + attr_b = get_arm_shifter_operand_attr_const(b); if (attr_a->shift_modifier != attr_b->shift_modifier || attr_a->immediate_value != attr_b->immediate_value || attr_a->shift_immediate != attr_b->shift_immediate) @@ -552,7 +552,7 @@ static int cmp_attr_arm_shifter_operand(ir_node *a, ir_node *b) return 0; } -static int cmp_attr_arm_cmp(ir_node *a, ir_node *b) +static int cmp_attr_arm_cmp(const ir_node *a, const ir_node *b) { const arm_cmp_attr_t *attr_a; const arm_cmp_attr_t *attr_b; @@ -560,15 +560,15 @@ static int cmp_attr_arm_cmp(ir_node *a, ir_node *b) if (cmp_attr_arm(a, b)) return 1; - attr_a = get_arm_cmp_attr(a); - attr_b = get_arm_cmp_attr(b); + attr_a = get_arm_cmp_attr_const(a); + attr_b = get_arm_cmp_attr_const(b); if (attr_a->ins_permuted != attr_b->ins_permuted || attr_a->is_unsigned != attr_b->is_unsigned) return 1; return 0; } -static int cmp_attr_arm_farith(ir_node *a, ir_node *b) +static int cmp_attr_arm_farith(const ir_node *a, const ir_node *b) { const arm_farith_attr_t *attr_a; const arm_farith_attr_t *attr_b; diff --git a/ir/be/scripts/generate_new_opcodes.pl b/ir/be/scripts/generate_new_opcodes.pl index a77a15976..0cfacf35e 100755 --- a/ir/be/scripts/generate_new_opcodes.pl +++ b/ir/be/scripts/generate_new_opcodes.pl @@ -596,14 +596,14 @@ EOF if (exists($n{"cmp_attr"})) { my $cmpcode = $n{"cmp_attr"}; - push(@obst_cmp_attr, "static int cmp_attr_$op(ir_node *a, ir_node *b) {\n"); + push(@obst_cmp_attr, "static int cmp_attr_$op(const ir_node *a, const ir_node *b) {\n"); if($cmpcode =~ m/attr_a/) { - push(@obst_cmp_attr, "\t${attr_type} *attr_a = get_irn_generic_attr(a);\n"); + push(@obst_cmp_attr, "\tconst ${attr_type} *attr_a = get_irn_generic_attr_const(a);\n"); } else { push(@obst_cmp_attr, "\t(void) a;\n"); } if($cmpcode =~ m/attr_b/) { - push(@obst_cmp_attr, "\t${attr_type} *attr_b = get_irn_generic_attr(b);\n"); + push(@obst_cmp_attr, "\tconst ${attr_type} *attr_b = get_irn_generic_attr_const(b);\n"); } else { push(@obst_cmp_attr, "\t(void) b;\n"); } -- 2.20.1