/* Generate code from to output assembler insns as recognized from rtl.
- Copyright (C) 1987-2017 Free Software Foundation, Inc.
+ Copyright (C) 1987-2021 Free Software Foundation, Inc.
This file is part of GCC.
static struct operand_data null_operand =
{
- 0, 0, "", "", VOIDmode, 0, 0, 0, 0, 0
+ 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
};
static struct operand_data *odata = &null_operand;
/* Record in this chain all information that we will output,
associated with the code number of the insn. */
-struct data
+class data
{
- struct data *next;
+public:
+ class data *next;
const char *name;
const char *template_code;
file_location loc;
};
/* This variable points to the first link in the insn chain. */
-static struct data *idata;
+static class data *idata;
/* This variable points to the end of the insn chain. This is where
everything relevant from the machien description is appended to. */
-static struct data **idata_end;
+static class data **idata_end;
\f
static void output_prologue (void);
static void output_operand_data (void);
static void output_insn_data (void);
static void output_get_insn_name (void);
-static void scan_operands (struct data *, rtx, int, int);
+static void scan_operands (class data *, rtx, int, int);
static int compare_operands (struct operand_data *,
struct operand_data *);
-static void place_operands (struct data *);
-static void process_template (struct data *, const char *);
-static void validate_insn_alternatives (struct data *);
-static void validate_insn_operands (struct data *);
+static void place_operands (class data *);
+static void process_template (class data *, const char *);
+static void validate_insn_alternatives (class data *);
+static void validate_insn_operands (class data *);
-struct constraint_data
+class constraint_data
{
- struct constraint_data *next_this_letter;
+public:
+ class constraint_data *next_this_letter;
file_location loc;
unsigned int namelen;
char name[1];
are handled outside the define*_constraint mechanism. */
static const char indep_constraints[] = ",=+%*?!^$#&g";
-static struct constraint_data *
+static class constraint_data *
constraints_by_letter_table[1 << CHAR_BIT];
static int mdep_constraint_len (const char *, file_location, int);
printf ("/* Generated automatically by the program `genoutput'\n\
from the machine description file `md'. */\n\n");
+ printf ("#define IN_TARGET_CODE 1\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
printf ("#include \"coretypes.h\"\n");
printf (" \"%s\",\n", d->constraint ? d->constraint : "");
- printf (" %smode,\n", GET_MODE_NAME (d->mode));
+ printf (" E_%smode,\n", GET_MODE_NAME (d->mode));
printf (" %d,\n", d->strict_low);
static void
output_insn_data (void)
{
- struct data *d;
+ class data *d;
int name_offset = 0;
int next_name_offset;
const char * last_name = 0;
const char * next_name = 0;
- struct data *n;
+ class data *n;
for (n = idata, next_name_offset = 1; n; n = n->next, next_name_offset++)
if (n->name)
THIS_STRICT_LOW is nonzero if the containing rtx was a STRICT_LOW_PART. */
static void
-scan_operands (struct data *d, rtx part, int this_address_p,
+scan_operands (class data *d, rtx part, int this_address_p,
int this_strict_low)
{
int i, j;
find a subsequence that is the same, or allocate a new one at the end. */
static void
-place_operands (struct data *d)
+place_operands (class data *d)
{
struct operand_data *od, *od2;
int i;
templates, or C code to generate the assembler code template. */
static void
-process_template (struct data *d, const char *template_code)
+process_template (class data *d, const char *template_code)
{
const char *cp;
int i;
/* Check insn D for consistency in number of constraint alternatives. */
static void
-validate_insn_alternatives (struct data *d)
+validate_insn_alternatives (class data *d)
{
int n = 0, start;
/* Verify that there are no gaps in operand numbers for INSNs. */
static void
-validate_insn_operands (struct data *d)
+validate_insn_operands (class data *d)
{
int i;
}
static void
-validate_optab_operands (struct data *d)
+validate_optab_operands (class data *d)
{
if (!d->name || d->name[0] == '\0' || d->name[0] == '*')
return;
static void
init_insn_for_nothing (void)
{
- idata = XCNEW (struct data);
+ idata = XCNEW (class data);
new (idata) data ();
idata->name = "*placeholder_for_nothing";
idata->loc = file_location ("<internal>", 0, 0);
{
rtx exp = info->def;
const char *name = XSTR (exp, 0);
- struct constraint_data **iter, **slot, *new_cdata;
+ class constraint_data **iter, **slot, *new_cdata;
if (strcmp (name, "TARGET_MEM_CONSTRAINT") == 0)
name = general_mem;
return;
}
}
- new_cdata = XNEWVAR (struct constraint_data,
- sizeof (struct constraint_data) + namelen);
+ new_cdata = XNEWVAR (class constraint_data,
+ sizeof (class constraint_data) + namelen);
new (new_cdata) constraint_data ();
strcpy (CONST_CAST (char *, new_cdata->name), name);
new_cdata->namelen = namelen;
static int
mdep_constraint_len (const char *s, file_location loc, int opno)
{
- struct constraint_data *p;
+ class constraint_data *p;
p = constraints_by_letter_table[(unsigned int)s[0]];