From cff4720f62b23f6c1619d45cdc4de455be4c5aa0 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Mon, 26 Mar 2007 20:45:01 +0000 Subject: [PATCH] gengtype-lex.l: Remove all rules and states relating to yacc input files. * gengtype-lex.l: Remove all rules and states relating to yacc input files. * gengtype-yacc.y: Similarly. * gengtype.c (note_yacc_type): Delete function. * gengtype.h: Update prototypes. From-SVN: r123226 --- gcc/ChangeLog | 84 +++++++++++++++++++++++++-------------------- gcc/gengtype-lex.l | 32 +---------------- gcc/gengtype-yacc.y | 73 ++------------------------------------- gcc/gengtype.c | 59 ------------------------------- gcc/gengtype.h | 2 -- 5 files changed, 49 insertions(+), 201 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 577a2d423aa..7375955a641 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2007-03-26 Zack Weinberg + + * gengtype-lex.l: Remove all rules and states relating to yacc + input files. + * gengtype-yacc.y: Similarly. + * gengtype.c (note_yacc_type): Delete function. + * gengtype.h: Update prototypes. + 2007-03-26 Joseph Myers * tree-pretty-print.c (dump_generic_node): Report precision of @@ -84,8 +92,8 @@ 2007-03-25 Revital Eres - * tree-if-conv.c (if_convertible_gimple_modify_stmt_p): - Fold movement_possibility function into it. + * tree-if-conv.c (if_convertible_gimple_modify_stmt_p): + Fold movement_possibility function into it. 2007-03-25 David Edelsohn @@ -349,7 +357,7 @@ * real.c (real_from_string): Return -1 if underflow, +1 if overflow and 0 otherwise. * real.h (real_from_string): Update declaration - + 2007-03-22 Kai Tietz Richard Henderson @@ -380,7 +388,7 @@ Macroize expander using SSEMODEF mode macro. Use SSE_FLOAT_MODE_P. (*cmpfp_): Rename from *cmpfp_sf and *cmpfp_df. Macroize insn pattern using X87MODEF12 mode macro. - + 2007-03-21 Seongbae Park * regmove.c (regmove_optimize): Use reg_mentioned_p @@ -520,11 +528,11 @@ (xde, xdee): Mode attributes adjusted to support DFP modes. (RRer, f0, op1, Rf, bt, bfp, HALF_TMODE): New mode attributes added. ("cmp", "*cmp_css_0", "*cmp_ccs", TF move splitters, - DF move splitters, "floatdi2", "add3", "*add3", + DF move splitters, "floatdi2", "add3", "*add3", "*add3_cc", "*add3_cconly", "sub3", "*sub3", "*sub3_cc", "*sub3_cconly", "mul3", "*mul3", "div3", "*div3", "*neg2_nocc", "*abs2_nocc", - "*negabs2_nocc", "copysign3"): Adjusted to support DFP + "*negabs2_nocc", "copysign3"): Adjusted to support DFP numbers. ("*movtf_64", "*movtf_31", "*movdf_64dfp", "*movdf_64", "*movdf_31", "movsf"): Insn definitions removed. @@ -600,7 +608,7 @@ Update move patterns. * pa.c (hppa_fpstore_bypass_p): Check for both TYPE_FPSTORE_LOAD and TYPE_FPSTORE. - + 2007-03-18 Dorit Nuzman * tree-vect-transform.c (get_initial_def_for_induction): Replace @@ -615,14 +623,14 @@ (value_dies_in_block_x): Update for rvuse removal. (valid_in_sets): Update for renaming of vuses_dies_in_block_x. (compute_antic_aux): Handle when PHI nodes appear in - non-single-successors. + non-single-successors. (dump_bitmap_of_names): Removed. (compute_antic_safe): Renamed and removed rvuse calculation. Calculate only antic safe. (insert_into_preds_of_block): Remove assert. (execute_pre): Update for renamed functions. (defer_or_phi_translate_block): New function. - + 2007-03-17 Kazu Hirata * config/arm/arm.c, config/arm/thumb2.md, config/m68k/m68k.c, @@ -638,9 +646,9 @@ PR tree-optimization/31041 * tree-vect-transform.c (get_initial_def_for_induction): Call force_gimple_operand. - + 2007-03-17 Olga Golovanevsky - + * ipa-type-escape.c (look_for_casts) : Revert code to use handled_component_p due to ada test a-numaux.adb. @@ -660,7 +668,7 @@ * c-common.c (convert_and_check): Move warning logic to... (warnings_for_convert_and_check): ...here. Define. * c-common.h (warnings_for_convert_and_check): Declare. - + 2007-03-16 John David Anglin * pa.c (attr_length_call): Partially revert change of 2007-03-09. @@ -682,7 +690,7 @@ 2007-03-16 Sebastian Pop PR tree-optimization/31183 - * tree-loop-linear.c (gather_interchange_stats, try_interchange_loops): + * tree-loop-linear.c (gather_interchange_stats, try_interchange_loops): Use double_int instead of unsigned int for representing access_strides. * testsuite/gcc.dg/tree-ssa/pr31183.c: New. @@ -758,7 +766,7 @@ * c-opts.c (c_common_post_options): Handle C++ post-processing here. Set also -pedantic-errors by default for the preprocessor unless -fpermissive is given. - + 2007-03-15 Richard Guenther PR middle-end/29719 @@ -830,7 +838,7 @@ (TUNE_MOVE_M1_VIA_OR): Ditto. (TUNE_NOT_UNPAIRABLE): Ditto. (TUNE_NOT_VECTORMODE): Ditto. - + * config/i386/i386.c (ix86_tune_features): Fill in new tuning options. @@ -959,7 +967,7 @@ PR target/31123 * pa.md (vdepi_ior): Don't allow zero length deposit. Likewise for two unamed patterns. - + 2007-03-13 Uros Bizjak * config/i386/i386.opt (mcx16, msahf): New options. @@ -1065,22 +1073,22 @@ elfos.h to tm_file. 2007-03-12 Olga Golovanevsky - + * tree.h : Add multiple_of_p declaration. - * fold-const.c (multiple_of_p): Make multiple_of_p public. + * fold-const.c (multiple_of_p): Make multiple_of_p public. * ipa-type-escape.c (results_of_malloc): Redundant. (visited_stmts): New. Visited stmt for walk_use_def_chains. (cast_type): Extended with new members. (check_cast): Returns cast_type. (cast): New structure for data of walk_use_def_chains. (is_malloc_result, is_cast_from_non_pointer_1, - is_cast_from_non_pointer, + is_cast_from_non_pointer, is_array_access_through_pointer_and_index): New functions. (look_for_casts): Returns cast types. (check_call): Returns void. (okay_pointer_operation): Use support of pointer plus index, pointer plus constant and allow all multiplications. - + 2007-03-11 Richard Guenther PR tree-optimization/31115 @@ -1097,7 +1105,7 @@ 2007-03-11 Ira Rosen - * tree-data-ref.c (analyze_offset): Add a return value (bool) to + * tree-data-ref.c (analyze_offset): Add a return value (bool) to indicate success/failure of the analysis. Add negation to subtrahend in case of subtraction. Fail if both operands contain constants. (create_data_ref): Fail if analyze_offset fails. @@ -1336,30 +1344,30 @@ * doc/loop.texi: Document the Omega linear constraints solver. * doc/invoke.texi: Document -fcheck-data-deps, omega-max-vars, - omega-max-geqs, omega-max-eqs, omega-max-wild-cards, - omega-hash-table-size, omega-max-keys, and + omega-max-geqs, omega-max-eqs, omega-max-wild-cards, + omega-hash-table-size, omega-max-keys, and omega-eliminate-redundant-constraints. * tree-pass.h (pass_check_data_deps): Declared. * omega.c: New. * omega.h: New. * timevar.def (TV_CHECK_DATA_DEPS): Declared. - * tree-ssa-loop.c (check_data_deps, gate_check_data_deps, + * tree-ssa-loop.c (check_data_deps, gate_check_data_deps, pass_check_data_deps): New. * tree-data-ref.c (init_data_ref): Remove declaration. (dump_data_dependence_relation): Dump DDR_INNER_LOOP. (analyze_array): Renamed init_array_ref, move up initializations. (init_data_ref): Renamed init_pointer_ref. Moved before its call. Removed arguments that are set to NULL. - (analyze_indirect_ref): Correct indentation, correct call to + (analyze_indirect_ref): Correct indentation, correct call to init_pointer_ref. (object_analysis): Call init_array_ref instead of analyze_array. (initialize_data_dependence_relation): Initialize DDR_INNER_LOOP. (access_functions_are_affine_or_constant_p): Use DR_ACCESS_FNS instead of DR_ACCESS_FNS_ADDR. - (init_omega_eq_with_af, omega_extract_distance_vectors, + (init_omega_eq_with_af, omega_extract_distance_vectors, omega_setup_subscript, init_omega_for_ddr_1, init_omega_for_ddr, ddr_consistent_p): New. - (compute_affine_dependence): Check consistency of ddrs when + (compute_affine_dependence): Check consistency of ddrs when flag_check_data_deps is passed. (analyze_all_data_dependences): Uncomment. (tree_check_data_deps): New. @@ -1373,7 +1381,7 @@ (OBJS-common): Depend on omega.o. (omega.o): Define. * passes.c (pass_check_data_deps): Scheduled. - * params.def (PARAM_OMEGA_MAX_VARS, PARAM_OMEGA_MAX_GEQS, + * params.def (PARAM_OMEGA_MAX_VARS, PARAM_OMEGA_MAX_GEQS, PARAM_OMEGA_MAX_EQS, PARAM_OMEGA_MAX_WILD_CARDS, PARAM_OMEGA_HASH_TABLE_SIZE, PARAM_OMEGA_MAX_KEYS, PARAM_VECT_MAX_VERSION_CHECKS, @@ -1448,7 +1456,7 @@ * builtins.def (lceil, lceilf, lceill, lfloor, lfloorf, lfloorl, llceil, llceilf, llceill, llfloor, llfloorf, llfloorl): Mark with ATTR_CONST_NOTHROW_LIST. - + * fold-const.c (tree_expr_nonnegative_warnv_p): Handle FIX_TRUNC_EXPR. @@ -1549,7 +1557,7 @@ expanding sahf based alternative. Emit sahf based sequence when optimizing for code size. * config/i386/i386.md (x86_sahf_1): Do not disable for - TARGET_64BIT, enable for TARGET_SAHF. + TARGET_64BIT, enable for TARGET_SAHF. 2007-03-08 Martin Michlmayr @@ -1648,7 +1656,7 @@ 2007-03-06 Anatoly Sokolov * config/avr/avr.c (avr_mcu_types): Add support for ATmega325P, - ATmega3250P, ATmega329P, ATmega3290P, AT90USB82 and AT90USB162 + ATmega3250P, ATmega329P, ATmega3290P, AT90USB82 and AT90USB162 devices. * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): (Ditto.). * config/avr/t-avr (MULTILIB_MATCHES): (Ditto.). @@ -1721,13 +1729,13 @@ x86_branch_hints, x86_use_sahf, x86_partial_reg_stall, x86_partial_flag_reg_stall, x86_use_himode_fiop, x86_use_simode_fiop, x86_use_mov0, x86_use_cltd, x86_read_modify_write, x86_read_modify, - x86_split_long_moves, x86_promote_QImode, x86_fast_prefix, + x86_split_long_moves, x86_promote_QImode, x86_fast_prefix, x86_single_stringop, x86_qimode_math, x86_promote_qi_regs, x86_himode_math, x86_promote_hi_regs, x86_sub_esp_4, x86_sub_esp_8, - x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves, - x86_partial_reg_dependency, x86_memory_mismatch_stall, + x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves, + x86_partial_reg_dependency, x86_memory_mismatch_stall, x86_prologue_using_move, x86_epilogue_using_move, x86_shift1, - x86_sse_partial_reg_dependency, x86_sse_split_regs, + x86_sse_partial_reg_dependency, x86_sse_split_regs, x86_sse_unaligned_move_optimal, x86_sse_typeless_stores, x86_sse_load0_by_pxor, x86_use_ffreep, x86_use_incdec, x86_inter_unit_moves, x86_ext_80387_constants, x86_four_jump_limit, @@ -1761,7 +1769,7 @@ x86_epilogue_using_move, x86_decompose_lea, x86_arch_always_fancy_math_387, x86_shift1, x86_sse_partial_reg_dependency, x86_sse_split_regs, - x86_sse_unaligned_move_optimal, x86_sse_typeless_stores, + x86_sse_unaligned_move_optimal, x86_sse_typeless_stores, x86_sse_load0_by_pxor, x86_use_ffreep, x86_inter_unit_moves, x86_schedule, x86_use_bt, x86_cmpxchg, x86_cmpxchg8b, x86_xadd, x86_use_incdec, x86_pad_returns, x86_bswap, @@ -1985,7 +1993,7 @@ in soft-float DFmode pattern. (movdf): Fail if operand1 is a CONST_DOUBLE and operand0 is a hard floating register. - (movsf): Likewise. + (movsf): Likewise. 2007-03-05 Mike Stump @@ -2078,7 +2086,7 @@ PR other/30465 * c-common.c (convert_and_check): Don't give warnings for conversion if 'expr' already overflowed. - + 2007-03-04 Roger Sayle PR middle-end/30744 diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 51cd95a6310..27802e6e29c 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -57,7 +57,7 @@ WS [[:space:]]+ IWORD short|long|(un)?signed|char|int|HOST_WIDE_INT|HOST_WIDEST_INT|bool|size_t|BOOL_BITFIELD ITYPE {IWORD}({WS}{IWORD})* -%x in_struct in_struct_comment in_comment in_yacc_escape +%x in_struct in_struct_comment in_comment %option warn noyywrap nounput nodefault perf-report %option 8bit never-interactive %% @@ -233,12 +233,6 @@ ITYPE {IWORD}({WS}{IWORD})* return ENT_EXTERNSTATIC; } -^"%union"{WS}"{"{WS}/"GTY" { - BEGIN(in_struct); - update_lineno (yytext, yyleng); - return ENT_YACCUNION; -} - ^"DEF_VEC_"[[:alnum:]_]*{WS}?"("{WS}?{ID}{WS}?(","{WS}?{ID}{WS}?)*")" { char *macro, *arg; unsigned macro_len, arg_len; @@ -279,8 +273,6 @@ ITYPE {IWORD}({WS}{IWORD})* "/*" { BEGIN(in_struct_comment); } -^"%{" { BEGIN(in_yacc_escape); } /* } */ - {WS} { update_lineno (yytext, yyleng); } "const"/[^[:alnum:]_] /* don't care */ @@ -342,10 +334,6 @@ ITYPE {IWORD}({WS}{IWORD})* yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng-1); return ARRAY; } -^"%"{ID} { - yylval.s = (const char *) xmemdup (yytext+1, yyleng-1, yyleng); - return PERCENT_ID; -} "'"("\\".|[^\\])"'" { yylval.s = (const char *) xmemdup (yytext+1, yyleng-2, yyleng); return CHAR; @@ -362,11 +350,6 @@ ITYPE {IWORD}({WS}{IWORD})* return yytext[0]; } -^"%%" { - BEGIN(INITIAL); - return PERCENTPERCENT; -} - "#define"[^\n]*\n {lexer_line.line++;} . { @@ -391,19 +374,6 @@ ITYPE {IWORD}({WS}{IWORD})* "*/" { BEGIN(INITIAL); } "*/" { BEGIN(in_struct); } -{ -\n { lexer_line.line++; } -[^%]{16} | -[^%] /* do nothing */ -"%"/[^}] /* do nothing */ -"%}" { BEGIN(in_struct); } -"%" { - error_at_line (&lexer_line, - "unterminated %%{; unexpected EOF"); -} -} - - ["/] | "*" { error_at_line (&lexer_line, diff --git a/gcc/gengtype-yacc.y b/gcc/gengtype-yacc.y index 8bdf983e06b..2ce01e7fcd9 100644 --- a/gcc/gengtype-yacc.y +++ b/gcc/gengtype-yacc.y @@ -38,7 +38,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA %token ENT_TYPEDEF_STRUCT %token ENT_STRUCT %token ENT_EXTERNSTATIC -%token ENT_YACCUNION %token GTY_TOKEN %token UNION %token STRUCT @@ -47,15 +46,13 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA %token NESTED_PTR %token PARAM_IS %token NUM -%token PERCENTPERCENT "%%" %token SCALAR %token ID %token STRING %token ARRAY -%token PERCENT_ID %token CHAR -%type

struct_fields yacc_ids yacc_typematch +%type

struct_fields %type type lasttype %type optionsopt options option optionseq optionseqopt %type type_option stringseq @@ -65,7 +62,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA start: /* empty */ | typedef_struct start | externstatic start - | yacc_union start + | start ; typedef_struct: ENT_TYPEDEF_STRUCT options '{' struct_fields '}' ID @@ -116,72 +113,6 @@ semiequal: ';' | '=' ; -yacc_union: ENT_YACCUNION options struct_fields '}' yacc_typematch - PERCENTPERCENT - { - note_yacc_type ($2, $3, $5, &lexer_line); - } - ; - -yacc_typematch: /* empty */ - { $$ = NULL; } - | yacc_typematch PERCENT_ID yacc_ids - { - pair_p p; - for (p = $3; p->next != NULL; p = p->next) - { - p->name = NULL; - p->type = NULL; - } - p->name = NULL; - p->type = NULL; - p->next = $1; - $$ = $3; - } - | yacc_typematch PERCENT_ID '<' ID '>' yacc_ids - { - pair_p p; - type_p newtype = NULL; - if (strcmp ($2, "type") == 0) - newtype = (type_p) 1; - for (p = $6; p->next != NULL; p = p->next) - { - p->name = $4; - p->type = newtype; - } - p->name = $4; - p->next = $1; - p->type = newtype; - $$ = $6; - } - ; - -yacc_ids: /* empty */ - { $$ = NULL; } - | yacc_ids ID - { - pair_p p = XCNEW (struct pair); - p->next = $1; - p->line = lexer_line; - p->opt = XNEW (struct options); - p->opt->name = "tag"; - p->opt->next = NULL; - p->opt->info = (char *)$2; - $$ = p; - } - | yacc_ids CHAR - { - pair_p p = XCNEW (struct pair); - p->next = $1; - p->line = lexer_line; - p->opt = XNEW (struct options); - p->opt->name = "tag"; - p->opt->next = NULL; - p->opt->info = xasprintf ("'%s'", $2); - $$ = p; - } - ; - struct_fields: { $$ = NULL; } | type optionsopt ID bitfieldopt ';' struct_fields { diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 09d8ada4719..250712c577f 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -810,65 +810,6 @@ adjust_field_type (type_p t, options_p opt) return t; } -/* Create a union for YYSTYPE, as yacc would do it, given a fieldlist FIELDS - and information about the correspondence between token types and fields - in TYPEINFO. POS is used for error messages. */ - -void -note_yacc_type (options_p o, pair_p fields, pair_p typeinfo, - struct fileloc *pos) -{ - pair_p p; - pair_p *p_p; - - for (p = typeinfo; p; p = p->next) - { - pair_p m; - - if (p->name == NULL) - continue; - - if (p->type == (type_p) 1) - { - pair_p pp; - int ok = 0; - - for (pp = typeinfo; pp; pp = pp->next) - if (pp->type != (type_p) 1 - && strcmp (pp->opt->info, p->opt->info) == 0) - { - ok = 1; - break; - } - if (! ok) - continue; - } - - for (m = fields; m; m = m->next) - if (strcmp (m->name, p->name) == 0) - p->type = m->type; - if (p->type == NULL) - { - error_at_line (&p->line, - "couldn't match fieldname `%s'", p->name); - p->name = NULL; - } - } - - p_p = &typeinfo; - while (*p_p) - { - pair_p p = *p_p; - - if (p->name == NULL - || p->type == (type_p) 1) - *p_p = p->next; - else - p_p = &p->next; - } - - do_typedef ("YYSTYPE", new_structure ("yy_union", 1, pos, typeinfo, o), pos); -} static void set_gc_used_type (type_p, enum gc_used_enum, type_p *); static void set_gc_used (pair_p); diff --git a/gcc/gengtype.h b/gcc/gengtype.h index cb44b97fcc8..7be47b804c4 100644 --- a/gcc/gengtype.h +++ b/gcc/gengtype.h @@ -144,8 +144,6 @@ extern options_p create_option (options_p, const char *name, const void *info); 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_yacc_type (options_p o, pair_p fields, - pair_p typeinfo, struct fileloc *pos); /* Lexer and parser routines, most automatically generated. */ extern int yylex (void);