Commit 5ba6918e by Geoffrey Keating Committed by Geoffrey Keating

Makefile.in (emit-rtl.o): Add gt-emit-rtl.h to dependencies.

	* Makefile.in (emit-rtl.o): Add gt-emit-rtl.h to dependencies.

	* gengtype.c: Include rtl.h.
	(enum rtx_code): Don't define.
	(rtx_format): Make declaration match rtl.h.
	(rtx_next_new): Rename from rtx_next to avoid conflict.  Change all
	users.
	(adjust_field_rtx_def): Describe strings in NOTE_LINE_NUMBER notes.
	* Makefile.in (gengtype.o): Update dependencies.

From-SVN: r64554
parent f83b236e
2003-03-18 Geoffrey Keating <geoffk@apple.com>
* Makefile.in (emit-rtl.o): Add gt-emit-rtl.h to dependencies.
* gengtype.c: Include rtl.h.
(enum rtx_code): Don't define.
(rtx_format): Make declaration match rtl.h.
(rtx_next_new): Rename from rtx_next to avoid conflict. Change all
users.
(adjust_field_rtx_def): Describe strings in NOTE_LINE_NUMBER notes.
* Makefile.in (gengtype.o): Update dependencies.
2003-03-18 Andreas Schwab <schwab@suse.de> 2003-03-18 Andreas Schwab <schwab@suse.de>
* config/m68k/m68k.md (iordi3): Fix setting low half to -1. From * config/m68k/m68k.md (iordi3): Fix setting low half to -1. From
......
...@@ -1561,7 +1561,7 @@ xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $( ...@@ -1561,7 +1561,7 @@ xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \ flags.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
$(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \ $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
$(HASHTAB_H) $(TM_P_H) debug.h langhooks.h $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h gt-emit-rtl.h
real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H) real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H)
integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \ flags.h debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
...@@ -2188,7 +2188,7 @@ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \ ...@@ -2188,7 +2188,7 @@ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS) gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS)
gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
real.h rtl.def gtyp-gen.h real.h $(RTL_BASE_H) gtyp-gen.h
$(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \ $(BUILD_CC) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(srcdir)/gengtype.c $(OUTPUT_OPTION) $(srcdir)/gengtype.c $(OUTPUT_OPTION)
......
...@@ -25,6 +25,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -25,6 +25,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "gengtype.h" #include "gengtype.h"
#include "gtyp-gen.h" #include "gtyp-gen.h"
#define NO_GENRTL_H
#include "rtl.h"
#undef abort
/* Nonzero iff an error has occurred. */ /* Nonzero iff an error has occurred. */
static int hit_error = 0; static int hit_error = 0;
...@@ -347,22 +351,15 @@ note_variable (s, t, o, pos) ...@@ -347,22 +351,15 @@ note_variable (s, t, o, pos)
variables = n; variables = n;
} }
enum rtx_code {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
#include "rtl.def"
#undef DEF_RTL_EXPR
NUM_RTX_CODE
};
/* We really don't care how long a CONST_DOUBLE is. */ /* We really don't care how long a CONST_DOUBLE is. */
#define CONST_DOUBLE_FORMAT "ww" #define CONST_DOUBLE_FORMAT "ww"
static const char * const rtx_format[NUM_RTX_CODE] = { const char * const rtx_format[NUM_RTX_CODE] = {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) FORMAT , #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) FORMAT ,
#include "rtl.def" #include "rtl.def"
#undef DEF_RTL_EXPR #undef DEF_RTL_EXPR
}; };
static int rtx_next[NUM_RTX_CODE]; static int rtx_next_new[NUM_RTX_CODE];
/* Generate the contents of the rtx_next array. This really doesn't belong /* Generate the contents of the rtx_next array. This really doesn't belong
in gengtype at all, but it's needed for adjust_field_rtx_def. */ in gengtype at all, but it's needed for adjust_field_rtx_def. */
...@@ -375,15 +372,15 @@ gen_rtx_next () ...@@ -375,15 +372,15 @@ gen_rtx_next ()
{ {
int k; int k;
rtx_next[i] = -1; rtx_next_new[i] = -1;
if (strncmp (rtx_format[i], "iuu", 3) == 0) if (strncmp (rtx_format[i], "iuu", 3) == 0)
rtx_next[i] = 2; rtx_next_new[i] = 2;
else if (i == COND_EXEC || i == SET || i == EXPR_LIST || i == INSN_LIST) else if (i == COND_EXEC || i == SET || i == EXPR_LIST || i == INSN_LIST)
rtx_next[i] = 1; rtx_next_new[i] = 1;
else else
for (k = strlen (rtx_format[i]) - 1; k >= 0; k--) for (k = strlen (rtx_format[i]) - 1; k >= 0; k--)
if (rtx_format[i][k] == 'e' || rtx_format[i][k] == 'u') if (rtx_format[i][k] == 'e' || rtx_format[i][k] == 'u')
rtx_next[i] = k; rtx_next_new[i] = k;
} }
} }
...@@ -397,12 +394,12 @@ write_rtx_next () ...@@ -397,12 +394,12 @@ write_rtx_next ()
oprintf (f, "\n/* Used to implement the RTX_NEXT macro. */\n"); oprintf (f, "\n/* Used to implement the RTX_NEXT macro. */\n");
oprintf (f, "const unsigned char rtx_next[NUM_RTX_CODE] = {\n"); oprintf (f, "const unsigned char rtx_next[NUM_RTX_CODE] = {\n");
for (i = 0; i < NUM_RTX_CODE; i++) for (i = 0; i < NUM_RTX_CODE; i++)
if (rtx_next[i] == -1) if (rtx_next_new[i] == -1)
oprintf (f, " 0,\n"); oprintf (f, " 0,\n");
else else
oprintf (f, oprintf (f,
" offsetof (struct rtx_def, fld) + %d * sizeof (rtunion),\n", " offsetof (struct rtx_def, fld) + %d * sizeof (rtunion),\n",
rtx_next[i]); rtx_next_new[i]);
oprintf (f, "};\n"); oprintf (f, "};\n");
} }
...@@ -451,28 +448,47 @@ adjust_field_rtx_def (t, opt) ...@@ -451,28 +448,47 @@ adjust_field_rtx_def (t, opt)
{ {
pair_p note_flds = NULL; pair_p note_flds = NULL;
int c; int c;
for (c = 0; c < 3; c++) for (c = NOTE_INSN_BIAS; c <= NOTE_INSN_MAX; c++)
{ {
pair_p old_note_flds = note_flds; pair_p old_note_flds = note_flds;
note_flds = xmalloc (sizeof (*note_flds)); note_flds = xmalloc (sizeof (*note_flds));
note_flds->line.file = __FILE__; note_flds->line.file = __FILE__;
note_flds->line.line = __LINE__; note_flds->line.line = __LINE__;
note_flds->name = "rttree";
note_flds->type = tree_tp;
note_flds->opt = xmalloc (sizeof (*note_flds->opt)); note_flds->opt = xmalloc (sizeof (*note_flds->opt));
note_flds->opt->next = nodot; note_flds->opt->next = nodot;
note_flds->opt->name = "tag"; note_flds->opt->name = "tag";
note_flds->opt->info = xasprintf ("%d", c);
note_flds->next = old_note_flds; note_flds->next = old_note_flds;
switch (c)
{
/* NOTE_INSN_MAX is used as the default field for line
number notes. */
case NOTE_INSN_MAX:
note_flds->opt->name = "default";
note_flds->name = "rtstr";
note_flds->type = &string_type;
break;
case NOTE_INSN_BLOCK_BEG:
case NOTE_INSN_BLOCK_END:
note_flds->name = "rttree";
note_flds->type = tree_tp;
break;
case NOTE_INSN_EXPECTED_VALUE:
note_flds->name = "rtx";
note_flds->type = rtx_tp;
break;
default:
note_flds->name = "rtint";
note_flds->type = scalar_tp;
break;
}
} }
note_flds->type = rtx_tp;
note_flds->name = "rtx";
note_flds->opt->info = "NOTE_INSN_EXPECTED_VALUE";
note_flds->next->opt->info = "NOTE_INSN_BLOCK_BEG";
note_flds->next->next->opt->info = "NOTE_INSN_BLOCK_END";
new_structure ("rtx_def_note_subunion", 1, &lexer_line, note_flds, NULL); new_structure ("rtx_def_note_subunion", 1, &lexer_line, note_flds, NULL);
} }
......
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