Commit 8ad97cfc by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 588021c0
2008-07-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* 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 <dougkwan@google.com> 2008-07-08 Doug Kwan <dougkwan@google.com>
* config/arm/arm.opt (mandroid): New option. * config/arm/arm.opt (mandroid): New option.
......
...@@ -1846,11 +1846,11 @@ insert_right_side (enum rtx_code code, rtx exp, rtx term, int insn_code, int ins ...@@ -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) if (GET_CODE (exp) == code)
{ {
rtx new = insert_right_side (code, XEXP (exp, 1), rtx new_rtx = insert_right_side (code, XEXP (exp, 1),
term, insn_code, insn_index); term, insn_code, insn_index);
if (new != XEXP (exp, 1)) if (new_rtx != XEXP (exp, 1))
/* Make a copy of this expression and call recursively. */ /* 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 else
newexp = exp; newexp = exp;
} }
...@@ -1980,10 +1980,10 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index) ...@@ -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) for (i = 0; i < XVECLEN (value, 0); i += 2)
{ {
rtx this = simplify_test_exp_in_temp (XVECEXP (value, 0, i), rtx this_cond = simplify_test_exp_in_temp (XVECEXP (value, 0, i),
insn_code, insn_index); insn_code, insn_index);
right = insert_right_side (AND, andexp, this, right = insert_right_side (AND, andexp, this_cond,
insn_code, insn_index); insn_code, insn_index);
right = insert_right_side (AND, right, right = insert_right_side (AND, right,
evaluate_eq_attr (exp, evaluate_eq_attr (exp,
...@@ -1995,7 +1995,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index) ...@@ -1995,7 +1995,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
insn_code, insn_index); insn_code, insn_index);
/* Add this condition into the AND expression. */ /* 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, andexp = insert_right_side (AND, andexp, newexp,
insn_code, insn_index); insn_code, insn_index);
} }
......
...@@ -357,17 +357,17 @@ gen_insn (rtx insn, int lineno) ...@@ -357,17 +357,17 @@ gen_insn (rtx insn, int lineno)
for (j = i + 1; j < XVECLEN (insn, 1); j++) for (j = i + 1; j < XVECLEN (insn, 1); j++)
{ {
rtx old = XEXP (XVECEXP (p->pattern, 1, j), 0); rtx old_rtx = XEXP (XVECEXP (p->pattern, 1, j), 0);
rtx new = XEXP (XVECEXP (insn, 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, of the same mode,
or if both are registers of the same mode and number. */ or if both are registers of the same mode and number. */
if (! (GET_MODE (old) == GET_MODE (new) if (! (GET_MODE (old_rtx) == GET_MODE (new_rtx)
&& ((GET_CODE (old) == MATCH_SCRATCH && ((GET_CODE (old_rtx) == MATCH_SCRATCH
&& GET_CODE (new) == MATCH_SCRATCH) && GET_CODE (new_rtx) == MATCH_SCRATCH)
|| (REG_P (old) && REG_P (new) || (REG_P (old_rtx) && REG_P (new_rtx)
&& REGNO (old) == REGNO (new))))) && REGNO (old_rtx) == REGNO (new_rtx)))))
break; break;
} }
......
...@@ -3529,22 +3529,22 @@ write_roots (pair_p variables) ...@@ -3529,22 +3529,22 @@ write_roots (pair_p variables)
where the GTY(()) tags are only present if is_scalar is _false_. */ where the GTY(()) tags are only present if is_scalar is _false_. */
void 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; pair_p fields;
type_p t; type_p t;
options_p o; options_p o;
type_p len_ty = create_scalar_type ("unsigned"); 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) if (is_scalar)
{ {
t = create_scalar_type (typename); t = create_scalar_type (type_name);
o = 0; o = 0;
} }
else else
{ {
t = resolve_typedef (typename, pos); t = resolve_typedef (type_name, pos);
o = create_option (0, "length", "%h.num"); o = create_option (0, "length", "%h.num");
} }
......
...@@ -64,7 +64,7 @@ extern pair_p nreverse_pairs (pair_p list); ...@@ -64,7 +64,7 @@ extern pair_p nreverse_pairs (pair_p list);
extern type_p adjust_field_type (type_p, options_p); extern type_p adjust_field_type (type_p, options_p);
extern void note_variable (const char *s, type_p t, options_p o, extern void note_variable (const char *s, type_p t, options_p o,
struct fileloc *pos); 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); struct fileloc *pos);
extern void note_def_vec_alloc (const char *type, const char *astrat, extern void note_def_vec_alloc (const char *type, const char *astrat,
struct fileloc *pos); struct fileloc *pos);
......
...@@ -154,7 +154,7 @@ struct data ...@@ -154,7 +154,7 @@ struct data
{ {
struct data *next; struct data *next;
const char *name; const char *name;
const char *template; const char *template_code;
int code_number; int code_number;
int index_number; int index_number;
const char *filename; const char *filename;
...@@ -336,7 +336,7 @@ output_insn_data (void) ...@@ -336,7 +336,7 @@ output_insn_data (void)
break; break;
case INSN_OUTPUT_FORMAT_SINGLE: case INSN_OUTPUT_FORMAT_SINGLE:
{ {
const char *p = d->template; const char *p = d->template_code;
char prev = 0; char prev = 0;
printf ("#if HAVE_DESIGNATED_INITIALIZERS\n"); printf ("#if HAVE_DESIGNATED_INITIALIZERS\n");
...@@ -656,36 +656,36 @@ place_operands (struct data *d) ...@@ -656,36 +656,36 @@ place_operands (struct data *d)
templates, or C code to generate the assembler code template. */ templates, or C code to generate the assembler code template. */
static void static void
process_template (struct data *d, const char *template) process_template (struct data *d, const char *template_code)
{ {
const char *cp; const char *cp;
int i; int i;
/* Templates starting with * contain straight code to be run. */ /* 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; d->output_format = INSN_OUTPUT_FORMAT_FUNCTION;
puts ("\nstatic const char *"); puts ("\nstatic const char *");
printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n", printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n",
d->code_number); d->code_number);
puts ("{"); puts ("{");
print_rtx_ptr_loc (template); print_rtx_ptr_loc (template_code);
puts (template + 1); puts (template_code + 1);
puts ("}"); puts ("}");
} }
/* If the assembler code template starts with a @ it is a newline-separated /* If the assembler code template starts with a @ it is a newline-separated
list of assembler code templates, one for each alternative. */ 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; d->output_format = INSN_OUTPUT_FORMAT_MULTI;
printf ("\nstatic const char * const output_%d[] = {\n", d->code_number); 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; const char *ep, *sp;
...@@ -725,7 +725,7 @@ process_template (struct data *d, const char *template) ...@@ -725,7 +725,7 @@ process_template (struct data *d, const char *template)
} }
else else
{ {
d->template = template; d->template_code = template_code;
d->output_format = INSN_OUTPUT_FORMAT_SINGLE; d->output_format = INSN_OUTPUT_FORMAT_SINGLE;
} }
} }
...@@ -952,7 +952,7 @@ gen_expand (rtx insn, int lineno) ...@@ -952,7 +952,7 @@ gen_expand (rtx insn, int lineno)
d->n_operands = max_opno + 1; d->n_operands = max_opno + 1;
d->n_dups = num_dups; d->n_dups = num_dups;
d->template = 0; d->template_code = 0;
d->output_format = INSN_OUTPUT_FORMAT_NONE; d->output_format = INSN_OUTPUT_FORMAT_NONE;
validate_insn_alternatives (d); validate_insn_alternatives (d);
...@@ -993,7 +993,7 @@ gen_split (rtx split, int lineno) ...@@ -993,7 +993,7 @@ gen_split (rtx split, int lineno)
d->n_operands = max_opno + 1; d->n_operands = max_opno + 1;
d->n_dups = 0; d->n_dups = 0;
d->n_alternatives = 0; d->n_alternatives = 0;
d->template = 0; d->template_code = 0;
d->output_format = INSN_OUTPUT_FORMAT_NONE; d->output_format = INSN_OUTPUT_FORMAT_NONE;
place_operands (d); place_operands (d);
...@@ -1120,7 +1120,7 @@ note_constraint (rtx exp, int lineno) ...@@ -1120,7 +1120,7 @@ note_constraint (rtx exp, int lineno)
{ {
const char *name = XSTR (exp, 0); const char *name = XSTR (exp, 0);
unsigned int namelen = strlen (name); 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 /* The 'm' constraint is special here since that constraint letter
can be overridden by the back end by defining the can be overridden by the back end by defining the
...@@ -1173,12 +1173,12 @@ note_constraint (rtx exp, int lineno) ...@@ -1173,12 +1173,12 @@ note_constraint (rtx exp, int lineno)
return; return;
} }
} }
new = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen); new_cdata = XNEWVAR (struct constraint_data, sizeof (struct constraint_data) + namelen);
strcpy ((char *)new + offsetof(struct constraint_data, name), name); strcpy ((char *)new_cdata + offsetof(struct constraint_data, name), name);
new->namelen = namelen; new_cdata->namelen = namelen;
new->lineno = lineno; new_cdata->lineno = lineno;
new->next_this_letter = *slot; new_cdata->next_this_letter = *slot;
*slot = new; *slot = new_cdata;
} }
/* Return the length of the constraint name beginning at position S /* Return the length of the constraint name beginning at position S
......
...@@ -474,14 +474,14 @@ extern void debug_decision_list ...@@ -474,14 +474,14 @@ extern void debug_decision_list
static struct decision * static struct decision *
new_decision (const char *position, struct decision_head *last) 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_decision->success = *last;
new->position = xstrdup (position); new_decision->position = xstrdup (position);
new->number = next_number++; new_decision->number = next_number++;
last->first = last->last = new; last->first = last->last = new_decision;
return new; return new_decision;
} }
/* Create a new test and link it in at PLACE. */ /* 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, ...@@ -877,7 +877,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
enum routine_type insn_type, int top) enum routine_type insn_type, int top)
{ {
RTX_CODE code; RTX_CODE code;
struct decision *this, *sub; struct decision *this_decision, *sub;
struct decision_test *test; struct decision_test *test;
struct decision_test **place; struct decision_test **place;
char *subpos; char *subpos;
...@@ -894,8 +894,8 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position, ...@@ -894,8 +894,8 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
strcpy (subpos, position); strcpy (subpos, position);
subpos[depth + 1] = 0; subpos[depth + 1] = 0;
sub = this = new_decision (position, last); sub = this_decision = new_decision (position, last);
place = &this->tests; place = &this_decision->tests;
restart: restart:
mode = GET_MODE (pattern); mode = GET_MODE (pattern);
...@@ -1142,20 +1142,20 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position, ...@@ -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. */ before any of the nodes we may have added above. */
if (code != UNKNOWN) if (code != UNKNOWN)
{ {
place = &this->tests; place = &this_decision->tests;
test = new_decision_test (DT_code, &place); test = new_decision_test (DT_code, &place);
test->u.code = code; test->u.code = code;
} }
if (mode != VOIDmode) if (mode != VOIDmode)
{ {
place = &this->tests; place = &this_decision->tests;
test = new_decision_test (DT_mode, &place); test = new_decision_test (DT_mode, &place);
test->u.mode = mode; test->u.mode = mode;
} }
/* If we didn't insert any tests or accept nodes, hork. */ /* If we didn't insert any tests or accept nodes, hork. */
gcc_assert (this->tests); gcc_assert (this_decision->tests);
ret: ret:
free (subpos); free (subpos);
...@@ -1592,7 +1592,7 @@ factor_tests (struct decision_head *head) ...@@ -1592,7 +1592,7 @@ factor_tests (struct decision_head *head)
for (first = head->first; first && first->next; first = next) for (first = head->first; first && first->next; first = next)
{ {
enum decision_type type; enum decision_type type;
struct decision *new, *old_last; struct decision *new_dec, *old_last;
type = first->tests->type; type = first->tests->type;
next = first->next; next = first->next;
...@@ -1615,8 +1615,8 @@ factor_tests (struct decision_head *head) ...@@ -1615,8 +1615,8 @@ factor_tests (struct decision_head *head)
below our first test. */ below our first test. */
if (first->tests->next != NULL) if (first->tests->next != NULL)
{ {
new = new_decision (first->position, &first->success); new_dec = new_decision (first->position, &first->success);
new->tests = first->tests->next; new_dec->tests = first->tests->next;
first->tests->next = NULL; first->tests->next = NULL;
} }
...@@ -1633,14 +1633,14 @@ factor_tests (struct decision_head *head) ...@@ -1633,14 +1633,14 @@ factor_tests (struct decision_head *head)
if (next->tests->next != NULL) if (next->tests->next != NULL)
{ {
new = new_decision (next->position, &next->success); new_dec = new_decision (next->position, &next->success);
new->tests = next->tests->next; new_dec->tests = next->tests->next;
next->tests->next = NULL; next->tests->next = NULL;
} }
new = next; new_dec = next;
next = next->next; next = next->next;
new->next = NULL; new_dec->next = NULL;
h.first = h.last = new; h.first = h.last = new_dec;
merge_trees (head, &h); merge_trees (head, &h);
} }
...@@ -2618,25 +2618,25 @@ make_insn_sequence (rtx insn, enum routine_type type) ...@@ -2618,25 +2618,25 @@ make_insn_sequence (rtx insn, enum routine_type type)
if (i != XVECLEN (x, 0)) if (i != XVECLEN (x, 0))
{ {
rtx new; rtx new_rtx;
struct decision_head clobber_head; struct decision_head clobber_head;
/* Build a similar insn without the clobbers. */ /* Build a similar insn without the clobbers. */
if (i == 1) if (i == 1)
new = XVECEXP (x, 0, 0); new_rtx = XVECEXP (x, 0, 0);
else else
{ {
int j; int j;
new = rtx_alloc (PARALLEL); new_rtx = rtx_alloc (PARALLEL);
XVEC (new, 0) = rtvec_alloc (i); XVEC (new_rtx, 0) = rtvec_alloc (i);
for (j = i - 1; j >= 0; j--) 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. */ /* Recognize it. */
memset (&clobber_head, 0, sizeof(clobber_head)); 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. */ /* Find the end of the test chain on the last node. */
for (test = last->tests; test->next; test = test->next) for (test = last->tests; test->next; test = test->next)
......
...@@ -1428,7 +1428,7 @@ record_insn_name (int code, const char *name) ...@@ -1428,7 +1428,7 @@ record_insn_name (int code, const char *name)
{ {
static const char *last_real_name = "insn"; static const char *last_real_name = "insn";
static int last_real_code = 0; static int last_real_code = 0;
char *new; char *new_name;
if (insn_name_ptr_size <= code) if (insn_name_ptr_size <= code)
{ {
...@@ -1442,14 +1442,14 @@ record_insn_name (int code, const char *name) ...@@ -1442,14 +1442,14 @@ record_insn_name (int code, const char *name)
if (!name || name[0] == '\0') if (!name || name[0] == '\0')
{ {
new = XNEWVAR (char, strlen (last_real_name) + 10); new_name = XNEWVAR (char, strlen (last_real_name) + 10);
sprintf (new, "%s+%d", last_real_name, code - last_real_code); sprintf (new_name, "%s+%d", last_real_name, code - last_real_code);
} }
else else
{ {
last_real_name = new = xstrdup (name); last_real_name = new_name = xstrdup (name);
last_real_code = code; last_real_code = code;
} }
insn_name_ptr[code] = new; insn_name_ptr[code] = new_name;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment