From 8ad97cfca7405266d280412da3f57800926c5b9d Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 9 Jul 2008 06:45:21 +0000 Subject: [PATCH] genattrtab.c (insert_right_side, [...]): Avoid C++ keywords. * genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++ keywords. * genemit.c (gen_insn): Likewise. * gengtype.c (note_def_vec): Likewise. * gengtype.h (note_def_vec): Likewise. * genoutput.c (struct data, output_insn_data, process_template, gen_expand, gen_split, note_constraint): Likewise. * genrecog.c (new_decision, add_to_sequence, factor_tests, make_insn_sequence): Likewise. * gensupport.c (record_insn_name): Likewise. From-SVN: r137653 --- gcc/ChangeLog | 13 ++++++++++++ gcc/genattrtab.c | 16 +++++++-------- gcc/genemit.c | 16 +++++++-------- gcc/gengtype.c | 8 ++++---- gcc/gengtype.h | 2 +- gcc/genoutput.c | 40 ++++++++++++++++++------------------- gcc/genrecog.c | 52 ++++++++++++++++++++++++------------------------ gcc/gensupport.c | 10 +++++----- 8 files changed, 85 insertions(+), 72 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc13ddfcff6..463a649f627 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2008-07-09 Kaveh R. Ghazi + + * genattrtab.c (insert_right_side, evaluate_eq_attr): Avoid C++ + keywords. + * genemit.c (gen_insn): Likewise. + * gengtype.c (note_def_vec): Likewise. + * gengtype.h (note_def_vec): Likewise. + * genoutput.c (struct data, output_insn_data, process_template, + gen_expand, gen_split, note_constraint): Likewise. + * genrecog.c (new_decision, add_to_sequence, factor_tests, + make_insn_sequence): Likewise. + * gensupport.c (record_insn_name): Likewise. + 2008-07-08 Doug Kwan * config/arm/arm.opt (mandroid): New option. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 079c81f9552..794a8db1bb1 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -1846,11 +1846,11 @@ insert_right_side (enum rtx_code code, rtx exp, rtx term, int insn_code, int ins if (GET_CODE (exp) == code) { - rtx new = insert_right_side (code, XEXP (exp, 1), - term, insn_code, insn_index); - if (new != XEXP (exp, 1)) + rtx new_rtx = insert_right_side (code, XEXP (exp, 1), + term, insn_code, insn_index); + if (new_rtx != XEXP (exp, 1)) /* Make a copy of this expression and call recursively. */ - newexp = attr_rtx (code, XEXP (exp, 0), new); + newexp = attr_rtx (code, XEXP (exp, 0), new_rtx); else newexp = exp; } @@ -1980,10 +1980,10 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index) for (i = 0; i < XVECLEN (value, 0); i += 2) { - rtx this = simplify_test_exp_in_temp (XVECEXP (value, 0, i), - insn_code, insn_index); + rtx this_cond = simplify_test_exp_in_temp (XVECEXP (value, 0, i), + insn_code, insn_index); - right = insert_right_side (AND, andexp, this, + right = insert_right_side (AND, andexp, this_cond, insn_code, insn_index); right = insert_right_side (AND, right, evaluate_eq_attr (exp, @@ -1995,7 +1995,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index) insn_code, insn_index); /* Add this condition into the AND expression. */ - newexp = attr_rtx (NOT, this); + newexp = attr_rtx (NOT, this_cond); andexp = insert_right_side (AND, andexp, newexp, insn_code, insn_index); } diff --git a/gcc/genemit.c b/gcc/genemit.c index caf808e99c9..35e5691b94f 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -357,17 +357,17 @@ gen_insn (rtx insn, int lineno) for (j = i + 1; j < XVECLEN (insn, 1); j++) { - rtx old = XEXP (XVECEXP (p->pattern, 1, j), 0); - rtx new = XEXP (XVECEXP (insn, 1, j), 0); + rtx old_rtx = XEXP (XVECEXP (p->pattern, 1, j), 0); + rtx new_rtx = XEXP (XVECEXP (insn, 1, j), 0); - /* OLD and NEW are the same if both are to be a SCRATCH + /* OLD and NEW_INSN are the same if both are to be a SCRATCH of the same mode, or if both are registers of the same mode and number. */ - if (! (GET_MODE (old) == GET_MODE (new) - && ((GET_CODE (old) == MATCH_SCRATCH - && GET_CODE (new) == MATCH_SCRATCH) - || (REG_P (old) && REG_P (new) - && REGNO (old) == REGNO (new))))) + if (! (GET_MODE (old_rtx) == GET_MODE (new_rtx) + && ((GET_CODE (old_rtx) == MATCH_SCRATCH + && GET_CODE (new_rtx) == MATCH_SCRATCH) + || (REG_P (old_rtx) && REG_P (new_rtx) + && REGNO (old_rtx) == REGNO (new_rtx))))) break; } diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 72d10781241..f7309b16c88 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -3529,22 +3529,22 @@ write_roots (pair_p variables) where the GTY(()) tags are only present if is_scalar is _false_. */ void -note_def_vec (const char *typename, bool is_scalar, struct fileloc *pos) +note_def_vec (const char *type_name, bool is_scalar, struct fileloc *pos) { pair_p fields; type_p t; options_p o; type_p len_ty = create_scalar_type ("unsigned"); - const char *name = concat ("VEC_", typename, "_base", (char *)0); + const char *name = concat ("VEC_", type_name, "_base", (char *)0); if (is_scalar) { - t = create_scalar_type (typename); + t = create_scalar_type (type_name); o = 0; } else { - t = resolve_typedef (typename, pos); + t = resolve_typedef (type_name, pos); o = create_option (0, "length", "%h.num"); } diff --git a/gcc/gengtype.h b/gcc/gengtype.h index fef1262a958..916570a8b9c 100644 --- a/gcc/gengtype.h +++ b/gcc/gengtype.h @@ -64,7 +64,7 @@ extern pair_p nreverse_pairs (pair_p list); extern type_p adjust_field_type (type_p, options_p); extern void note_variable (const char *s, type_p t, options_p o, struct fileloc *pos); -extern void note_def_vec (const char *typename, bool is_scalar, +extern void note_def_vec (const char *type_name, bool is_scalar, struct fileloc *pos); extern void note_def_vec_alloc (const char *type, const char *astrat, struct fileloc *pos); diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 3592388bd64..601483d8b2f 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -154,7 +154,7 @@ struct data { struct data *next; const char *name; - const char *template; + const char *template_code; int code_number; int index_number; const char *filename; @@ -336,7 +336,7 @@ output_insn_data (void) break; case INSN_OUTPUT_FORMAT_SINGLE: { - const char *p = d->template; + const char *p = d->template_code; char prev = 0; printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); @@ -656,36 +656,36 @@ place_operands (struct data *d) templates, or C code to generate the assembler code template. */ static void -process_template (struct data *d, const char *template) +process_template (struct data *d, const char *template_code) { const char *cp; int i; /* Templates starting with * contain straight code to be run. */ - if (template[0] == '*') + if (template_code[0] == '*') { - d->template = 0; + d->template_code = 0; d->output_format = INSN_OUTPUT_FORMAT_FUNCTION; puts ("\nstatic const char *"); printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n", d->code_number); puts ("{"); - print_rtx_ptr_loc (template); - puts (template + 1); + print_rtx_ptr_loc (template_code); + puts (template_code + 1); puts ("}"); } /* If the assembler code template starts with a @ it is a newline-separated list of assembler code templates, one for each alternative. */ - else if (template[0] == '@') + else if (template_code[0] == '@') { - d->template = 0; + d->template_code = 0; d->output_format = INSN_OUTPUT_FORMAT_MULTI; printf ("\nstatic const char * const output_%d[] = {\n", d->code_number); - for (i = 0, cp = &template[1]; *cp; ) + for (i = 0, cp = &template_code[1]; *cp; ) { const char *ep, *sp; @@ -725,7 +725,7 @@ process_template (struct data *d, const char *template) } else { - d->template = template; + d->template_code = template_code; d->output_format = INSN_OUTPUT_FORMAT_SINGLE; } } @@ -952,7 +952,7 @@ gen_expand (rtx insn, int lineno) d->n_operands = max_opno + 1; d->n_dups = num_dups; - d->template = 0; + d->template_code = 0; d->output_format = INSN_OUTPUT_FORMAT_NONE; validate_insn_alternatives (d); @@ -993,7 +993,7 @@ gen_split (rtx split, int lineno) d->n_operands = max_opno + 1; d->n_dups = 0; d->n_alternatives = 0; - d->template = 0; + d->template_code = 0; d->output_format = INSN_OUTPUT_FORMAT_NONE; place_operands (d); @@ -1120,7 +1120,7 @@ note_constraint (rtx exp, int lineno) { const char *name = XSTR (exp, 0); unsigned int namelen = strlen (name); - struct constraint_data **iter, **slot, *new; + struct constraint_data **iter, **slot, *new_cdata; /* The 'm' constraint is special here since that constraint letter can be overridden by the back end by defining the @@ -1173,12 +1173,12 @@ note_constraint (rtx exp, int lineno) return; } } - new = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen); - strcpy ((char *)new + offsetof(struct constraint_data, name), name); - new->namelen = namelen; - new->lineno = lineno; - new->next_this_letter = *slot; - *slot = new; + new_cdata = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen); + strcpy ((char *)new_cdata + offsetof(struct constraint_data, name), name); + new_cdata->namelen = namelen; + new_cdata->lineno = lineno; + new_cdata->next_this_letter = *slot; + *slot = new_cdata; } /* Return the length of the constraint name beginning at position S diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 1713f133314..70ab87745d3 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -474,14 +474,14 @@ extern void debug_decision_list static struct decision * new_decision (const char *position, struct decision_head *last) { - struct decision *new = XCNEW (struct decision); + struct decision *new_decision = XCNEW (struct decision); - new->success = *last; - new->position = xstrdup (position); - new->number = next_number++; + new_decision->success = *last; + new_decision->position = xstrdup (position); + new_decision->number = next_number++; - last->first = last->last = new; - return new; + last->first = last->last = new_decision; + return new_decision; } /* Create a new test and link it in at PLACE. */ @@ -877,7 +877,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position, enum routine_type insn_type, int top) { RTX_CODE code; - struct decision *this, *sub; + struct decision *this_decision, *sub; struct decision_test *test; struct decision_test **place; char *subpos; @@ -894,8 +894,8 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position, strcpy (subpos, position); subpos[depth + 1] = 0; - sub = this = new_decision (position, last); - place = &this->tests; + sub = this_decision = new_decision (position, last); + place = &this_decision->tests; restart: mode = GET_MODE (pattern); @@ -1142,20 +1142,20 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position, before any of the nodes we may have added above. */ if (code != UNKNOWN) { - place = &this->tests; + place = &this_decision->tests; test = new_decision_test (DT_code, &place); test->u.code = code; } if (mode != VOIDmode) { - place = &this->tests; + place = &this_decision->tests; test = new_decision_test (DT_mode, &place); test->u.mode = mode; } /* If we didn't insert any tests or accept nodes, hork. */ - gcc_assert (this->tests); + gcc_assert (this_decision->tests); ret: free (subpos); @@ -1592,7 +1592,7 @@ factor_tests (struct decision_head *head) for (first = head->first; first && first->next; first = next) { enum decision_type type; - struct decision *new, *old_last; + struct decision *new_dec, *old_last; type = first->tests->type; next = first->next; @@ -1615,8 +1615,8 @@ factor_tests (struct decision_head *head) below our first test. */ if (first->tests->next != NULL) { - new = new_decision (first->position, &first->success); - new->tests = first->tests->next; + new_dec = new_decision (first->position, &first->success); + new_dec->tests = first->tests->next; first->tests->next = NULL; } @@ -1633,14 +1633,14 @@ factor_tests (struct decision_head *head) if (next->tests->next != NULL) { - new = new_decision (next->position, &next->success); - new->tests = next->tests->next; + new_dec = new_decision (next->position, &next->success); + new_dec->tests = next->tests->next; next->tests->next = NULL; } - new = next; + new_dec = next; next = next->next; - new->next = NULL; - h.first = h.last = new; + new_dec->next = NULL; + h.first = h.last = new_dec; merge_trees (head, &h); } @@ -2618,25 +2618,25 @@ make_insn_sequence (rtx insn, enum routine_type type) if (i != XVECLEN (x, 0)) { - rtx new; + rtx new_rtx; struct decision_head clobber_head; /* Build a similar insn without the clobbers. */ if (i == 1) - new = XVECEXP (x, 0, 0); + new_rtx = XVECEXP (x, 0, 0); else { int j; - new = rtx_alloc (PARALLEL); - XVEC (new, 0) = rtvec_alloc (i); + new_rtx = rtx_alloc (PARALLEL); + XVEC (new_rtx, 0) = rtvec_alloc (i); for (j = i - 1; j >= 0; j--) - XVECEXP (new, 0, j) = XVECEXP (x, 0, j); + XVECEXP (new_rtx, 0, j) = XVECEXP (x, 0, j); } /* Recognize it. */ memset (&clobber_head, 0, sizeof(clobber_head)); - last = add_to_sequence (new, &clobber_head, "", type, 1); + last = add_to_sequence (new_rtx, &clobber_head, "", type, 1); /* Find the end of the test chain on the last node. */ for (test = last->tests; test->next; test = test->next) diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 912b81b79c6..540c30e3575 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -1428,7 +1428,7 @@ record_insn_name (int code, const char *name) { static const char *last_real_name = "insn"; static int last_real_code = 0; - char *new; + char *new_name; if (insn_name_ptr_size <= code) { @@ -1442,14 +1442,14 @@ record_insn_name (int code, const char *name) if (!name || name[0] == '\0') { - new = XNEWVAR (char, strlen (last_real_name) + 10); - sprintf (new, "%s+%d", last_real_name, code - last_real_code); + new_name = XNEWVAR (char, strlen (last_real_name) + 10); + sprintf (new_name, "%s+%d", last_real_name, code - last_real_code); } else { - last_real_name = new = xstrdup (name); + last_real_name = new_name = xstrdup (name); last_real_code = code; } - insn_name_ptr[code] = new; + insn_name_ptr[code] = new_name; } -- 2.30.2