From 5ba6918ee8902e201afea501752ee53dca9f5271 Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Tue, 18 Mar 2003 20:21:18 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 12 +++++++++ gcc/Makefile.in | 4 +-- gcc/gengtype.c | 68 ++++++++++++++++++++++++++++++------------------- 3 files changed, 56 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0fd20c8ce59..be8631f1678 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-03-18 Geoffrey Keating + + * 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 * config/m68k/m68k.md (iordi3): Fix setting low half to -1. From diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7ff728a5325..ce560e74f3f 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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) \ 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 \ - $(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) 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) \ @@ -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.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) \ $(srcdir)/gengtype.c $(OUTPUT_OPTION) diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 319553d972a..73c9580b655 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -25,6 +25,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "gengtype.h" #include "gtyp-gen.h" +#define NO_GENRTL_H +#include "rtl.h" +#undef abort + /* Nonzero iff an error has occurred. */ static int hit_error = 0; @@ -347,22 +351,15 @@ note_variable (s, t, o, pos) 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. */ #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 , #include "rtl.def" #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 in gengtype at all, but it's needed for adjust_field_rtx_def. */ @@ -375,15 +372,15 @@ gen_rtx_next () { int k; - rtx_next[i] = -1; + rtx_next_new[i] = -1; 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) - rtx_next[i] = 1; + rtx_next_new[i] = 1; else for (k = strlen (rtx_format[i]) - 1; k >= 0; k--) 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 () oprintf (f, "\n/* Used to implement the RTX_NEXT macro. */\n"); oprintf (f, "const unsigned char rtx_next[NUM_RTX_CODE] = {\n"); for (i = 0; i < NUM_RTX_CODE; i++) - if (rtx_next[i] == -1) + if (rtx_next_new[i] == -1) oprintf (f, " 0,\n"); else oprintf (f, " offsetof (struct rtx_def, fld) + %d * sizeof (rtunion),\n", - rtx_next[i]); + rtx_next_new[i]); oprintf (f, "};\n"); } @@ -451,28 +448,47 @@ adjust_field_rtx_def (t, opt) { pair_p note_flds = NULL; 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; note_flds = xmalloc (sizeof (*note_flds)); note_flds->line.file = __FILE__; 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->next = nodot; note_flds->opt->name = "tag"; + note_flds->opt->info = xasprintf ("%d", c); 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); }