+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>
* config/arm/arm.opt (mandroid): New option.
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;
}
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,
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);
}
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;
}
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");
}
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);
{
struct data *next;
const char *name;
- const char *template;
+ const char *template_code;
int code_number;
int index_number;
const char *filename;
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");
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;
}
else
{
- d->template = template;
+ d->template_code = template_code;
d->output_format = INSN_OUTPUT_FORMAT_SINGLE;
}
}
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);
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);
{
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
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
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. */
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;
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);
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);
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;
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;
}
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);
}
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)
{
static const char *last_real_name = "insn";
static int last_real_code = 0;
- char *new;
+ char *new_name;
if (insn_name_ptr_size <= code)
{
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;
}