gcc/gcc/read-rtl.c

1469 lines
38 KiB
C
Raw Normal View History

/* RTL reader for GCC.
Copyright (C) 1987-2014 Free Software Foundation, Inc.
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
This file is part of GCC.
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
version.
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "bconfig.h"
/* Disable rtl checking; it conflicts with the iterator handling. */
#undef ENABLE_RTL_CHECKING
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "hashtab.h"
Makefile.in (READ_MD_H): New variable. gcc/ * Makefile.in (READ_MD_H): New variable. (BUILD_RTL): Add build/read-md.o. (lto-wrapper.o): Depend on coretypes.h instead of defaults.h. (build/gensupport.o, build/read-rtl.o, build/genattr.o) (build/genattrtab.o, build/genconditions.o build/genemit.o) (build/genextract.o, build/genflags.o, build/genoutput.o) (build/genpreds.o, build/genrecog.o): Depend on $(READ_MD_H). (build/read-md.o): New rule. * defaults.h (obstack_chunk_alloc, obstack_chunk_free) (OBSTACK_CHUNK_SIZE, gcc_obstack_init): Move to... * coretypes.h: ...here. * lto-wrapper.c: Include coretypes.h instead of defaults.h. * pretty-print.c (obstack_chunk_alloc, obstack_chunk_free): Delete. * genattr.c: Include read-md.h. * genattrtab.c: Likewise. * genconditions.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * genoutput.c: Likewise. * genpreds.c: Likewise. * genrecog.c: Likewise. * rtl.h (read_skip_spaces, copy_rtx_ptr_loc, print_rtx_ptr_loc) (join_c_conditions, print_c_condition, read_rtx_filename) (read_rtx_lineno): Move to read-md.h. * read-rtl.c: Include read-md.h. (ptr_loc, string_obstack, ptr_locs, ptr_loc_obstack) (joined_conditions, joined_conditions_obstack, read_rtx_lineno) (read_rtx_filename, fatal_with_file_and_line, fatal_expected_char) (leading_ptr_hash, leading_ptr_eq_p, set_rtx_ptr_loc, get_rtx_ptr_loc) (copy_rtx_ptr_loc, print_rtx_ptr_loc, join_c_conditions) (print_c_condition, read_skip_spaces, read_escape, read_quoted_string) (read_braced_string, read_string): Move to read-md.c. (read_rtx): Move some initialization to init_md_reader and call init_md_reader here. * gensupport.h (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.h. * gensupport.c: Include read-md.h. (message_with_line, n_comma_elts, scan_comma_elt): Move to read-md.c. * read-md.h, read-md.c: New files. From-SVN: r160570
2010-06-10 22:21:23 +02:00
#include "read-md.h"
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
#include "gensupport.h"
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* One element in a singly-linked list of (integer, string) pairs. */
struct map_value {
struct map_value *next;
int number;
const char *string;
};
/* Maps an iterator or attribute name to a list of (integer, string) pairs.
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
The integers are iterator values; the strings are either C conditions
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
or attribute values. */
struct mapping {
/* The name of the iterator or attribute. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
const char *name;
/* The group (modes or codes) to which the iterator or attribute belongs. */
struct iterator_group *group;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* The list of (integer, string) pairs. */
struct map_value *values;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* For iterators, records the current value of the iterator. */
struct map_value *current_value;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
};
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Vector definitions for the above. */
typedef struct mapping *mapping_ptr;
/* A structure for abstracting the common parts of iterators. */
struct iterator_group {
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Tables of "mapping" structures, one for attributes and one for
iterators. */
htab_t attrs, iterators;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Treat the given string as the name of a standard mode, etc., and
return its integer value. */
int (*find_builtin) (const char *);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Make the given pointer use the given iterator value. */
void (*apply_iterator) (void *, int);
};
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Records one use of an iterator. */
struct iterator_use {
/* The iterator itself. */
struct mapping *iterator;
/* The location of the use, as passed to the apply_iterator callback. */
void *ptr;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
};
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Vector definitions for the above. */
typedef struct iterator_use iterator_use;
/* Records one use of an attribute (the "<[iterator:]attribute>" syntax)
in a non-string rtx field. */
struct attribute_use {
/* The group that describes the use site. */
struct iterator_group *group;
/* The name of the attribute, possibly with an "iterator:" prefix. */
const char *value;
/* The location of the use, as passed to GROUP's apply_iterator callback. */
void *ptr;
};
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Vector definitions for the above. */
typedef struct attribute_use attribute_use;
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
/* This struct is used to link subst_attr named ATTR_NAME with
corresponding define_subst named ITER_NAME. */
struct subst_attr_to_iter_mapping
{
char *attr_name;
char *iter_name;
};
/* Hash-table to store links between subst-attributes and
define_substs. */
htab_t subst_attr_to_iter_map = NULL;
/* This global stores name of subst-iterator which is currently being
processed. */
const char *current_iterator_name;
static void validate_const_int (const char *);
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
static rtx read_rtx_code (const char *);
static rtx read_nested_rtx (void);
static rtx read_rtx_variadic (rtx);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* The mode and code iterator structures. */
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
static struct iterator_group modes, codes, ints, substs;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* All iterators used in the current rtx. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
static vec<mapping_ptr> current_iterators;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* The list of all iterator uses in the current rtx. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
static vec<iterator_use> iterator_uses;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* The list of all attribute uses in the current rtx. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
static vec<attribute_use> attribute_uses;
/* Implementations of the iterator_group callbacks for modes. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static int
find_mode (const char *name)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
int i;
for (i = 0; i < NUM_MACHINE_MODES; i++)
if (strcmp (GET_MODE_NAME (i), name) == 0)
return i;
fatal_with_file_and_line ("unknown mode `%s'", name);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
static void
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
apply_mode_iterator (void *loc, int mode)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
PUT_MODE ((rtx) loc, (enum machine_mode) mode);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
/* Implementations of the iterator_group callbacks for codes. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static int
find_code (const char *name)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
int i;
for (i = 0; i < NUM_RTX_CODE; i++)
if (strcmp (GET_RTX_NAME (i), name) == 0)
return i;
fatal_with_file_and_line ("unknown rtx code `%s'", name);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
static void
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
apply_code_iterator (void *loc, int code)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
PUT_CODE ((rtx) loc, (enum rtx_code) code);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
/* Implementations of the iterator_group callbacks for ints. */
/* Since GCC does not construct a table of valid constants,
we have to accept any int as valid. No cross-checking can
be done. */
static int
find_int (const char *name)
{
validate_const_int (name);
return atoi (name);
}
static void
apply_int_iterator (void *loc, int value)
{
*(int *)loc = value;
}
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
/* This routine adds attribute or does nothing depending on VALUE. When
VALUE is 1, it does nothing - the first duplicate of original
template is kept untouched when it's subjected to a define_subst.
When VALUE isn't 1, the routine modifies RTL-template LOC, adding
attribute, named exactly as define_subst, which later will be
applied. If such attribute has already been added, then no the
routine has no effect. */
static void
apply_subst_iterator (void *loc, int value)
{
rtx rt = (rtx)loc;
rtx new_attr;
rtvec attrs_vec, new_attrs_vec;
int i;
if (value == 1)
return;
gcc_assert (GET_CODE (rt) == DEFINE_INSN
|| GET_CODE (rt) == DEFINE_EXPAND);
attrs_vec = XVEC (rt, 4);
/* If we've already added attribute 'current_iterator_name', then we
have nothing to do now. */
if (attrs_vec)
{
for (i = 0; i < GET_NUM_ELEM (attrs_vec); i++)
{
if (strcmp (XSTR (attrs_vec->elem[i], 0), current_iterator_name) == 0)
return;
}
}
/* Add attribute with subst name - it serves as a mark for
define_subst which later would be applied to this pattern. */
new_attr = rtx_alloc (SET_ATTR);
PUT_CODE (new_attr, SET_ATTR);
XSTR (new_attr, 0) = xstrdup (current_iterator_name);
XSTR (new_attr, 1) = xstrdup ("yes");
if (!attrs_vec)
{
new_attrs_vec = rtvec_alloc (1);
new_attrs_vec->elem[0] = new_attr;
}
else
{
new_attrs_vec = rtvec_alloc (GET_NUM_ELEM (attrs_vec) + 1);
memcpy (&new_attrs_vec->elem[0], &attrs_vec->elem[0],
GET_NUM_ELEM (attrs_vec) * sizeof (rtx));
new_attrs_vec->elem[GET_NUM_ELEM (attrs_vec)] = new_attr;
}
XVEC (rt, 4) = new_attrs_vec;
}
/* Map subst-attribute ATTR to subst iterator ITER. */
static void
bind_subst_iter_and_attr (const char *iter, const char *attr)
{
struct subst_attr_to_iter_mapping *value;
void **slot;
if (!subst_attr_to_iter_map)
subst_attr_to_iter_map =
htab_create (1, leading_string_hash, leading_string_eq_p, 0);
value = XNEW (struct subst_attr_to_iter_mapping);
value->attr_name = xstrdup (attr);
value->iter_name = xstrdup (iter);
slot = htab_find_slot (subst_attr_to_iter_map, value, INSERT);
*slot = value;
}
/* Return name of a subst-iterator, corresponding to subst-attribute ATTR. */
static char*
find_subst_iter_by_attr (const char *attr)
{
char *iter_name = NULL;
struct subst_attr_to_iter_mapping *value;
value = (struct subst_attr_to_iter_mapping*)
htab_find (subst_attr_to_iter_map, &attr);
if (value)
iter_name = value->iter_name;
return iter_name;
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Map attribute string P to its current value. Return null if the attribute
isn't known. */
static struct map_value *
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
map_attr_string (const char *p)
{
const char *attr;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
struct mapping *iterator;
unsigned int i;
struct mapping *m;
struct map_value *v;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
int iterator_name_len;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Peel off any "iterator:" prefix. Set ATTR to the start of the
attribute name. */
attr = strchr (p, ':');
if (attr == 0)
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
{
iterator_name_len = -1;
attr = p;
}
else
{
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
iterator_name_len = attr - p;
attr++;
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (current_iterators, i, iterator)
{
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* If an iterator name was specified, check that it matches. */
if (iterator_name_len >= 0
&& (strncmp (p, iterator->name, iterator_name_len) != 0
|| iterator->name[iterator_name_len] != 0))
continue;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Find the attribute specification. */
m = (struct mapping *) htab_find (iterator->group->attrs, &attr);
if (m)
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
{
/* In contrast to code/mode/int iterators, attributes of subst
iterators are linked to one specific subst-iterator. So, if
we are dealing with subst-iterator, we should check if it's
the one which linked with the given attribute. */
if (iterator->group == &substs)
{
char *iter_name = find_subst_iter_by_attr (attr);
if (strcmp (iter_name, iterator->name) != 0)
continue;
}
/* Find the attribute value associated with the current
iterator value. */
for (v = m->values; v; v = v->next)
if (v->number == iterator->current_value->number)
return v;
}
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
return NULL;
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Apply the current iterator values to STRING. Return the new string
if any changes were needed, otherwise return STRING itself. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static const char *
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
apply_iterator_to_string (const char *string)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
char *base, *copy, *p, *start, *end;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
struct map_value *v;
if (string == 0)
return string;
base = p = copy = ASTRDUP (string);
while ((start = strchr (p, '<')) && (end = strchr (start, '>')))
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
p = start + 1;
*end = 0;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
v = map_attr_string (p);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
*end = '>';
if (v == 0)
continue;
/* Add everything between the last copied byte and the '<',
then add in the attribute value. */
obstack_grow (&string_obstack, base, start - base);
obstack_grow (&string_obstack, v->string, strlen (v->string));
base = end + 1;
}
if (base != copy)
{
obstack_grow (&string_obstack, base, strlen (base) + 1);
copy = XOBFINISH (&string_obstack, char *);
copy_md_ptr_loc (copy, string);
return copy;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
return string;
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Return a deep copy of X, substituting the current iterator
values into any strings. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static rtx
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
copy_rtx_for_iterators (rtx original)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
const char *format_ptr, *p;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
int i, j;
rtx x;
if (original == 0)
return original;
/* Create a shallow copy of ORIGINAL. */
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
x = rtx_alloc (GET_CODE (original));
memcpy (x, original, RTX_CODE_SIZE (GET_CODE (original)));
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* Change each string and recursively change each rtx. */
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
format_ptr = GET_RTX_FORMAT (GET_CODE (original));
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
for (i = 0; format_ptr[i] != 0; i++)
switch (format_ptr[i])
{
case 'T':
while (XTMPL (x, i) != (p = apply_iterator_to_string (XTMPL (x, i))))
XTMPL (x, i) = p;
break;
case 'S':
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
case 's':
while (XSTR (x, i) != (p = apply_iterator_to_string (XSTR (x, i))))
XSTR (x, i) = p;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
break;
case 'e':
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
XEXP (x, i) = copy_rtx_for_iterators (XEXP (x, i));
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
break;
case 'V':
case 'E':
if (XVEC (original, i))
{
XVEC (x, i) = rtvec_alloc (XVECLEN (original, i));
for (j = 0; j < XVECLEN (x, i); j++)
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
XVECEXP (x, i, j)
= copy_rtx_for_iterators (XVECEXP (original, i, j));
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
break;
default:
break;
}
return x;
}
/* Return a condition that must satisfy both ORIGINAL and EXTRA. If ORIGINAL
has the form "&& ..." (as used in define_insn_and_splits), assume that
EXTRA is already satisfied. Empty strings are treated like "true". */
static const char *
add_condition_to_string (const char *original, const char *extra)
{
if (original != 0 && original[0] == '&' && original[1] == '&')
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
return original;
return join_c_conditions (original, extra);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
/* Like add_condition, but applied to all conditions in rtx X. */
static void
add_condition_to_rtx (rtx x, const char *extra)
{
switch (GET_CODE (x))
{
case DEFINE_INSN:
case DEFINE_EXPAND:
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
case DEFINE_SUBST:
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
XSTR (x, 2) = add_condition_to_string (XSTR (x, 2), extra);
break;
case DEFINE_SPLIT:
case DEFINE_PEEPHOLE:
case DEFINE_PEEPHOLE2:
case DEFINE_COND_EXEC:
XSTR (x, 1) = add_condition_to_string (XSTR (x, 1), extra);
break;
case DEFINE_INSN_AND_SPLIT:
XSTR (x, 2) = add_condition_to_string (XSTR (x, 2), extra);
XSTR (x, 4) = add_condition_to_string (XSTR (x, 4), extra);
break;
default:
break;
}
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Apply the current iterator values to all attribute_uses. */
static void
apply_attribute_uses (void)
{
struct map_value *v;
attribute_use *ause;
unsigned int i;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (attribute_uses, i, ause)
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
{
v = map_attr_string (ause->value);
if (!v)
fatal_with_file_and_line ("unknown iterator value `%s'", ause->value);
ause->group->apply_iterator (ause->ptr,
ause->group->find_builtin (v->string));
}
}
/* A htab_traverse callback for iterators. Add all used iterators
to current_iterators. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static int
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
add_current_iterators (void **slot, void *data ATTRIBUTE_UNUSED)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
struct mapping *iterator;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
iterator = (struct mapping *) *slot;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
if (iterator->current_value)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
current_iterators.safe_push (iterator);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
return 1;
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Expand all iterators in the current rtx, which is given as ORIGINAL.
Build a list of expanded rtxes in the EXPR_LIST pointed to by QUEUE. */
static void
apply_iterators (rtx original, rtx *queue)
{
unsigned int i;
const char *condition;
iterator_use *iuse;
struct mapping *iterator;
struct map_value *v;
rtx x;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
if (iterator_uses.is_empty ())
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
{
/* Raise an error if any attributes were used. */
apply_attribute_uses ();
XEXP (*queue, 0) = original;
XEXP (*queue, 1) = NULL_RTX;
return;
}
/* Clear out the iterators from the previous run. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (current_iterators, i, iterator)
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
iterator->current_value = NULL;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
current_iterators.truncate (0);
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Mark the iterators that we need this time. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (iterator_uses, i, iuse)
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
iuse->iterator->current_value = iuse->iterator->values;
/* Get the list of iterators that are in use, preserving the
definition order within each group. */
htab_traverse (modes.iterators, add_current_iterators, NULL);
htab_traverse (codes.iterators, add_current_iterators, NULL);
htab_traverse (ints.iterators, add_current_iterators, NULL);
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
htab_traverse (substs.iterators, add_current_iterators, NULL);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
gcc_assert (!current_iterators.is_empty ());
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
for (;;)
{
/* Apply the current iterator values. Accumulate a condition to
say when the resulting rtx can be used. */
condition = "";
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (iterator_uses, i, iuse)
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
{
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
if (iuse->iterator->group == &substs)
continue;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
v = iuse->iterator->current_value;
iuse->iterator->group->apply_iterator (iuse->ptr, v->number);
condition = join_c_conditions (condition, v->string);
}
apply_attribute_uses ();
x = copy_rtx_for_iterators (original);
add_condition_to_rtx (x, condition);
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
/* We apply subst iterator after RTL-template is copied, as during
subst-iterator processing, we could add an attribute to the
RTL-template, and we don't want to do it in the original one. */
FOR_EACH_VEC_ELT (iterator_uses, i, iuse)
{
v = iuse->iterator->current_value;
if (iuse->iterator->group == &substs)
{
iuse->ptr = x;
current_iterator_name = iuse->iterator->name;
iuse->iterator->group->apply_iterator (iuse->ptr, v->number);
}
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Add the new rtx to the end of the queue. */
XEXP (*queue, 0) = x;
XEXP (*queue, 1) = NULL_RTX;
/* Lexicographically increment the iterator value sequence.
That is, cycle through iterator values, starting from the right,
and stopping when one of them doesn't wrap around. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
i = current_iterators.length ();
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
for (;;)
{
if (i == 0)
return;
i--;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
iterator = current_iterators[i];
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
iterator->current_value = iterator->current_value->next;
if (iterator->current_value)
break;
iterator->current_value = iterator->values;
}
/* At least one more rtx to go. Allocate room for it. */
XEXP (*queue, 1) = rtx_alloc (EXPR_LIST);
queue = &XEXP (*queue, 1);
}
}
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* Add a new "mapping" structure to hashtable TABLE. NAME is the name
of the mapping and GROUP is the group to which it belongs. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static struct mapping *
add_mapping (struct iterator_group *group, htab_t table, const char *name)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
struct mapping *m;
void **slot;
m = XNEW (struct mapping);
m->name = xstrdup (name);
m->group = group;
m->values = 0;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
m->current_value = NULL;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
slot = htab_find_slot (table, m, INSERT);
if (*slot != 0)
fatal_with_file_and_line ("`%s' already defined", name);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
*slot = m;
return m;
}
/* Add the pair (NUMBER, STRING) to a list of map_value structures.
END_PTR points to the current null terminator for the list; return
a pointer the new null terminator. */
static struct map_value **
add_map_value (struct map_value **end_ptr, int number, const char *string)
{
struct map_value *value;
value = XNEW (struct map_value);
value->next = 0;
value->number = number;
value->string = string;
*end_ptr = value;
return &value->next;
}
/* Do one-time initialization of the mode and code attributes. */
static void
initialize_iterators (void)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
struct mapping *lower, *upper;
struct map_value **lower_ptr, **upper_ptr;
char *copy, *p;
int i;
modes.attrs = htab_create (13, leading_string_hash, leading_string_eq_p, 0);
modes.iterators = htab_create (13, leading_string_hash,
leading_string_eq_p, 0);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
modes.find_builtin = find_mode;
modes.apply_iterator = apply_mode_iterator;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
codes.attrs = htab_create (13, leading_string_hash, leading_string_eq_p, 0);
codes.iterators = htab_create (13, leading_string_hash,
leading_string_eq_p, 0);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
codes.find_builtin = find_code;
codes.apply_iterator = apply_code_iterator;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
ints.attrs = htab_create (13, leading_string_hash, leading_string_eq_p, 0);
ints.iterators = htab_create (13, leading_string_hash,
leading_string_eq_p, 0);
ints.find_builtin = find_int;
ints.apply_iterator = apply_int_iterator;
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
substs.attrs = htab_create (13, leading_string_hash, leading_string_eq_p, 0);
substs.iterators = htab_create (13, leading_string_hash,
leading_string_eq_p, 0);
substs.find_builtin = find_int; /* We don't use it, anyway. */
substs.apply_iterator = apply_subst_iterator;
lower = add_mapping (&modes, modes.attrs, "mode");
upper = add_mapping (&modes, modes.attrs, "MODE");
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
lower_ptr = &lower->values;
upper_ptr = &upper->values;
for (i = 0; i < MAX_MACHINE_MODE; i++)
{
copy = xstrdup (GET_MODE_NAME (i));
for (p = copy; *p != 0; p++)
*p = TOLOWER (*p);
upper_ptr = add_map_value (upper_ptr, i, GET_MODE_NAME (i));
lower_ptr = add_map_value (lower_ptr, i, copy);
}
lower = add_mapping (&codes, codes.attrs, "code");
upper = add_mapping (&codes, codes.attrs, "CODE");
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
lower_ptr = &lower->values;
upper_ptr = &upper->values;
for (i = 0; i < NUM_RTX_CODE; i++)
{
copy = xstrdup (GET_RTX_NAME (i));
for (p = copy; *p != 0; p++)
*p = TOUPPER (*p);
lower_ptr = add_map_value (lower_ptr, i, GET_RTX_NAME (i));
upper_ptr = add_map_value (upper_ptr, i, copy);
}
}
/* Provide a version of a function to read a long long if the system does
not provide one. */
#if HOST_BITS_PER_WIDE_INT > HOST_BITS_PER_LONG && !defined(HAVE_ATOLL) && !defined(HAVE_ATOQ)
HOST_WIDE_INT atoll (const char *);
HOST_WIDE_INT
atoll (const char *p)
{
int neg = 0;
HOST_WIDE_INT tmp_wide;
while (ISSPACE (*p))
p++;
if (*p == '-')
neg = 1, p++;
else if (*p == '+')
p++;
tmp_wide = 0;
while (ISDIGIT (*p))
{
HOST_WIDE_INT new_wide = tmp_wide*10 + (*p - '0');
if (new_wide < tmp_wide)
{
/* Return INT_MAX equiv on overflow. */
tmp_wide = (~(unsigned HOST_WIDE_INT) 0) >> 1;
break;
}
tmp_wide = new_wide;
p++;
}
if (neg)
tmp_wide = -tmp_wide;
return tmp_wide;
}
#endif
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
/* Process a define_conditions directive, starting with the optional
space after the "define_conditions". The directive looks like this:
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
(define_conditions [
(number "string")
(number "string")
...
])
It's not intended to appear in machine descriptions. It is
generated by (the program generated by) genconditions.c, and
slipped in at the beginning of the sequence of MD files read by
most of the other generators. */
static void
read_conditions (void)
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
{
int c;
c = read_skip_spaces ();
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
if (c != '[')
fatal_expected_char ('[', c);
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
while ( (c = read_skip_spaces ()) != ']')
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
{
struct md_name name;
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
char *expr;
int value;
if (c != '(')
fatal_expected_char ('(', c);
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
read_name (&name);
validate_const_int (name.string);
value = atoi (name.string);
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
c = read_skip_spaces ();
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
if (c != '"')
fatal_expected_char ('"', c);
expr = read_quoted_string ();
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
c = read_skip_spaces ();
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
if (c != ')')
fatal_expected_char (')', c);
r110123@banpei: zack | 2006-01-22 14:44:34 -0800 r110123@banpei: zack | 2006-01-22 14:44:34 -0800 * genconditions.c (condition_table, add_condition): Delete. (write_conditions): Don't emit n_insn_conditions nor insn_elision_unavailable. Issue the gcc version #ifdef here, inside the table, with no #else clause ... (write_header): ...not here. (write_writer): New function. (main): Don't initialize condition_table. Use add_c_test. Call write_writer. * gensupport.c (init_md_reader_args_cb): Handle multiple input files on the command line. (maybe_eval_c_test): Don't check insn_elision_unavailable. Return -1 if there is no entry in the table, don't abort. (add_c_test, traverse_c_tests): New functions. * gensupport.h (insn_elision_unavailable, insn_conditions) (n_insn_conditions): Delete declarations. (add_c_test, traverse_c_tests): Declare. * read-rtl.c: Include gensupport.h. (read_conditions): New function. (read_rtx): If read_rtx_1 returns 0, treat as EOF. (read_rtx_1): If we get EOF when we were looking for an initial open paren, return 0. Call read_conditions when appropriate. * Makefile.in: Kill BUILD_EARLY_SUPPORT and all references to dummy-conditions.o. Eliminate references to insn-conditions.o, or change them to build/gencondmd.o, as appropriate. Remove insn-constants.h from $(simple_generated_h) and insn-conditions.c from $(simple_generated_c). For all files remaining in those two lists, add insn-conditions.md to the generator command line. Give insn-constants.h/s-constants their own rules. Add rules for build/gencondmd.c, s-conditions, insn-conditions.md, s-condmd. (build/read-rtl.o): Depend on gensupport.h. (genprognormal): Include preds. (genprogearly): Rename genprognoprint; only difference is now that they don't link with $(BUILD_PRINT). * dummy-conditions.c: Delete. From-SVN: r110119
2006-01-23 16:15:05 +01:00
add_c_test (expr, value);
}
}
static void
validate_const_int (const char *string)
{
const char *cp;
int valid = 1;
cp = string;
while (*cp && ISSPACE (*cp))
cp++;
if (*cp == '-' || *cp == '+')
cp++;
if (*cp == 0)
valid = 0;
for (; *cp; cp++)
if (! ISDIGIT (*cp))
{
valid = 0;
break;
}
if (!valid)
fatal_with_file_and_line ("invalid decimal constant \"%s\"\n", string);
}
2014-05-06 18:25:05 +02:00
static void
validate_const_wide_int (const char *string)
{
const char *cp;
int valid = 1;
cp = string;
while (*cp && ISSPACE (*cp))
cp++;
/* Skip the leading 0x. */
if (cp[0] == '0' || cp[1] == 'x')
cp += 2;
else
valid = 0;
if (*cp == 0)
valid = 0;
for (; *cp; cp++)
if (! ISXDIGIT (*cp))
valid = 0;
if (!valid)
fatal_with_file_and_line ("invalid hex constant \"%s\"\n", string);
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Record that PTR uses iterator ITERATOR. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
static void
record_iterator_use (struct mapping *iterator, void *ptr)
{
struct iterator_use iuse = {iterator, ptr};
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
iterator_uses.safe_push (iuse);
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
}
/* Record that PTR uses attribute VALUE, which must match a built-in
value from group GROUP. */
static void
record_attribute_use (struct iterator_group *group, void *ptr,
const char *value)
{
struct attribute_use ause = {group, value, ptr};
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
attribute_uses.safe_push (ause);
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
}
/* Interpret NAME as either a built-in value, iterator or attribute
for group GROUP. PTR is the value to pass to GROUP's apply_iterator
callback. */
static void
record_potential_iterator_use (struct iterator_group *group, void *ptr,
const char *name)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
struct mapping *m;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
size_t len;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
len = strlen (name);
if (name[0] == '<' && name[len - 1] == '>')
{
/* Copy the attribute string into permanent storage, without the
angle brackets around it. */
obstack_grow0 (&string_obstack, name + 1, len - 2);
record_attribute_use (group, ptr, XOBFINISH (&string_obstack, char *));
}
else
{
m = (struct mapping *) htab_find (group->iterators, &name);
if (m != 0)
record_iterator_use (m, ptr);
else
group->apply_iterator (ptr, group->find_builtin (name));
}
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
/* Finish reading a declaration of the form:
(define... <name> [<value1> ... <valuen>])
from the MD file, where each <valuei> is either a bare symbol name or a
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
"(<name> <string>)" pair. The "(define..." part has already been read.
Represent the declaration as a "mapping" structure; add it to TABLE
(which belongs to GROUP) and return it. */
static struct mapping *
read_mapping (struct iterator_group *group, htab_t table)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
struct md_name name;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
struct mapping *m;
struct map_value **end_ptr;
const char *string;
int number, c;
/* Read the mapping name and create a structure for it. */
read_name (&name);
m = add_mapping (group, table, name.string);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
c = read_skip_spaces ();
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
if (c != '[')
fatal_expected_char ('[', c);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* Read each value. */
end_ptr = &m->values;
c = read_skip_spaces ();
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
do
{
if (c != '(')
{
/* A bare symbol name that is implicitly paired to an
empty string. */
unread_char (c);
read_name (&name);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
string = "";
}
else
{
/* A "(name string)" pair. */
read_name (&name);
string = read_string (false);
c = read_skip_spaces ();
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
if (c != ')')
fatal_expected_char (')', c);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
number = group->find_builtin (name.string);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
end_ptr = add_map_value (end_ptr, number, string);
c = read_skip_spaces ();
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
while (c != ']');
return m;
}
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
/* For iterator with name ATTR_NAME generate define_attr with values
'yes' and 'no'. This attribute is used to mark templates to which
define_subst ATTR_NAME should be applied. This attribute is set and
defined implicitly and automatically. */
static void
add_define_attr_for_define_subst (const char *attr_name, rtx *queue)
{
rtx const_str, return_rtx;
return_rtx = rtx_alloc (DEFINE_ATTR);
PUT_CODE (return_rtx, DEFINE_ATTR);
const_str = rtx_alloc (CONST_STRING);
PUT_CODE (const_str, CONST_STRING);
XSTR (const_str, 0) = xstrdup ("no");
XSTR (return_rtx, 0) = xstrdup (attr_name);
XSTR (return_rtx, 1) = xstrdup ("no,yes");
XEXP (return_rtx, 2) = const_str;
XEXP (*queue, 0) = return_rtx;
XEXP (*queue, 1) = NULL_RTX;
}
/* This routine generates DEFINE_SUBST_ATTR expression with operands
ATTR_OPERANDS and places it to QUEUE. */
static void
add_define_subst_attr (const char **attr_operands, rtx *queue)
{
rtx return_rtx;
int i;
return_rtx = rtx_alloc (DEFINE_SUBST_ATTR);
PUT_CODE (return_rtx, DEFINE_SUBST_ATTR);
for (i = 0; i < 4; i++)
XSTR (return_rtx, i) = xstrdup (attr_operands[i]);
XEXP (*queue, 0) = return_rtx;
XEXP (*queue, 1) = NULL_RTX;
}
/* Read define_subst_attribute construction. It has next form:
(define_subst_attribute <attribute_name> <iterator_name> <value1> <value2>)
Attribute is substituted with value1 when no subst is applied and with
value2 in the opposite case.
Attributes are added to SUBST_ATTRS_TABLE.
In case the iterator is encountered for the first time, it's added to
SUBST_ITERS_TABLE. Also, implicit define_attr is generated. */
static void
read_subst_mapping (htab_t subst_iters_table, htab_t subst_attrs_table,
rtx *queue)
{
struct mapping *m;
struct map_value **end_ptr;
const char *attr_operands[4];
rtx * queue_elem = queue;
int i;
for (i = 0; i < 4; i++)
attr_operands[i] = read_string (false);
add_define_subst_attr (attr_operands, queue_elem);
bind_subst_iter_and_attr (attr_operands[1], attr_operands[0]);
m = (struct mapping *) htab_find (substs.iterators, &attr_operands[1]);
if (!m)
{
m = add_mapping (&substs, subst_iters_table, attr_operands[1]);
end_ptr = &m->values;
end_ptr = add_map_value (end_ptr, 1, "");
end_ptr = add_map_value (end_ptr, 2, "");
/* Add element to the queue. */
XEXP (*queue, 1) = rtx_alloc (EXPR_LIST);
queue_elem = &XEXP (*queue, 1);
add_define_attr_for_define_subst (attr_operands[1], queue_elem);
}
m = add_mapping (&substs, subst_attrs_table, attr_operands[0]);
end_ptr = &m->values;
end_ptr = add_map_value (end_ptr, 1, attr_operands[2]);
end_ptr = add_map_value (end_ptr, 2, attr_operands[3]);
}
/* Check newly-created code iterator ITERATOR to see whether every code has the
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
same format. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static void
check_code_iterator (struct mapping *iterator)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
struct map_value *v;
enum rtx_code bellwether;
bellwether = (enum rtx_code) iterator->values->number;
for (v = iterator->values->next; v != 0; v = v->next)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
if (strcmp (GET_RTX_FORMAT (bellwether), GET_RTX_FORMAT (v->number)) != 0)
fatal_with_file_and_line ("code iterator `%s' combines "
"different rtx formats", iterator->name);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
/* Read an rtx-related declaration from the MD file, given that it
starts with directive name RTX_NAME. Return true if it expands to
one or more rtxes (as defined by rtx.def). When returning true,
store the list of rtxes as an EXPR_LIST in *X. */
bool
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
read_rtx (const char *rtx_name, rtx *x)
{
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
static rtx queue_head;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
/* Do one-time initialization. */
if (queue_head == 0)
{
initialize_iterators ();
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
queue_head = rtx_alloc (EXPR_LIST);
}
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
/* Handle various rtx-related declarations that aren't themselves
encoded as rtxes. */
if (strcmp (rtx_name, "define_conditions") == 0)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
read_conditions ();
return false;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
if (strcmp (rtx_name, "define_mode_attr") == 0)
{
read_mapping (&modes, modes.attrs);
return false;
}
if (strcmp (rtx_name, "define_mode_iterator") == 0)
{
read_mapping (&modes, modes.iterators);
return false;
}
if (strcmp (rtx_name, "define_code_attr") == 0)
{
read_mapping (&codes, codes.attrs);
return false;
}
if (strcmp (rtx_name, "define_code_iterator") == 0)
{
check_code_iterator (read_mapping (&codes, codes.iterators));
return false;
}
if (strcmp (rtx_name, "define_int_attr") == 0)
{
read_mapping (&ints, ints.attrs);
return false;
}
if (strcmp (rtx_name, "define_int_iterator") == 0)
{
read_mapping (&ints, ints.iterators);
return false;
}
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
if (strcmp (rtx_name, "define_subst_attr") == 0)
{
read_subst_mapping (substs.iterators, substs.attrs, &queue_head);
*x = queue_head;
/* READ_SUBST_MAPPING could generate a new DEFINE_ATTR. Return
TRUE to process it. */
return true;
}
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
apply_iterators (read_rtx_code (rtx_name), &queue_head);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
iterator_uses.truncate (0);
attribute_uses.truncate (0);
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
*x = queue_head;
return true;
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
}
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
/* Subroutine of read_rtx and read_nested_rtx. CODE_NAME is the name of
either an rtx code or a code iterator. Parse the rest of the rtx and
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
return it. */
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
static rtx
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
read_rtx_code (const char *code_name)
read-rtl.c (map_value, [...]): New structures. * read-rtl.c (map_value, mapping, macro_group): New structures. (BELLWETHER_CODE): New macro. (modes, codes, bellwether_codes): New variables. (find_mode, uses_mode_macro_p, apply_mode_macro, find_code) (uses_code_macro_p, apply_code_macro, apply_macro_to_string) (apply_macro_to_rtx, uses_macro_p, add_condition_to_string) (add_condition_to_rtx, apply_macro_traverse, add_mapping) (add_map_value, initialize_macros): New functions. (def_hash, def_hash_eq_p): Generalize to anything that points to, or starts with, a char * field. (find_macro, read_mapping, check_code_macro): New functions. (read_rtx_1): New, split out from read_rtx. Handle the new define_{mode,code}_{macro,attr} constructs. Use find_macro to parse the name of a code or mode. Use BELLWETHER_CODE to extract the format and to choose a suitable code for rtx_alloc. Modify recursive invocations to use read_rtx_1. (read_rtx): Call initialize_macros. Apply code and mode macros to the rtx returned by read_rtx_1. Cache everything after the first macro expansion for subsequent read_rtx calls. * doc/md.texi: Document new .md constructs. * config/mips/mips.md (GPR): New mode macro. (d, si8_di5): New mode attributes. (any_cond): New code macro. (add[sd]i3): Redefine using :GPR. (*add[sd]i3): Likewise, renaming from add[sd]i3_internal. (*add[sd]i3_sp[12], *add<mode>3_mips16): Redefine using :GPR, naming previously unnamed MIPS16 patterns. (*addsi3_extended): Renamed from addsi3_internal_2. Fix overly long lines. Don't match (plus (const_int 0) ...). (*addsi3_extended_mips16): Name previously unnamed MIPS16 pattern. Use a define_split to generate the addition. (sub[sd]i3): Redefine using :GPR. Turn subsi3 into a define_insn. (subsi3_internal): Delete. (*subsi3_extended): Renamed from subsi3_internal_2. (bunordered, bordered, bunlt, bunge, buneq, bltgt, bunle, bungt) (beq, bne, bgt, bge, blt, ble, bgtu, bgeu, bltu, bleu): Redefine using an any_cond template. From-SVN: r86404
2004-08-23 07:55:50 +02:00
{
int i;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
RTX_CODE code;
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
struct mapping *iterator, *m;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *format_ptr;
struct md_name name;
rtx return_rtx;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int c;
HOST_WIDE_INT tmp_wide;
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
char *str;
char *start, *end, *ptr;
char tmpstr[256];
/* Linked list structure for making RTXs: */
struct rtx_list
{
struct rtx_list *next;
rtx value; /* Value of this node. */
};
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* If this code is an iterator, build the rtx using the iterator's
first value. */
iterator = (struct mapping *) htab_find (codes.iterators, &code_name);
if (iterator != 0)
code = (enum rtx_code) iterator->values->number;
else
code = (enum rtx_code) codes.find_builtin (code_name);
/* If we end up with an insn expression then we free this space below. */
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
return_rtx = rtx_alloc (code);
format_ptr = GET_RTX_FORMAT (code);
memset (return_rtx, 0, RTX_CODE_SIZE (code));
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
PUT_CODE (return_rtx, code);
if (iterator)
record_iterator_use (iterator, return_rtx);
/* If what follows is `: mode ', read it and
store the mode in the rtx. */
i = read_skip_spaces ();
if (i == ':')
{
read_name (&name);
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
record_potential_iterator_use (&modes, return_rtx, name.string);
}
else
unread_char (i);
for (i = 0; format_ptr[i] != 0; i++)
switch (format_ptr[i])
{
/* 0 means a field for internal use only.
Don't expect it to be present in the input. */
case '0':
if (code == REG)
ORIGINAL_REGNO (return_rtx) = REGNO (return_rtx);
break;
case 'e':
case 'u':
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
XEXP (return_rtx, i) = read_nested_rtx ();
break;
case 'V':
/* 'V' is an optional vector: if a closeparen follows,
just store NULL for this element. */
c = read_skip_spaces ();
unread_char (c);
if (c == ')')
{
XVEC (return_rtx, i) = 0;
break;
}
/* Now process the vector. */
case 'E':
{
/* Obstack to store scratch vector in. */
struct obstack vector_stack;
int list_counter = 0;
rtvec return_vec = NULL_RTVEC;
c = read_skip_spaces ();
if (c != '[')
fatal_expected_char ('[', c);
/* Add expressions to a list, while keeping a count. */
obstack_init (&vector_stack);
while ((c = read_skip_spaces ()) && c != ']')
{
if (c == EOF)
fatal_expected_char (']', c);
unread_char (c);
list_counter++;
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
obstack_ptr_grow (&vector_stack, read_nested_rtx ());
}
if (list_counter > 0)
{
return_vec = rtvec_alloc (list_counter);
memcpy (&return_vec->elem[0], obstack_finish (&vector_stack),
list_counter * sizeof (rtx));
}
else if (format_ptr[i] == 'E')
fatal_with_file_and_line ("vector must have at least one element");
XVEC (return_rtx, i) = return_vec;
obstack_free (&vector_stack, NULL);
/* close bracket gotten */
}
break;
case 'S':
case 'T':
case 's':
{
char *stringbuf;
int star_if_braced;
c = read_skip_spaces ();
unread_char (c);
if (c == ')')
{
/* 'S' fields are optional and should be NULL if no string
was given. Also allow normal 's' and 'T' strings to be
omitted, treating them in the same way as empty strings. */
XSTR (return_rtx, i) = (format_ptr[i] == 'S' ? NULL : "");
break;
}
/* The output template slot of a DEFINE_INSN,
DEFINE_INSN_AND_SPLIT, or DEFINE_PEEPHOLE automatically
gets a star inserted as its first character, if it is
written with a brace block instead of a string constant. */
star_if_braced = (format_ptr[i] == 'T');
stringbuf = read_string (star_if_braced);
/* For insn patterns, we want to provide a default name
based on the file and line, like "*foo.md:12", if the
given name is blank. These are only for define_insn and
define_insn_and_split, to aid debugging. */
if (*stringbuf == '\0'
&& i == 0
&& (GET_CODE (return_rtx) == DEFINE_INSN
|| GET_CODE (return_rtx) == DEFINE_INSN_AND_SPLIT))
{
char line_name[20];
const char *fn = (read_md_filename ? read_md_filename : "rtx");
const char *slash;
for (slash = fn; *slash; slash ++)
if (*slash == '/' || *slash == '\\' || *slash == ':')
fn = slash + 1;
obstack_1grow (&string_obstack, '*');
obstack_grow (&string_obstack, fn, strlen (fn));
sprintf (line_name, ":%d", read_md_lineno);
obstack_grow (&string_obstack, line_name, strlen (line_name)+1);
stringbuf = XOBFINISH (&string_obstack, char *);
}
md.texi: Document define_subst. * doc/md.texi: Document define_subst. * gensupport.c (MAX_OPERANDS): New define. (operand_data): New. (match_operand_entries_in_pattern): New. (used_operands_numbers): New. (subst_true): New. (subst_false): New. (define_subst_queue): New. (define_subst_tail): New. (define_subst_attr_queue): New. (define_subst_attr_tail): New. (has_subst_attribute): New. (subst_pattern_match): New. (get_alternatives_number): New. (alter_output_for_subst_insn): New. (alter_attrs_for_subst_insn): New. (process_substs_on_one_elem): New. (subst_dup): New. (process_define_subst): New. (duplicate_alternatives): New. (duplicate_each_alternative): New. (constraints_handler_t): New typedef. (alter_constraints): New. (adjust_operands_numbers): New. (replace_duplicating_operands_in_pattern): New. (remove_from_queue): New. (process_rtx): Handle define_subst and define_subst_attr. (change_subst_attribute): New. (alter_predicate_for_insn): Fix formatting. (alter_attrs_for_insn): Likewise. (alter_output_for_insn): Likewise. (mark_operands_from_match_dup): New. (mark_operands_used_in_match_dup): New. (find_first_unused_number_of_operand): New. (renumerate_operands_in_pattern): New. (generate_match_dup): New. (check_define_attr_duplicates): New. (init_rtx_reader_args_cb): Add checking for duplicated attrs and processing of define_subst. (read_md_rtx): Handle define_subst. * read-rtl.c (struct subst_attr_to_iter_mapping): New. (substs): New global. (apply_subst_iterator): New. (bind_subst_iter_and_attr): New. (find_subst_iter_by_attr): New. (map_attr_string): Handle subst-iterators. (add_condition_to_rtx): Handle define_subst. (apply_iterators): Likewise. (initialize_iterators): Likewise. (add_define_attr_for_define_subst): New. (add_define_subst_attr): New. (read_subst_mapping): New. (read_rtx): Handle define_subst_attr. (read_rtx_code): Add subst-attributes recognition during reading of strings. * rtl.def (DEFINE_EXPAND): Add vector of attributes. (DEFINE_SUBST): New. (DEFINE_SUBST_ATTR): New. Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r193618
2012-11-19 11:19:20 +01:00
/* Find attr-names in the string. */
ptr = &tmpstr[0];
end = stringbuf;
while ((start = strchr (end, '<')) && (end = strchr (start, '>')))
{
if ((end - start - 1 > 0)
&& (end - start - 1 < (int)sizeof (tmpstr)))
{
strncpy (tmpstr, start+1, end-start-1);
tmpstr[end-start-1] = 0;
end++;
}
else
break;
m = (struct mapping *) htab_find (substs.attrs, &ptr);
if (m != 0)
{
/* Here we should find linked subst-iter. */
str = find_subst_iter_by_attr (ptr);
if (str)
m = (struct mapping *) htab_find (substs.iterators, &str);
else
m = 0;
}
if (m != 0)
record_iterator_use (m, return_rtx);
}
if (star_if_braced)
XTMPL (return_rtx, i) = stringbuf;
else
XSTR (return_rtx, i) = stringbuf;
}
break;
case 'w':
read_name (&name);
validate_const_int (name.string);
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
tmp_wide = atoi (name.string);
#else
#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
tmp_wide = atol (name.string);
#else
/* Prefer atoll over atoq, since the former is in the ISO C99 standard.
But prefer not to use our hand-rolled function above either. */
#if defined(HAVE_ATOLL) || !defined(HAVE_ATOQ)
tmp_wide = atoll (name.string);
#else
tmp_wide = atoq (name.string);
#endif
#endif
#endif
XWINT (return_rtx, i) = tmp_wide;
break;
case 'i':
case 'n':
/* Can be an iterator or an integer constant. */
read_name (&name);
record_potential_iterator_use (&ints, &XINT (return_rtx, i),
name.string);
break;
default:
lambda.h (lambda_vector_min_nz): Likewise. * lambda.h (lambda_vector_min_nz): Likewise. * langhooks.h (struct lang_hooks_for_types, struct lang_hooks): Likewise. * output.h (assemble_integer, this_is_asm_operands): Likewise. * tree.h: Likewise. * vec.h: Likewise. * tree-flow-inline.h (relink_imm_use): Use gcc_assert. * optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword comments to avoid 'abort'. Use gcc_assert as necessary. * opts.c (common_handle_option): Likewise. * pretty-print.c (pp_base_format_text): Likewise. * print-rtl.c (print_rtx): Likewise. * read-rtl.c (read_rtx_filename, read_rtx_1): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_valid_class, find_reloads_toplev, find_equiv_reg): Likewise. * reload1.c (reload, forget_old_reloads_1, function_invariant_p, merge_assigned_reloads): Likewise. * tree-inline.c (inline_forbidden_p_1, estimate_num_insns_1): Likewise. * tree-optimize.c (execute_todo): Likewise. * tree-outof-ssa.c (eliminate_phi): Likewise. * tree-ssa-alias.c (add_pointed_to_expr): Likewise. * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise. * tree-ssa-operands.c (parse_ssa_operands, get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise. * tree-ssa-pre.c (find_or_generate_expression): Likewise. * tree-ssanames.c (release_ssa_name): Likewise. * tree.c (int_bit_position, int_byte_position, tree_low_cst, walk_tree): Likewise. * tree-ssa-operands.c (verify_abort): Fold into .. (verify_imm_links): ... here. From-SVN: r98519
2005-04-21 20:05:34 +02:00
gcc_unreachable ();
}
2014-05-06 18:25:05 +02:00
if (CONST_WIDE_INT_P (return_rtx))
{
read_name (&name);
validate_const_wide_int (name.string);
{
const char *s = name.string;
int len;
int index = 0;
int gs = HOST_BITS_PER_WIDE_INT/4;
int pos;
char * buf = XALLOCAVEC (char, gs + 1);
unsigned HOST_WIDE_INT wi;
int wlen;
/* Skip the leading spaces. */
while (*s && ISSPACE (*s))
s++;
/* Skip the leading 0x. */
gcc_assert (s[0] == '0');
gcc_assert (s[1] == 'x');
s += 2;
len = strlen (s);
pos = len - gs;
wlen = (len + gs - 1) / gs; /* Number of words needed */
return_rtx = const_wide_int_alloc (wlen);
while (pos > 0)
{
#if HOST_BITS_PER_WIDE_INT == 64
sscanf (s + pos, "%16" HOST_WIDE_INT_PRINT "x", &wi);
#else
sscanf (s + pos, "%8" HOST_WIDE_INT_PRINT "x", &wi);
#endif
CWI_ELT (return_rtx, index++) = wi;
pos -= gs;
}
strncpy (buf, s, gs - pos);
buf [gs - pos] = 0;
sscanf (buf, "%" HOST_WIDE_INT_PRINT "x", &wi);
CWI_ELT (return_rtx, index++) = wi;
/* TODO: After reading, do we want to canonicalize with:
value = lookup_const_wide_int (value); ? */
}
}
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
c = read_skip_spaces ();
/* Syntactic sugar for AND and IOR, allowing Lisp-like
arbitrary number of arguments for them. */
if (c == '('
&& (GET_CODE (return_rtx) == AND
|| GET_CODE (return_rtx) == IOR))
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
return read_rtx_variadic (return_rtx);
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
unread_char (c);
return return_rtx;
}
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
/* Read a nested rtx construct from the MD file and return it. */
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
static rtx
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
read_nested_rtx (void)
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
{
struct md_name name;
int c;
rtx return_rtx;
c = read_skip_spaces ();
if (c != '(')
fatal_expected_char ('(', c);
read_name (&name);
if (strcmp (name.string, "nil") == 0)
return_rtx = NULL;
else
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
return_rtx = read_rtx_code (name.string);
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
c = read_skip_spaces ();
if (c != ')')
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
fatal_expected_char (')', c);
return return_rtx;
}
/* Mutually recursive subroutine of read_rtx which reads
(thing x1 x2 x3 ...) and produces RTL as if
(thing x1 (thing x2 (thing x3 ...))) had been written.
When called, FORM is (thing x1 x2), and the file position
is just past the leading parenthesis of x3. Only works
for THINGs which are dyadic expressions, e.g. AND, IOR. */
static rtx
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
read_rtx_variadic (rtx form)
{
char c = '(';
rtx p = form, q;
do
{
unread_char (c);
q = rtx_alloc (GET_CODE (p));
PUT_MODE (q, GET_MODE (p));
XEXP (q, 0) = XEXP (p, 1);
read-rtl.c (mapping): Remove index field. gcc/ * read-rtl.c (mapping): Remove index field. Add current_value field. Define heap vectors. (iterator_group): Fix long line. Remove num_builtins field and uses_iterator fields. Make apply_iterator take a void * parameter. (iterator_use, atttribute_use): New structures. (iterator_traverse_data, BELLWETHER_CODE, bellwether_codes): Delete. (current_iterators, iterator_uses, attribute_uses): New variables. (uses_mode_iterator_p, uses_code_iterator_p): Delete. (apply_mode_iterator, apply_code_iterator): Take a void * parameter. (map_attr_string, apply_iterator_to_string): Remove iterator and value parameters. Look through all current iterator values for a matching attribute. (mode_attr_index, apply_mode_maps): Delete. (apply_iterator_to_rtx): Replace with... (copy_rtx_for_iterators): ...this new function. (uses_iterator_p, apply_iterator_traverse): Delete. (apply_attribute_uses, add_current_iterators, apply_iterators): New functions. (add_mapping): Remove index field. Set current_value field. (initialize_iterators): Don't set num_builtins and uses_iterator_p fields. (find_iterator): Delete. (record_iterator_use, record_attribute_use): New functions. (record_potential_iterator_use): New function. (check_code_iterator): Remove handling of bellwether codes. (read_rtx): Remove mode maps. Truncate iterator and attribute uses. (read_rtx_code, read_nested_rtx, read_rtx_variadic): Remove mode_maps parameter. Use the first code iterator value instead of the bellwether_codes array. Use record_potential_iterator_use for modes. From-SVN: r188525
2012-06-13 21:38:11 +02:00
XEXP (q, 1) = read_nested_rtx ();
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
XEXP (p, 1) = q;
p = q;
c = read_skip_spaces ();
}
while (c == '(');
Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). gcc/ * Makefile.in (build/genmddeps.o): Depend on $(READ_MD_H). * genmddeps.c: Include read-md.h. (main): Call init_rtx_reader_args instead of init_md_reader_args. * genattr.c (main): Likewise. * genattrtab.c (main): Likewise. * genautomata.c (main): Likewise. * gencodes.c (main): Likewise. * genconditions.c (main): Likewise. * genconfig.c (main): Likewise. * genconstants.c (main): Likewise. * genemit.c (main): Likewise. * genextract.c (main): Likewise. * genflags.c (main): Likewise. * genopinit.c (main): Likewise. * genoutput.c (main): Likewise. * genpeep.c (main): Likewise. * genrecog.c (main): Likewise. * genpreds.c (main): Likewise. * gensupport.h (in_fname): Move to read-md.h. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a bool. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a bool. (include_callback): Move to read-md.h. * gensupport.c (in_fname, include_callback, base_dir, max_include_len) (file_name_list, first_dir_md_include): Move to read-md.c (first_bracket_include): Delete unused variable. (last_dir_md_include): Move to read-md.c. (process_include): Delete, moving code to read-md.c:handle_include. (process_rtx): Don't handle INCLUDE. (save_string): Delete. (rtx_handle_directive): New function. (init_md_reader_args_cb): Rename to... (init_rtx_reader_args_cb): ...this and return a boolean success value. Use read_md_args. (init_md_reader_args): Rename to... (init_rtx_reader_args): ...this and return a boolean success value. * rtl.def (INCLUDE): Delete. * rtl.h (read_rtx): Remove "int *" argument. Add "const char *" argument. * read-rtl.c (read_conditions): Don't gobble ')' here. (read_mapping): Likewise. (read_rtx): Remove LINENO argument. Add RTX_NAME argument. Handle top-level non-rtx constructs here rather than in read_rtx_1. Store the whole queue in *X. Remove call to init_md_reader. (read_rtx_1): Rename to... (read_rtx_code): ...this. Call read_nested_rtx to read subrtxes. Don't handle top-level non-rtx constructs here. Don't handle (nil) here. (read_nested_rtx): New function. Handle (nil) here rather than in read_rtx_code. (read_rtx_variadic): Call read_nested_rtx to read subrtxes. Don't gobble ')' here. * read-md.h (directive_handler_t): New type. (in_fname, include_callback): Moved from read-md.h. (read_constants, init_md_reader): Delete. (read_md_files): Declare. * read-md.c (file_name_list, in_fname, base_dir, first_dir_md_include) (last_dir_md_include_ptr, include_callback, max_include_len): Moved from gensupport.c. (read_constants): Rename to... (handle_constants): ...this. Don't gobble ')' here. (handle_include, handle_file, handle_toplevel_file) (parse_include): New functions, mostly taken from gensupport.c. (init_md_reader): Subsume into... (read_md_files): ...this new function. From-SVN: r160577
2010-06-10 22:23:13 +02:00
unread_char (c);
return form;
}