tradcif.c
cscope.files
cscope.out
+gengtype-lex.c
+gengtype-yacc.c
+gengtype-yacc.h
+2002-06-03 Geoffrey Keating <geoffk@redhat.com>
+
+ Merge from pch-branch:
+
+ * gengtype.h (UNION_OR_STRUCT_P): New macro.
+ * gengtype.c (write_gc_structure_fields): Use it.
+ (write_gc_root): Use it here too.
+
+ * gengtype.c (write_gc_structure_fields): Assume that lengths
+ of typenames fit into an 'int'; don't pass a size_t to "%d" in
+ printf.
+ (write_gc_marker_routine_for_structure): Likewise.
+ (write_gc_types): Likewise.
+ (write_gc_root): Likewise.
+
+ * varray.h (VARRAY_CLEAR): New.
+ (varray_clear): Prototype.
+ * varray.c (varray_clear): New.
+ * cselib.c (reg_values_old): New.
+ (used_regs_old): New.
+ (cselib_init): Use cached varrays if available to avoid
+ generating large amounts of garbage.
+ (cselib_finish): Don't throw away old varrays.
+
+ * final.c (insn_addresses_): Move out of ifdef.
+
+ * varray.c (uses_ggc): Make more varray kinds GCable.
+ * varray.h (union varray_data_tag): Let gengtype see
+ fields 'generic' and 'te'.
+ * reg-stack.c: Include gt-reg-stack.h, ggc.h.
+ (stack_regs_mentioned_data): Move out of ifdef; mark with gengtype.
+ (reg_to_stack): Don't call VARRAY_FREE.
+ * insn-addr.h (INSN_ADDRESSES_FREE): Don't use VARRAY_FREE.
+ (insn_addresses_): Use gengtype to mark.
+ * gengtype.c (write_gc_structure_fields): Handle arrays of generic
+ pointers; handle generic pointers in unused union fields.
+ (get_output_file_with_visibility): Include cselib.h,
+ insn-addr.h in gtype-desc.c.
+ * function.c (prologue): Use gengtype to mark.
+ (epilogue): Likewise.
+ (sibcall_epilogue): Likewise.
+ * dependence.c: Include gt-dependence.h, ggc.h.
+ (struct def_use): Use gengtype to mark.
+ (struct loop): Likewise.
+ (struct induction): Likewise.
+ (struct dependence): Likewise.
+ (def_use_chain): Likewise.
+ (dep_chain): Likewise.
+ (loop_chain): Likewise.
+ (induction_chain): Likewise.
+ (init_dependence_analysis): Don't free anything, just clear pointers.
+ (build_def_use): Use GGC to allocate def_use.
+ (add_loop): Use GGC to allocate loop.
+ (find_induction_variable): Use GGC to allocate induction.
+ (check_node_dependence): Use GGC to allocate induction, dependence.
+ (dump_node_dependence): Don't free varrays.
+ (end_dependence_analysis): Likewise.
+ * cselib.h (struct cselib_val_struct): Use gengtype to mark.
+ (struct elt_loc_list): Likewise.
+ (struct elt_list): Likewise.
+ * cselib.c: Don't include obstack.h.
+ (hash_table): Use gengtype to mark.
+ (reg_values): Use gengtype to mark.
+ (used_regs): Use gengtype to mark.
+ (cselib_obstack): Delete.
+ (cselib_startobj): Delete.
+ (empty_vals): Mark as deletable.
+ (empty_elt_lists): Mark as deletable.
+ (empty_elt_loc_lists): Mark as deletable.
+ (new_elt_list): Use GGC to allocate struct elt_list.
+ (new_elt_loc_list): Use GGC to allocate struct elt_loc_list.
+ (clear_table): Don't delete obstack; don't unnecessarily clear
+ deletable variables.
+ (new_cselib_val): Use GGC to allocate struct cselib_val.
+ (cselib_init): Don't set up obstacks. Use GGC to allocate
+ hash table.
+ (cselib_finish): Just clear variables, don't free anything.
+ * Makefile.in (cselib.o): Remove dependency on $(OBSTACK_H).
+ (reg-stack.o): Add dependency on gt-reg-stack.h, $(GGC_H).
+ (dependence.o): Add dependency on gt-dependence.h, $(GGC_H).
+ (GTFILES): Add insn-addr.h, cselib.h, dependence.c, reg-stack.c.
+ (gt-reg-stack.h): New rule.
+ (gt-dependence.h): New rule.
+ (gtype-desc.o): Add cselib.h, insn-addr.h.
+
+ * varray.c: Use only necessary headers.
+ (element_size): New.
+ (uses_ggc): New.
+ (varray_init): Take type, not size. Use GGC if appropriate.
+ (varray_grow): Update for change to struct varray_head_tag.
+ Use GGC if appropriate.
+ * varray.h (struct const_equiv_data): Use gengtype.
+ (enum varray_data_enum): New.
+ (union varray_data_tag): Use gengtype.
+ (struct varray_head_tag): Use gengtype. Replace size field with
+ enum varray_data_enum.
+ (varray_init): Update prototype.
+ (VARRAY_SCHED_INIT): Delete.
+ (VARRAY_*_INIT): Update for change to varray_init.
+ (VARRAY_SCHED): Delete.
+ (VARRAY_PUSH_SCHED): Delete.
+ (VARRAY_TOP_SCHED): Delete.
+ * tree.h: Update for change to length specifier.
+ * tree-inline.c (optimize_inline_calls): Don't use VARRAY_FREE.
+ (clone_body): Likewise.
+ * ssa.h (ssa_definition): Use gengtype to mark.
+ * ssa.c (convert_from_ssa): Don't use VARRAY_FREE.
+ * ssa-dce.c (ssa_eliminate_dead_code): Don't use VARRAY_FREE.
+ * rtl.h (struct rtvec_def): Update for change to length specifier.
+ * integrate.c (expand_inline_function): Don't use VARRAY_FREE.
+ (struct initial_value_struct): Update for change to length specifier.
+ * ggc.h (ggc_add_rtx_varray_root): Delete prototype.
+ (ggc_add_tree_varray_root): Delete prototype.
+ (ggc_mark_rtx_varray): Delete prototype.
+ (ggc_mark_tree_varray): Delete prototype.
+ * ggc-common.c (ggc_add_rtx_varray_root): Delete.
+ (ggc_add_tree_varray_root): Delete.
+ (ggc_mark_rtx_varray): Delete.
+ (ggc_mark_tree_varray): Delete.
+ (ggc_mark_rtx_varray_ptr): Delete.
+ (ggc_mark_tree_varray_ptr): Delete.
+ * gengtype.h (enum typekind): Remove TYPE_VARRAY.
+ (create_varray): Delete prototype.
+ * gengtype.c (varrays): Delete.
+ (create_varray): Delete.
+ (adjust_field_type): Detect array of string pointers.
+ (process_gc_options): Remove code to handle varray_type option.
+ (set_gc_used_type): Remove TYPE_VARRAY case.
+ (output_escaped_param): New.
+ (write_gc_structure_fields): Use output_escaped_param on all
+ parameters. Handle 'skip' with 'use_param' option. Handle
+ arrays of strings. Remove TYPE_VARRAY handling.
+ (write_gc_roots): Use boolean to detect 'length' option.
+ * gengtype-yacc.y (VARRAY_TYPE): Delete token.
+ (struct_fields): Call adjust_field_type on array fields.
+ (type): Remove VARRAY_TYPE case.
+ (type_option): Likewise.
+ * gengtype-lex.l: Don't consider varray_type a keyword.
+ * function.h: Update for change to length specifier.
+ (free_eh_status): Delete prototype.
+ * function.c (free_after_compilation): Don't call free_eh_status.
+ (reorder_blocks): Don't use VARRAY_FREE.
+ * except.c (struct eh_status): Update for change to length specifier.
+ remove varray_type specifier.
+ (free_eh_status): Delete.
+ * dwarf2out.c: Include gt-dwarf2out.h.
+ (used_rtx_varray): Use gengtype to mark, move
+ outside ifdefs.
+ (incomplete_types): Likewise.
+ (decl_scope_table): Likewise.
+ (dwarf2out_init): Don't call ggc_add_tree_varray_root.
+ * cfglayout.c (scope_to_insns_finalize): Don't use VARRAY_FREE.
+ * c-tree.h (struct lang_type): Update for change to length specifier.
+ * c-parse.in (yylexstring): Don't use VARRAY_FREE.
+ * c-objc-common.c: Include gt-c-objc-common.h.
+ (deferred_fns): Mark for gengtype.
+ (c_objc_common_init): Don't call ggc_add_tree_varray_root.
+ (expand_deferred_fns): Just set deferred_fns to 0 to free it.
+ * Makefile.in (c-objc-common.o): Add gt-c-objc-common.h.
+ (gtype-desc.o): Update dependencies.
+ (dwarf2out.o): Add gt-dwarf2out.h.
+ (varray.o): Update dependencies.
+ (GTFILES): Add varray.h, ssa.h, dwarf2out.c, c-objc-common.c.
+ (gt-c-objc-common.h): New rule.
+ (gt-dwarf2out.h): New rule.
+ * objc/objc-act.c (build_objc_string_object): Don't use VARRAY_FREE.
+
+ * doc/gty.texi (GTY Options): Correct spelling.
+ (GGC Roots): Likewise.
+ * Makefile.in (TEXI_CPP_FILES): New.
+ (TEXI_GCC_FILES): New.
+ (TEXI_GCCINT_FILES): New.
+ (TEXI_CPPINT_FILES): New.
+ ($(docdir)/cpp.info): Use new macros.
+ ($(docdir)/gcc.info): Likewise.
+ ($(docdir)/gccint.info): Likewise.
+ ($(docdir)/cppinternals.info): Likewise.
+ (cpp.dvi): Likewise.
+ (gcc.dvi): Likewise.
+ (gccint.dvi): Likewise.
+ (cppinternals.dvi): Likewise.
+
+ * Makefile.in ($(docdir)/gccint.info): Depend on gty.texi.
+ * doc/gccint.texi (Top): Include gty.texi.
+ * doc/gty.texi: New file.
+
+ * bitmap.c: Include ggc.h, gt-bitmap.h.
+ (bitmap_ggc_free): New.
+ (bitmap_elem_to_freelist): New.
+ (bitmap_element_free): Use bitmap_elem_to_freelist.
+ (bitmap_element_allocate): Allow use of GGC.
+ (bitmap_clear): Use bitmap_elem_to_freelist.
+ (bitmap_copy): Update for change to bitmap_element_allocate.
+ (bitmap_set_bit): Likewise.
+ (bitmap_operation): Update for changes elsewhere.
+ (bitmap_initialize): Allow to create bitmaps that will use GGC.
+ * bitmap.h (struct bitmap_element_def): Use gengtype.
+ (struct bitmap_head_def): Likewise. Also add 'using_obstack' field.
+ (bitmap_initialize): Add extra parameter.
+ (BITMAP_OBSTACK_ALLOC): Update for change to bitmap_initialize.
+ (BITMAP_ALLOCA): Delete.
+ (BITMAP_XMALLOC): Update for change to bitmap_initialize.
+ (BITMAP_GGC_ALLOC): New.
+ * Makefile.in (gtype-desc.o): Add bitmap.h.
+ (bitmap.o): Add gt-bitmap.h, $(GGC_H).
+ (GTFILES): Add bitmap.c.
+ (gt-bitmap.h): New rule.
+ ($(HOST_PREFIX_1)bitmap.o): Add gt-bitmap.h.
+ * basic-block.h: Update for changes to bitmap_initialize.
+ * except.c (exception_handler_label_map): Move into...
+ (struct eh_status): Here.
+ (struct eh_region): Make 'aka' GCable.
+ (free_eh_status): Don't need to specially handle
+ exception_handler_label_map.
+ (add_ehl_entry): Update for changes to exception_handler_label_map.
+ (find_exception_handler_labels): Likewise.
+ (remove_exception_handler_label): Likewise.
+ (maybe_remove_eh_handler): Likewise.
+ (for_each_eh_label): Likewise.
+ (remove_eh_handler): Allocate 'aka' using GGC.
+ * gengtype.c (get_output_file_with_visibility): Add bitmap.h
+ to list of includes.
+
+ * gengtype.c (write_gc_marker_routine_for_structure): Name
+ the routines 'gt_ggc_mx_*' instead of 'gt_ggc_m_*'.
+ (write_gc_types): Arrange for the tests with NULL to be inlined.
+ (write_gc_roots): Update uses of procedure pointers.
+ * ggc-common.c (gt_ggc_mx_rtx_def): Rename from gt_ggc_m_rtx_def.
+
+ * Makefile.in (explow.o): Add dependency on gt-explow.h.
+ (sdbout.o): Add dependency on gt-sdbout.h.
+
+ * emit-rtl.c (const_int_htab): Use gengtype to clear unused entries.
+ (mem_attrs_htab): Likewise.
+ (init_emit_once): Don't call ggc_add_deletable_htab.
+ * fold-const.c (size_htab): Use gengtype to clear unused entries.
+ (size_int_type_wide): Don't call ggc_add_deletable_htab.
+ * gengtype.c (finish_root_table): Add LASTNAME and TNAME
+ parameters, use them, change callers.
+ (write_gc_root): Add IF_MARKED parameter, use it, change callers.
+ (write_gc_roots): Handle 'if_marked' option.
+ (main): Don't need to call set_gc_used_type any more.
+ * ggc.h (ggc_htab_marked_p): Delete.
+ (ggc_htab_mark): Delete.
+ (struct ggc_cache_tab): New.
+ (gt_ggc_cache_rtab): New declaration.
+ * ggc-common.c (struct d_htab_root): Delete.
+ (d_htab_roots): Delete.
+ (ggc_add_deletable_htab): Delete.
+ (ggc_htab_delete): Handle new htab-deleting mechanism.
+ (ggc_mark_roots): Use new htab-deleting mechanism.
+ * tree.c (type_hash_table): Use gengtype to clear unused entries.
+ Make static.
+ (init_obstacks): Don't call ggc_add_deletable_htab.
+
+ * objc/objc-act.h (struct hashed_attribute): Use gengtype.
+ (struct hashed_entry): Likewise.
+ (nst_method_hash_list): Likewise.
+ (cls_method_hash_list): Likewise.
+ (HASH_ALLOC_LIST_SIZE): Delete.
+ (ATTR_ALLOC_LIST_SIZE): Delete.
+ * objc/objc-act.c (hash_init): Use ggc to allocate
+ nst_method_hash_list, cls_method_hash_list.
+ (hash_enter): Use ggc to allocate; allocate one entry at a time.
+ (hash_add_attr): Likewise.
+ (ggc_mark_hash_table): Delete.
+ (objc_act_parse_init): Delete.
+ (objc_init): Delete reference to objc_act_parse_init.
+ * tlink.c: Replace hash.h with hashtab.h. Explicitly include
+ obstack.h. Replace references to 'struct hash_table' with htab_t.
+ (struct symbol_hash_entry): Replace hash header with key field.
+ (struct file_hash_entry): Replace hash header with key field.
+ (struct demangled_hash_entry): Replace hash header with key field.
+ (hash_string_eq): New.
+ (hash_string_hash): New.
+ (symbol_hash_newfunc): Delete.
+ (symbol_hash_lookup): Modify to use htab_t.
+ (file_hash_newfunc): Delete.
+ (file_hash_lookup): Modify to use htab_t.
+ (demangled_hash_newfunc): Delete.
+ (demangled_hash_lookup): Modify to use htab_t.
+ (tlink_init): Modify to use htab_t.
+ * hash.h: Delete.
+ * hash.c: Delete.
+ * ggc.h: Delete forward structure declarations.
+ Delete prototypes for deleted functions.
+ * ggc-common.c: Don't include hash.h.
+ (ggc_add_tree_hash_table_root): Delete.
+ (ggc_mark_tree_hash_table_entry): Delete.
+ (ggc_mark_tree_hash_table): Delete.
+ (ggc_mark_tree_hash_table_ptr): Delete.
+ * gengtype.c (write_gc_structure_fields): Allow param_is option.
+ (write_gc_marker_routine_for_structure): Use visibility of
+ the parameter if there is one.
+ * function.c: Replace hash.h with hashtab.h. Replace references
+ to 'struct hash_table *' with htab_t.
+ (struct insns_for_mem_entry): Include a plain key.
+ (fixup_var_refs_insns_with_hash): Update to use htab_t.
+ (insns_for_mem_newfunc): Delete.
+ (insns_for_mem_hash): Update to use htab_t.
+ (insns_for_mem_comp): Likewise.
+ (insns_for_mem_walk): Likewise.
+ * c-lang.c: Include ggc.h.
+ * Makefile.in (OBJS): Remove hash.o.
+ (c-lang.o): Add GGC_H.
+ (COLLECT2_OBJS): Remove hash.o.
+ (tlink.o): Remove hash.h, add HASHTAB_H and OBSTACK_H.
+ (ggc-common.o): Remove hash.h.
+ (function.o): Remove hash.h, add HASHTAB_H.
+ (genautomata.o): Remove hash.h, add HASHTAB_H.
+
+ * varasm.c (mark_const_str_htab_1): Delete.
+ (mark_const_str_htab): Delete.
+ (const_str_htab_del): Delete.
+ (const_str_htab): Use gengtype to mark.
+ (init_varasm_once): Use gengtype to mark hashtables. Use GC to
+ allocate them.
+ * tree.c (mark_tree_hashtable_entry): Delete.
+ (mark_tree_hashtable): Delete.
+ * tree.h (mark_tree_hashtable): Delete prototype.
+ * ggc.h (ggc_test_and_set_mark): Treat (void *)1 like NULL.
+ (ggc_mark): Likewise.
+ (ggc_calloc): New.
+ (htab_create_ggc): New.
+ * ggc-common.c (ggc_calloc): New.
+ * gengtype.h (enum typekind): Add TYPE_PARAM_STRUCT.
+ (struct type): Add param_struct structure.
+ * gengtype.c (param_structs): New.
+ (adjust_field_type): Handle param_is option.
+ (set_gc_used_type): Handle TYPE_PARAM_STRUCT.
+ (get_output_file_with_visibility): Include hashtab.h in gtype-desc.c.
+ (write_gc_structure_fields): Add new PARAM parameter. Update
+ callers. Handle use_param option. Handle TYPE_PARAM_STRUCT.
+ (write_gc_marker_routine_for_structure): Add new PARAM parameter.
+ Use it to generate function name. Update callers.
+ (write_gc_types): Add new PARAM_STRUCTS parameter. Update callers.
+ Process them.
+ (write_gc_roots): Handle TYPE_PARAM_STRUCT. Allow param_is
+ option.
+ (main): Define PTR as pointer-to-scalar. Don't specially
+ mark deferred_string or ehl_map_entry.
+ * gengtype-yacc.y (PARAM_IS): Add new token.
+ (externstatic): Use adjust_field_type.
+ (type_option): Add PARAM_IS.
+ * gengtype-lex.l: Add rule for typedef of function pointers.
+ Add rule for PARAM_IS.
+ (IWORD): Add size_t.
+ * except.c (exception_handler_label_map): Use gengtype to mark.
+ (type_to_runtime_map): Likewise.
+ (mark_ehl_map_entry): Delete.
+ (mark_ehl_map): Delete.
+ (init_eh): Use gengtype for roots; use GC to allocate hash tables.
+ (t2r_mark_1): Delete.
+ (t2r_mark): Delete.
+ * Makefile.in (gtype-desc.o): Correct dependencies.
+ (GTFILES): Add hashtab.h.
+ (genautomata.o): Actually uses hashtab.h.
+
+ * Makefile.in (stringpool.o): Add $(GGC_H).
+ (dwarf2asm.o): Likewise.
+ (GTFILES): Add hashtable.h.
+ * c-common.h (struct c_common_identifier): Use gengtype.
+ * c-decl.h (c_mark_tree): Delete.
+ * c-lang.c (LANG_HOOKS_MARK_TREE): Delete.
+ * c-tree.h (struct lang_identifier): Use gengtype.
+ (union lang_tree_node): New.
+ (c_mark_tree): Delete prototype.
+ * dwarf2out.c [!DWARF2_DEBUGGING_INFO]: Define dummy
+ dwarf2_debug_hooks.
+ * gengtype-lex.l (IWORD): Allow 'bool'.
+ (ptr_alias): Match.
+ * gengtype-yacc.y (ALIAS): New token.
+ (type_option): New rule.
+ (option): Use type_option.
+ * gengtype.c (process_gc_options): New.
+ (set_gc_used_type): Use it.
+ (write_gc_structure_fields): Add 'bitmap' parameter, change callers.
+ Add new variable 't' to hold the type of the field being processed.
+ Add more error checking. Use UNION_P when looking at 'desc' option.
+ Handle language-specific structures containing other
+ language-specific structures.
+ (write_gc_types): Handle 'ptr_alias' option.
+ (main): Don't need to specially output lang_type, lang_decl, lang_id2.
+ * ggc-common.c (ggc_pending_trees): Delete.
+ (ggc_mark_roots): Don't manipulate ggc_pending_trees.
+ (ggc_mark_trees): Delete.
+ (gt_ggc_m_tree_node): Delete.
+ * ggc.h (ggc_pending_trees): Delete.
+ (ggc_mark_tree): Make alias of gt_ggc_m_tree_node.
+ * hashtable.h (ht_identifier): Use gengtype.
+ * langhooks-def.h (LANG_HOOKS_MARK_TREE): Delete.
+ * langhooks.h (struct lang_hooks): Delete mark_tree.
+ * sdbout.c [! SDB_DEBUGGING_INFO]: Define dummy sdb_debug_hooks
+ anyway.
+ * system.h: Poison LANG_HOOKS_MARK_TREE.
+ * tree.c (tree_node_structure): New.
+ * tree.h (struct tree_common): Use gengtype.
+ (struct tree_int_cst): Likewise.
+ (struct tree_real_cst): Likewise.
+ (struct tree_string): Likewise.
+ (struct tree_complex): Likewise.
+ (struct tree_vector): Likewise.
+ (struct tree_identifier): Likewise.
+ (struct tree_list): Likewise.
+ (struct tree_vec): Likewise.
+ (struct tree_exp): Likewise.
+ (struct tree_block): Likewise.
+ (struct tree_type): Likewise.
+ (struct tree_decl): Likewise.
+ (enum tree_structure_enum): New.
+ (union tree_node): Use gengtype, with an alias.
+ (tree_node_structure): Prototype.
+ * objc/objc-lang.c (LANG_HOOKS_MARK_TREE): Delete.
+
+ Merge to tag pch-merge-20020430. The LANG_HOOKS_FUNCTION_MARK
+ macro was deleted. The LANG_HOOKS_FUNCTION_FREE macro was renamed
+ to LANG_HOOKS_FUNCTION_FINAL.
+ * Makefile.in (GTFILES): Add bitmap.h.
+ * except.c (struct eh_region): Mark field 'aka' to be skipped.
+
+ * config/alpha/alpha.c [TARGET_ABI_UNICOSMK]
+ (alpha_init_machine_status): Give proper type.
+ * Makefile.in (c-lang.o): Depend on gtype-c.h.
+ (optabs.o): Depend on gt-optabs.h.
+ (GTFILES): Add optabs.o.
+ (gt-optabs.h): Add rule.
+ * optabs.c: Include gt-optabs.h.
+
+ * gengtype.c (set_gc_used_type): Correct some errors in last change.
+ (write_gc_structure_fields): If a field which should be NULL is
+ not, abort.
+ * c-pragma.c: Move struct align_stack and variable alignment_stack
+ out from the ifdef.
+
+ * config/xtensa/t-xtensa: Add dependencies for gt-xtensa.h.
+ * config/xtensa/xtensa.c: Include gt-cris.h.
+ (struct machine_function): Use gengtype to mark.
+ * config/mmix/mmix.h (struct machine_function): Use gengtype
+ to mark.
+ * config/cris/t-cris: Add dependencies for gt-cris.h.
+ * config/cris/cris.c: Include gt-cris.h.
+ (struct machine_function): Use gengtype to mark.
+ * config/rs6000/rs6000.h (struct machine_function): Use gengtype
+ to mark.
+ * doc/tm.texi (Per-Function Data): Delete references to
+ mark_machine_status.
+ * config/ia64/ia64.c (ia64_override_options): Don't set
+ mark_machine_status.
+ * config/i386/i386.c (override_options): Likewise.
+ * config/d30v/d30v.c (d30v_init_expanders): Likewise.
+ * config/arm/arm.c (arm_init_expanders): Likewise.
+ * config/alpha/alpha.c (override_options): Likewise.
+ * gengtype.h (enum gc_used_enum): Add GC_MAYBE_POINTED_TO.
+ * gengtype.c (set_gc_used_type): Handle 'maybe_null' option.
+ (write_gc_structure_fields): Don't handle 'really' option.
+ Handle 'maybe_null' option.
+ (write_gc_types): Handle 'maybe_null' option.
+ * function.h (struct function): Don't use "really".
+ (mark_machine_status): Delete declaration.
+ (mark_lang_status): Delete declaration.
+ (gt_ggc_mr_machine_function): Delete prototype.
+ (gt_ggc_mr_language_function): Delete prototype.
+ * function.c (mark_machine_status): Delete.
+ (mark_lang_status): Delete.
+ (gt_ggc_mr_machine_function): Delete.
+ (gt_ggc_mr_language_function): Delete.
+ * c-tree.h (mark_c_function_context): Delete prototype.
+ * c-objc-common.c (c_objc_common_init): Don't set mark_lang_status.
+ * c-decl.c (struct language_function): Rename from struct
+ c_language_function. Update uses. Use gengtype to mark.
+ (mark_c_function_context): Delete.
+ * c-common.h (struct c_language_function): Rename from struct
+ language_function.
+ (mark_stmt_tree): Delete prototype.
+ (c_mark_lang_decl): Delete prototype.
+ (mark_c_language_function): Delete prototype.
+ * c-common.c (mark_stmt_tree): Delete.
+ (c_mark_lang_decl): Delete.
+ (mark_c_language_function): Delete.
+
+ * gengtype.h (enum typekind): Add TYPE_LANG_STRUCT.
+ (lang_bitmap): New typedef. Use where appropriate.
+ (struct type): Add gc_used field, lang_struct field.
+ (UNION_P): New macro.
+ (new_structure): New prototype.
+ (find_structure): Remove 'pos' parameter. Change all callers.
+ * gengtype-lex.l: Update for changes to find_structure.
+ * gengtype-yacc.y (typedef_struct): Use new_structure.
+ (yacc_ids): Suppress warning.
+ (type): Use new_structure.
+ * gengtype.c (string_type): Update for changes to struct type.
+ (find_structure): Just find a structure, don't worry about
+ creating one.
+ (new_structure): New.
+ (note_yacc_type): Use new_structure.
+ (set_gc_used_type): New.
+ (set_gc_used): New.
+ (write_gc_structure_fields): Allow for pointers to TYPE_LANG_STRUCT.
+ (write_gc_types): Handle TYPE_LANG_STRUCT.
+ (write_gc_marker_routine_for_structure): New.
+ (main): Call set_gc_used. Add some calls to set_gc_used_type
+ for places where GCC doesn't use gengtype properly yet.
+ * ggc.h (gt_ggc_m_rtx_def): Don't prototype.
+ (gt_ggc_m_tree_node): Likewise.
+
+ * varasm.c (copy_constant): Call expand_constant if we hit
+ something we can't recognise.
+
+ * ggc-common.c (ggc_mark_rtvec_children): Delete.
+ (ggc_mark_rtx_children): Use generic name for ggc_mark_rtvec.
+ (lang_mark_false_label_stack): Delete.
+ * rtl.h (struct rtvec_def): Use gengtype to mark.
+ * ggc.h (ggc_mark_rtvec): Delete.
+ (gt_ggc_m_rtvec_def): Delete.
+ (ggc_mark_nonnull_tree): Delete.
+ (ggc_mark_rtvec_children): Delete prototype.
+ (lang_mark_false_label_stack): Delete declaration.
+
+ * gengtype.h (note_yacc_type): Add prototype.
+ * gengtype.c (note_yacc_type): New function.
+ * gengtype-lex.l: Add lexer support for yacc files.
+ * gengtype-yacc.y (start): Extract union from yacc files.
+ (yacc_union): New rule.
+ (yacc_typematch): New rule.
+ (yacc_ids): New rule.
+ (enum_items): Tweak for efficiency.
+ (optionseq): Likewise.
+
+ * c-common.h (struct language_function): Use gengtype.
+ (struct c_lang_decl): Likewise.
+ * c-tree.h (struct lang_decl): Likewise.
+ (struct lang_type): Likewise.
+ * c-decl.c (lang_mark_tree): Use generated marker routines to mark
+ tree language substructures.
+
+ * stringpool.c (mark_ident): Replace ggc_mark_nonnull_tree with
+ ggc_mark_tree.
+ * dwarf2asm.c (mark_indirect_pool_entry): Likewise.
+
+ * varasm.c (struct rtx_const): Remove 'skip' tags for scalar arrays.
+
+ * stmt.c (struct nesting): Add discriminator. Use gengtype to
+ mark. Remove 'data.block.cleanup_ptr' field.
+ (struct stmt_status): Use usual technique to mark struct nesting.
+ (gt_ggc_mr_nesting_cond): Delete.
+ (gt_ggc_mr_nesting_loop): Delete.
+ (gt_ggc_mr_nesting_block): Delete.
+ (gt_ggc_mr_nesting_case_stmt): Delete.
+ (expand_start_cond): Set discriminator.
+ (expand_start_loop): Likewise.
+ (expand_start_null_loop): Likewise.
+ (expand_start_bindings_and_block): Set discriminator. Don't set
+ deleted fields.
+ (expand_decl_cleanup): Replace 'cleanup_ptr' with
+ &thisblock->data.block.cleanups.
+ (expand_start_case): Set discriminator.
+ (expand_start_case_dummy): Set discriminator.
+
+ * ggc-callbacks.c: Remove.
+
+ * gengtype.h (struct type): Add 'u.s.bitmap' field.
+ (find_structure): Add 'pos' parameter.
+ * gengtype-lex.l: Update callers to find_structure.
+ * gengtype-yacc.y: Likewise.
+ * gengtype.c (find_structure): Allow for structures to be defined
+ in multiple language backends.
+ (get_output_file_with_visibility): Include debug.h in gtype-desc.c.
+ (counter): Rename to gc_counter.
+ (write_gc_structure_fields): Fail when writing out fields for
+ an incomplete structure. Ignore arrays of scalars. Handle
+ 'tree_vec' special.
+ (write_gc_types): Reset counter for each procedure written.
+
+ * stmt.c (add_case_node): Use GGC to allocate struct case_node.
+ (free_case_nodes): Delete.
+ (expand_end_case_type): Delete call to free_case_nodes.
+
+ * Makefile.in (cselib.o): Include gt-<filename>.h.
+ (gcse.o): Likewise.
+ (profile.o): Likewise.
+ (alias.o): Likewise.
+ (GTFILES): Add alias.c, cselib.c, gcse.c, profile.c, and
+ alphabetize backend files.
+ (gt-alias.h, gt-cselib.h, gt-gcse.h, gt-profile.h): New rules.
+ * alias.c: Use gengtype for roots.
+ * c-common.h (struct stmt_tree_s): Use gengtype.
+ * c-decl.c: Use gengtype for roots.
+ * cselib.c: Use gengtype for roots.
+ * expr.c: Use gengtype for roots.
+ * fold-const.c: Use gengtype for roots.
+ * gcse.c: Use gengtype for roots.
+ * gengtype-lex.l: Handle typedefs of function types.
+ Allow for empty array bounds.
+ Allow processing to stop on initialisers.
+ * gengtype-yacc.y (externstatic): Stop processing on initialisers.
+ (semiequal): New rule.
+ * gengtype.c (create_file): Tidy output files.
+ (get_output_file_with_visibility): Fix paren warning. Fix bug
+ involving multiple input files mapping to one output file.
+ (write_gc_structure_fields): Skip arrays of scalars.
+ (write_gc_types): Tidy output files.
+ (write_gc_root): New function.
+ (write_gc_roots): Fix bugs, add support for roots that are
+ structures.
+ * ggc-common.c (ggc_mark_rtx_ptr): Delete.
+ (ggc_mark_tree_ptr): Delete.
+ (ggc_add_rtx_root): Delete.
+ (ggc_add_tree_root): Delete.
+ (ggc_del_root): Delete.
+ * integrate.c (get_func_hard_reg_initial_val): Use ggc_alloc to
+ allocate struct initial_value_struct.
+ * profile.c: Use gengtype for roots.
+ * sdbout.c: Use gengtype for roots.
+ * varasm.c (mark_weak_decls): Delete unused prototype.
+ (mark_const_hash_entry): Delete unused function.
+ * config/darwin-protos.h: Use gengtype for roots.
+ (machopic_add_gc_roots): Delete.
+ * config/arm/arm.c: Use gengtype for roots.
+ * config/arm/arm.h: Use gengtype for roots.
+ * config/c4x/c4x-protos.h: Use gengtype for roots.
+ * config/c4x/c4x.c (c4x_add_gc_roots): Delete.
+ * config/d30v/d30v-protos.h: Use gengtype for roots.
+ * config/d30v/d30v.c (d30v_add_gc_roots): Delete.
+ * config/dsp16xx/dsp16xx.c (override_options): Use gengtype for roots.
+ * config/dsp16xx/dsp16xx.h: Use gengtype for roots.
+ * config/ia64/ia64-protos.h: Use gengtype for roots.
+ * config/ia64/ia64.c (ia64_add_gc_roots): Delete.
+ * config/m68hc11/m68hc11-protos.h: Use gengtype for roots.
+ * config/m68hc11/m68hc11.c (z_reg): Make global.
+ (z_reg_qi): Make global.
+ (m68hc11_add_gc_roots): Delete.
+ * config/mcore/mcore-protos.h: Use gengtype for roots.
+ * config/mcore/mcore.c (mcore_add_gc_roots): Delete.
+ * config/mips/mips.c (mips_add_gc_roots): Delete.
+ * config/mips/mips.h: Use gengtype for roots.
+ * config/mmix/mmix.c (override_options): Use gengtype for roots.
+ * config/mmix/mmix.h: Use gengtype for roots.
+ * config/mn10200/mn10200.c (asm_file_start): Use gengtype for roots.
+ * config/mn10200/mn10200.h: Use gengtype for roots.
+ * config/pa/pa.c: Use gengtype for roots, marking.
+ (struct deferred_plabel): Use GGC, gengtype.
+ (pa_add_gc_roots): Delete.
+ (mark_deferred_plabels): Delete.
+ * config/pj/pj-protos.h: Use gengtype for roots.
+ * config/pj/pj.h (OVERRIDE_OPTIONS): Don't define.
+ * config/rs6000/rs6000.c: Use gengtype for roots. Don't call
+ machopic_add_gc_roots.
+ * config/rs6000/rs6000.h: Use gengtype for roots.
+ * config/rs6000/t-darwin (darwin.o): Add dependency on gt-darwin.h.
+ (gt-darwin.h): Add rule.
+ * config/sh/sh.c: Use gengtype for roots.
+ * config/sh/t-sh ($(out_object_file)): Add dependency on gt-sh.h.
+ (gt-sh.h): Add rule.
+ * config/sparc/sparc.c: Use gengtype for roots.
+ (sparc_add_gc_roots): Delete.
+ (struct ultrasparc_pipeline_state): Use GGC, gengtype.
+ (mark_ultrasparc_pipeline_state): Delete.
+ * config/sparc/sparc.h: Use gengtype for roots.
+
+ * Makefile.in (c-parse.o): Update dependencies.
+ (c-common.o): Likewise.
+ (GTFILES): Add c-common.h, c-tree.h, c-common.c, c-parse.in.
+ Add dependencies for the files they generate.
+ * c-common.c: Replace ggc_add_* uses with GTY annotations.
+ * c-common.h: Likewise.
+ * c-decl.c: Likewise.
+ (gt_ggc_mp_binding_level): Delete.
+ * c-lang.c: Include gtype-c.h.
+ * c-parse.in: Replace ggc_add_* uses with GTY annotations. Include
+ gt-c-parse.h.
+ * c-pragma.h: Replace ggc_add_* uses with GTY annotations.
+ (gt_ggc_mp_align_stack): Delete.
+ * c-tree.h: Replace ggc_add_* uses with GTY annotations.
+ * function.c: Replace ggc_add_* uses with GTY annotations.
+ (gt_ggc_mp_function): Delete.
+ * function.h: Replace ggc_add_* uses with GTY annotations.
+ * gengtype.c (lang_names): New.
+ (NUM_BASE_FILES): New.
+ (open_base_files): Create language base files.
+ (startswith): New.
+ (get_file_basename): New.
+ (get_base_file_bitmap): New.
+ (get_output_file_with_visibility): Rename from get_output_file.
+ Add more mappings for various C/Objc filenames.
+ (finish_root_table): New.
+ (write_gc_roots): Handle dependencies and scoping properly.
+ * gengtype.h: Add prototypes for new functions.
+ * ggc-common.c (struct deletable_root): Delete.
+ (deletables): Delete.
+ (ggc_add_deletable_root): Delete.
+ (ggc_mark_roots): No need to deal with deleted functionality.
+ * ggc.h (ggc_add_deletable_root): Delete prototype.
+ * objc/Make-lang.in (objc-act.o): Add gtype-objc.h dependency.
+ (gtype-objc.h): Add rule to create.
+ * objc/config-lang.in (gtfiles): New.
+ * objc/objc-act.c: Allocate imp_list using GGC. Replace uses of
+ ggc_add_* with GTY markers. Include gtype-objc.h.
+ (ggc_mark_imp_list): Delete.
+ * objc/objc-act.h: Replace uses of ggc_add_* with GTY markers.
+ * objc/objc-lang.c: Random Whitespace Change.
+
+ * except.h (exception_handler_labels): Delete.
+ (get_exception_handler_labels): New.
+ * except.c (exception_handler_labels): Delete.
+ (struct eh_status): Add exception_handler_labels field.
+ (doing_eh): Don't add exception_handler_labels as root.
+ (free_eh_status): Don't need to free exception_handler_labels.
+ (get_exception_handler_labels): New.
+ (find_exception_handler_labels): Update for move of
+ exception_handler_labels.
+ (remove_exception_handler_label): Likewise.
+ * cfgrtl.c (can_delete_label_p): Use get_exception_handler_labels.
+ * jump.c (rebuild_jump_labels): Likewise.
+ * loop.c (find_and_verify_loops): Likewise.
+ * sched-rgn.c (is_cfg_nonregular): Likewise.
+
+ * gengtype.c (write_gc_structure_fields): Handle variable-length
+ TYPE_ARRAYs.
+
+ * varasm.c (struct weak_syms): Use GGC, gengtype.
+ (mark_weak_decls): Delete.
+ (weak_decls): Likewise.
+ (add_weak): Likewise.
+ (remove_from_pending_weak_list): Likewise.
+ (init_varasm_once): Likewise.
+
+ * Makefile.in (gtype-desc.o): Add libfuncs.h dependency.
+ (GTFILES): Add tree.h, libfuncs.h, emit-rtl.c, explow.c,
+ stor-layout.c, regclass.c, and lists.c.
+ Add dependencies of gt-emit-rtl.h gt-explow.h gt-stor-layout.h
+ gt-regclass.h and gt-lists.h on s-gtype.
+ * emit-rtl.c: Use gengtype for roots. Include gt-emit-rtl.h.
+ * except.c: Use gengtype for roots.
+ * explow.c: Use gengtype for roots. Include gt-explow.h.
+ * expr.h (init_stor_layout_once): Delete prototype.
+ * function.c: Use gengtype for roots.
+ * gengtype-lex.l: Add ENT_EXTERNSTATIC lexing.
+ * gengtype-yacc.y (start): Can also be an externstatic.
+ (externstatic): New production.
+ (struct_fields): Correct array bounds inversion for 2-d arrays.
+ * gengtype.c (variables): New variable.
+ (note_variable): New function.
+ (get_output_file): Include libfuncs.h into gtype-desc.c.
+ (get_output_file_name): New function.
+ (write_gc_structure_fields): Suppress warnings.
+ (write_gc_types): Make static.
+ (put_mangled_filename): New function.
+ (write_gc_roots): New function.
+ (main): Call write_gc_roots.
+ * gengtype.h (note_variable): Prototype.
+ (get_output_file_name): Prototype.
+ (write_gc_types): Delete prototype.
+ * ggc.h: Clean up unnecessary structure predefinitions.
+ (struct ggc_root_tab): Define.
+ (gt_ggc_m_rtx_def): Make function, not macro.
+ (gt_ggc_m_tree_node): Likewise.
+ * libfuncs.h: Use gengtype for roots.
+ * lists.c: Use gengtype for roots. Include gt-lists.h.
+ (init_EXPR_INSN_LIST_cache): Delete.
+ * optabs.c: Use gengtype for roots.
+ (gt_ggc_mp_optab): Delete.
+ * optabs.h: Use gengtype for roots.
+ * regclass.c: Use gengtype for roots. Include gt-regclass.h.
+ * rtl.h: Use gengtype for roots.
+ (init_EXPR_INSN_LIST_cache): Delete prototype.
+ * stor-layout.c: Use gengtype for roots.
+ Include gt-stor-layout.h.
+ (init_stor_layout_once): Delete.
+ * toplev.c: Use gengtype for roots. Delete calls to deleted
+ routines.
+ * tree.c: Use gengtype for roots.
+ * tree.h: Use gengtype for roots.
+ * varasm.c: Use gengtype for roots.
+
+ * Makefile.in (GTFILES): Add @all_gtfiles@.
+ * configure: Regenerate.
+ * configure.in: Construct all_gtfiles from the gtfiles definitions
+ in config-lang.in.
+ * gengtype-yacc.y (type): Warn about duplicate structure names.
+ * gengtype.c (get_output_file): Handle .c files in language
+ subdirectories.
+
+ * Makefile.in (GTFILES): Run gengtype on all the config files
+ and on the target .c file.
+ * except.c (mark_eh_region): Delete.
+ (init_eh_for_function): Use GGC on struct eh_status.
+ (mark_eh_status): Delete.
+ (free_eh_status): Use GGC.
+ (expand_eh_region_start): Use GGC to
+ (collect_eh_region_array): Allocate last_region_number using GGC.
+ (duplicate_eh_region_1): Use GGC to allocate struct eh_region.
+ (remove_eh_handler): Let GGC free struct eh_region.
+ (add_call_site): Use GGC to reallocate call_site_record array.
+ * function.c (init_machine_status): Update calling sequence.
+ (mark_machine_status): Likewise.
+ (mark_lang_status): Likewise.
+ (prepare_function_start): Update init_machine_status call.
+ (mark_function_status): Delete.
+ (maybe_mark_struct_function): Delete.
+ (ggc_mark_struct_function): Delete.
+ (gt_ggc_mp_function): New.
+ (gt_ggc_mr_machine_function): New.
+ (gt_ggc_mr_language_function): New.
+ (init_function_once): Use canonical names.
+ * function.h (struct function): Use gengtype.
+ (init_machine_status): Return the structure.
+ (mark_machine_status): Take a 'void *'.
+ (mark_lang_status): Likewise.
+ * ggc-common.c (ggc_mark_trees): Use canonical name for
+ ggc_mark_struct_function.
+ * tree.h (ggc_mark_struct_function): Delete prototype.
+ * config/alpha/alpha.c (alpha_mark_machine_status): Delete.
+ (alpha_init_machine_status): Likewise.
+ (override_options): Use canonical name for alpha_mark_machine_status.
+ * config/alpha/unicosmk.h (struct machine_function): Use gengtype.
+ * config/arm/arm.h (struct machine_function): Use gengtype.
+ * config/arm/arm.c (arm_mark_machine_status): Delete.
+ (arm_init_machine_status): Update calling sequence.
+ (arm_init_expanders): Use canonical name for arm_mark_machine_status.
+ * config/cris/cris.c (cris_init_machine_status): Update
+ calling sequence.
+ * config/d30v/d30v.h (struct machine_function): Use gengtype.
+ * config/d30v/d30v.c (d30v_init_machine_status): Update
+ calling sequence.
+ (d30v_mark_machine_status): Delete.
+ * config/i386/i386.c: Include gt-i386.h.
+ (struct machine_function): Use gengtype.
+ (ix86_init_machine_status): Update calling sequence.
+ (ix86_mark_machine_status): Delete.
+ (override_options): Use canonical namke for ix86_mark_machine_status.
+ * config/ia64/ia64.h (struct machine_function): Use gengtype.
+ * config/ia64/ia64.c (ia64_init_machine_status): Update calling
+ sequence.
+ (ia64_mark_machine_status): Delete.
+ (ia64_override_options): Use canonical name for
+ ia64_mark_machine_status.
+ * config/mmix/mmix.c (mmix_init_machine_status): Update calling
+ sequence.
+ * config/rs6000/rs6000.c (rs6000_init_machine_status): Likewise.
+ * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
+ * gengtype.c (get_output_file): Fix warning.
+ (main): Add prototype to suppress warning.
+ * tree.c: Remove tree_hash_mark prototype.
+
+ * tree.h (init_stmt): Delete prototype.
+ * toplev.c (lang_independent_init): Don't call init_stmt.
+ * stmt.c (ALLOC_NESTING): Use GGC for 'struct nesting'.
+ (stmt_obstack): Delete.
+ (POPSTACK): No need to free 'struct nesting'.
+ (gt_ggc_mr_nesting_cond): Use canonical names.
+ (gt_ggc_mr_nesting_loop): Use canonical names.
+ (gt_ggc_mr_nesting_block): Use canonical names.
+ (gt_ggc_mr_nesting_case_stmt): Use canonical names.
+ (mark_stmt_status): Delete.
+ (init_stmt): Delete.
+ (clear_last_expr): Clear both last_expr_type and last_expr_value.
+ Use it everywhere that last_expr_type was cleared.
+ * lists.c (init_EXPR_INSN_LIST_cache): Use ggc_add_deletable_root.
+ (zap_lists): Delete.
+ * ggc.h (ggc_add_deletable_root): Prototype.
+ (mark_stmt_status): Remove prototype.
+ * ggc-common.c (ggc_add_deletable_root): New.
+ (ggc_mark_roots): Handle deletable roots.
+ * function.c (ggc_mark_struct_function): Use canonical name
+ for mark_stmt_status.
+ * emit-rtl.c (free_sequence_stack): New.
+ (start_sequence): Use a freelist for sequences.
+ (end_sequence): Likewise.
+ (init_emit_once): Add free_sequence_stack as a deleteable root.
+ * c-pragma.c Include gt-c-pragma.h.
+ (struct align_stack): Use gengtype.
+ (push_alignment): Use GGC for struct align_stack.
+ (mark_align_stack): Delete.
+ (gt_ggc_mp_align_stack): New.
+ (init_pragma): Use canonical name for mark_align_stack.
+ * c-decl.c: Include gt-c-decl.h.
+ (struct binding_level): Use gengtype.
+ (make_binding_level): Use GGC; handle the freelist here.
+ (pop_binding_level): New.
+ (pushlevel): Move code into make_binding_level.
+ (push_label_level): Likewise.
+ (poplevel): Move code into pop_binding_level.
+ (pop_label_level): Likewise.
+ (mark_binding_level): Delete.
+ (gt_ggc_mp_binding_level): New.
+ (c_init_decl_processing): Use canonical name for mark_binding_level.
+ Add free_binding_level as deletable root.
+ (mark_c_function_context): Use canonical name for mark_binding_level.
+ * Makefile.in (c-decl.o): Add gt-c-decl.h.
+ (c-pragma.o): Add gt-c-pragma.h.
+ (GTFILES): Add c-decl.c and c-pragma.c.
+ (gt-c-decl.h, gt-c-pragma.h): Create using gengtype.
+
+ * tree.c (struct type_hash): Use gengtype.
+ (init_obstacks): Use canonical name for type_hash_mark.
+ (type_hash_mark): Delete.
+ Include gt-tree.h.
+ * rtl.h (struct mem_attrs): Use gengtype.
+ * optabs.h (struct optab): Use gengtype.
+ * optabs.c (expand_binop): Squish signed/unsigned warning.
+ (mark_optab): Make local, use canonical name, use autogenerated
+ marker procedure.
+ (init_optabs): Use canonical name for mark_optab.
+ (new_optab): Use GGC to allocate optabs.
+ * ggc.h: Delete mark_optab prototype.
+ * ggc-common.c (ggc_mark_rtx_children): Use canonical name for
+ mem_attrs marker procedure.
+ * gengtype.c (get_output_file): Include headers in gtype-desc.c
+ explicitly rather than deducing them from file names.
+ (write_gc_structure_fields): Handle arrays of structures.
+ (main): Return non-zero exit code if errors occur during output.
+ * emit-rtl.c (mem_attrs_mark): Delete.
+ (init_emit_once): Use canonical name for mem_attrs marker procedure.
+ * Makefile.in (gtype-desc.o): Explicitly name dependencies.
+ (tree.o): Depend on gt-tree.h.
+ (GTFILES): Add rtl.h, optabs.h, tree.c.
+ (gt-tree.h): Add it to s-gtype rule.
+
+ * .cvsignore: Ignore gengtype flex/bison generated files.
+ * Makefile.in (GGC_H): Add gtype-desc.h.
+ (OBJS): Add gtype-desc.o.
+ (GEN): Add gengtype.
+ (STAGESTUFF): Add gengtype.
+ (varasm.o): Add gt-varasm.h.
+ (stmt.o): Add gt-stmt.h.
+ (except.o): Add gt-except.h.
+ (integrate.o): Add gt-integrate.h.
+ (GTFILES): New.
+ Add new rules for new files.
+ * configure: Regenerate.
+ * configure.in: Correct defaults.h paths.
+ * emit-rtl.c (mark_sequence_stack): Delete.
+ (mark_emit_status): Delete.
+ (start_sequence): Allocate sequence structures using GGC.
+ (end_sequence): Allocate sequence structures using GGC.
+ * except.c: Use gengtype for various structures. Include
+ gt-except.h.
+ * expr.c (mark_expr_status): Delete.
+ * function.c: Use gengtype for various structures. Include
+ gt-function.h.
+ (mark_function_status): Use standard gt_ggc names for marker functions.
+ (ggc_mark_struct_function): Likewise.
+ * function.h: Use gengtype for various structures.
+ * gengtype-lex.l: New file.
+ * gengtype-yacc.y: New file.
+ * gengtype.c: New file.
+ * gengtype.h: New file.
+ * ggc.h: Include gtype-desc.h. Alias some marker procedures to
+ the standard names. Remove some now-unnecessary prototypes.
+ * integrate.c: Use gengtype for various structures. Include
+ gt-integrate.h.
+ (mark_hard_reg_initial_vals): Delete.
+ * integrate.h (mark_hard_reg_initial_vals): Delete.
+ * stmt.c: Use gengtype for various structures. Include
+ gt-stmt.h.
+ (mark_case_node): Delete.
+ (mark_goto_fixup): Delete.
+ (mark_stmt_status): Use standard gt_ggc names for marker functions.
+ * system.h: Define GTY to empty. In flex/bison files,
+ don't poison malloc or realloc, instead just define them to
+ xmalloc and xrealloc.
+ * varasm.c: Use gengtype for various structures. Include
+ gt-varasm.h. Use standard gt_ggc names for marker functions.
+ (mark_pool_constant): Delete.
+ (mark_varasm_status): Delete.
+ (decode_rtx_const): #if 0 out non-typesafe hack.
+
+ * function.h (free_lang_status): Mark as obsolete.
+ * function.c (free_lang_status): Mark as obsolete.
+ * c-decl.c (push_c_function_context): Use GC to allocate and free
+ struct language_function.
+ (pop_c_function_context): Likewise.
+ * c-common.c (mark_c_language_function): Mark struct
+ language_function.
+
+ * doc/tm.texi (Per-Function Data): Don't document free_machine_status.
+ Document that the machine_function structures must be allocated
+ using GC. Update mark_machine_status documentation.
+ * function.h: Don't declare free_machine_status.
+ * function.c (free_machine_status): Don't define.
+ (free_after_compilation): Don't call free_machine_status.
+ (ggc_mark_struct_function): Mark f->machine. Call
+ mark_machine_status only on non-NULL pointers.
+ * system.h: Poison free_machine_status.
+ * config/xtensa/xtensa.c (xtensa_init_machine_status): Use GC on
+ struct machine_function.
+ (xtensa_free_machine_status): Delete.
+ (override_options): Don't set free_machine_status.
+ * config/rs6000/rs6000.c (rs6000_override_options): Don't set
+ free_machine_status.
+ (rs6000_init_machine_status): Use GC on struct machine_function.
+ (rs6000_free_machine_status): Delete.
+ * config/ia64/ia64.c (ia64_init_machine_status): Use GC on struct
+ machine_function.
+ (ia64_mark_machine_status): Likewise.
+ (ia64_free_machine_status): Delete.
+ (ia64_override_options): Don't set free_machine_status.
+ * config/i386/i386.c (override_options): Don't set
+ free_machine_status.
+ (ix86_init_machine_status): Use GC on struct machine_function.
+ (ix86_mark_machine_status): Likewise.
+ (ix86_free_machine_status): Delete.
+ * config/d30v/d30v.c: (d30v_init_machine_status): Use GC on struct
+ machine_function.
+ (d30v_mark_machine_status): Likewise.
+ (d30v_free_machine_status): Delete.
+ (d30v_init_expanders): Don't set free_machine_status.
+ * config/arm/arm.c (arm_mark_machine_status): Use GC on struct
+ machine_function.
+ (arm_init_machine_status): Likewise.
+ (arm_free_machine_status): Delete.
+ (arm_init_expanders): Don't set free_machine_status.
+ * config/alpha/alpha.c (override_options): Don't set
+ free_machine_status.
+ (alpha_init_machine_status): Use GC on struct machine_function.
+ (alpha_mark_machine_status): Likewise.
+ (alpha_free_machine_status): Delete.
+
+ * varasm.c (compare_constant): Fix typo.
+
+ * varasm.c: Don't include obstack.h.
+ (struct varasm_status): x_const_rtx_hash_table is a hash of rtxes.
+ (struct rtx_const): Give substructures names, improve formatting.
+ (struct constant_descriptor): Delete.
+ (struct constant_descriptor_tree): New, based on constant_descriptor.
+ (const_hash_table): Is a hash table of trees.
+ (mark_const_hash_entry): Is used for hashes of trees. Mark
+ constant_descriptor_tree structure.
+ (mark_const_str_htab_1): Mark deferred_string structure.
+ (compare_constant): Rewrite to compare trees.
+ (compare_constant_1): Delete.
+ (record_constant): Delete.
+ (record_constant_1): Delete.
+ (output_constant_def): Use struct constant_descriptor_tree.
+ Don't duplicate trees twice.
+ (struct constant_descriptor_rtx): New.
+ (struct pool_constant): Used for rtx constants.
+ (init_varasm_status): Update for change to struct varasm_status.
+ (mark_varasm_status): Likewise.
+ (free_varasm_status): Delete.
+ (compare_constant_rtx): Rewrite to handle constant_descriptor_rtx.
+ (record_constant_rtx): Likewise.
+ (mem_for_const_double): Update to use struct constant_descriptor_rtx.
+ (force_const_mem): Likewise.
+ * Makefile.in (varasm.o): Doesn't depend on obstack.h.
+ * function.c (free_after_compilation): Don't use free_varasm_status.
+ * function.h: Don't prototype free_varasm_status.
+
+ * ggc-common.c (ggc_realloc): Handle X being NULL.
+
+ * ggc-common.c (ggc_realloc): New function.
+ * ggc.h: Prototype it.
+ * emit-rtl.c (free_emit_status): Delete.
+ (init_emit): Allocate emit subarrays using GC.
+ (gen_reg_rtx): Reallocate subarrays using GC.
+ (init_emit): Use GC to allocate 'struct emit_status' and its
+ subarrays.
+ (mark_emit_status): Mark structure and its subarrays.
+ * stmt.c (free_stmt_status): Delete.
+ * expr.c (free_expr_status): Delete.
+ * function.h: Remove prototypes for deleted functions.
+ * function.c (free_after_compilation): Don't use deleted functions.
+ Don't call free() on x_parm_reg_stack_loc.
+ (free_after_parsing): Don't use free_stmt_status.
+ (assign_parms): Use GC to allocate and resize x_parm_reg_stack_loc.
+ (mark_function_status): Mark x_parm_reg_stack_loc.
+
+ * varasm.c (init_varasm_status): Use GC to allocate
+ 'struct varasm_status' and its fields x_const_rtx_hash_table
+ and x_const_rtx_sym_hash_table.
+ (mark_varasm_status): Mark them.
+ (free_varasm_status): Use GC to free them.
+ * expr.c (init_expr): Use GC to allocate 'struct expr_status'.
+ (mark_expr_status): Mark the structure itself.
+ (free_expr_status): Use GC to free the structure.
+ * stmt.c (free_stmt_status): Use GC to free 'struct stmt_status'.
+ (mark_stmt_status): Mark the 'struct stmt_status' itself.
+ (init_stmt_for_function): Allocate the structure for GC.
+
+ * dwarf2out.c (lookup_type_die): Use TYPE_SYMTAB_DIE.
+ (equate_type_number_to_die): Likewise.
+ * tree.h (TYPE_SYMTAB_DIE): New macro.
+ (struct die_struct): Predeclare.
+ (struct tree_type): Add field symtab.die. Add a tag
+ to the union type of field symtab.
+
+ * varray.h (VARRAY_RTVEC_INIT): A varray of rtvec contains
+ 'struct rtvec_def *', not 'struct rtvec_def'.
+
+ * function.h (original_arg_vector): Make a real rtvec.
+ * function.c (ggc_mark_struct_function): Adjust.
+ * integrate.c (expand_inline_function): Adjust.
+
2002-06-04 Jason Thorpe <thorpej@wasabisystems.com>
* config.gcc (sh5-*-netbsd*, sh5l*-*-netbsd*)
INTEGRATE_H = integrate.h varray.h
LOOP_H = loop.h varray.h bitmap.h
GCC_H = gcc.h version.h
-GGC_H = ggc.h varray.h
+GGC_H = ggc.h varray.h gtype-desc.h
TIMEVAR_H = timevar.h timevar.def
INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h
C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H)
# Language-independent object files.
-OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
- cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o cfgrtl.o \
- combine.o conflict.o convert.o cse.o cselib.o dbxout.o debug.o dependence.o \
- df.o diagnostic.o doloop.o dominance.o dwarf2asm.o dwarf2out.o dwarfout.o \
- emit-rtl.o except.o explow.o expmed.o expr.o final.o flow.o \
- fold-const.o function.o gcse.o genrtl.o ggc-common.o global.o graph.o \
- haifa-sched.o hash.o hashtable.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o \
- insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
- integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
- loop.o mbchar.o optabs.o params.o predict.o print-rtl.o print-tree.o \
- profile.o real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
- reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
- sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
- sibcall.o simplify-rtx.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
+OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
+ cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \
+ cfgrtl.o combine.o conflict.o convert.o cse.o cselib.o dbxout.o \
+ debug.o dependence.o df.o diagnostic.o doloop.o dominance.o \
+ dwarf2asm.o dwarf2out.o dwarfout.o emit-rtl.o except.o explow.o \
+ expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o \
+ genrtl.o ggc-common.o global.o graph.o gtype-desc.o \
+ haifa-sched.o hashtable.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o \
+ insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
+ integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
+ loop.o mbchar.o optabs.o params.o predict.o print-rtl.o print-tree.o \
+ profile.o real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
+ reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
+ sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
+ sibcall.o simplify-rtx.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
stor-layout.o stringpool.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
$(GGC) $(out_object_file) $(EXTRA_OBJS)
GEN= genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
genconfig$(build_exeext) genpeep$(build_exeext) gengenrtl$(build_exeext) \
- gencheck$(build_exeext) genpreds$(build_exeext) genconstants$(build_exeext)
+ gencheck$(build_exeext) genpreds$(build_exeext) genconstants$(build_exeext) \
+ gengtype$(build_exeext)
# Files to be copied away after each stage in building.
STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
gencheck$(build_exeext) genpreds$(build_exeext) genconstants$(build_exeext) \
+ gengtype$(build_exeext) \
genrtl.c genrtl.h \
xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
$(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \
c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) flags.h \
diagnostic.h $(TM_P_H)
c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) $(GGC_H) intl.h \
- $(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h $(CPPLIB_H)
+ $(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h $(CPPLIB_H) \
+ gt-c-parse.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-c $(srcdir)/c-parse.c $(OUTPUT_OPTION)
c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) \
$(GGC_H) $(TARGET_H) flags.h function.h output.h $(EXPR_H) \
- debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) c-pragma.h
+ debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) c-pragma.h \
+ gt-c-decl.h
c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
$(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
- langhooks.h $(LANGHOOKS_DEF_H) c-common.h
+ $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) c-common.h gtype-c.h
c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
debug.h $(C_TREE_H) c-common.h real.h \
c-pragma.h input.h intl.h flags.h toplev.h output.h \
c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(C_TREE_H) $(RTL_H) insn-config.h integrate.h $(EXPR_H) $(C_TREE_H) \
flags.h toplev.h tree-inline.h diagnostic.h integrate.h $(VARRAY_H) \
- langhooks.h $(GGC_H)
+ langhooks.h $(GGC_H) gt-c-objc-common.h
c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
flags.h toplev.h
c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h \
$(C_COMMON_H)
c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) function.h \
- c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H)
+ c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h
mbchar.o: mbchar.c $(CONFIG_H) $(SYSTEM_H) mbchar.h
graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) toplev.h flags.h output.h $(RTL_H) \
function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h \
$(BASIC_BLOCK_H)
-COLLECT2_OBJS = collect2.o tlink.o hash.o intl.o underscore.o version.o
+COLLECT2_OBJS = collect2.o tlink.o intl.o underscore.o version.o
COLLECT2_LIBS = @COLLECT2_LIBS@
collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
-DTARGET_MACHINE=\"$(target_alias)\" \
-c $(srcdir)/collect2.c $(OUTPUT_OPTION)
-tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) $(SYSTEM_H) collect2.h intl.h
-hash.o: hash.c hash.h $(SYSTEM_H) toplev.h $(GCONFIG_H)
- $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) \
+ $(OBSTACK_H) collect2.h intl.h
underscore.c: s-under ; @true
c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
$(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def $(TARGET_H) \
- diagnostic.h tree-inline.h except.h real.h
+ diagnostic.h tree-inline.h except.h gt-c-common.h real.h
# A file used by all variants of C and some other languages.
version.o: version.c version.h
+gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) varray.h $(HASHTAB_H) \
+ $(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_H) \
+ libfuncs.h debug.h $(GGC_H) bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h \
+ ssa.h cselib.h insn-addr.h
+
ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
- flags.h $(GGC_H) varray.h hash.h $(HASHTAB_H) $(TM_P_H) langhooks.h
+ flags.h $(GGC_H) varray.h $(HASHTAB_H) $(TM_P_H) langhooks.h
ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
$(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
toplev.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H)
stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(OBSTACK_H) \
- flags.h toplev.h
+ flags.h toplev.h $(GGC_H)
hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
$(LANGHOOKS_DEF_H) flags.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h function.h toplev.h \
- $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h real.h
+ $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
+ real.h gt-tree.h
tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
$(EXPR_H) $(SPLAY_TREE_H) tree-dump.h
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
- function.h $(EXPR_H) hard-reg-set.h $(REGS_H) $(OBSTACK_H) \
+ function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
output.h c-pragma.h toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
- $(HASHTAB_H) $(TARGET_H) langhooks.h
+ $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h
function.o : function.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
function.h $(EXPR_H) libfuncs.h $(REGS_H) hard-reg-set.h \
- insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H) \
- $(TM_P_H) langhooks.h
+ insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
+ $(TM_P_H) langhooks.h gt-function.h
stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
$(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
- langhooks.h $(PREDICT_H)
+ langhooks.h $(PREDICT_H) gt-stmt.h
except.o : except.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
except.h function.h $(EXPR_H) libfuncs.h integrate.h langhooks.h \
insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
- dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H)
+ dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
+ gt-except.h
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h function.h \
$(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h insn-attr.h insn-config.h \
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
toplev.h $(TM_P_H) langhooks.h
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
- toplev.h function.h ggc.h $(TM_P_H)
+ toplev.h function.h ggc.h $(TM_P_H) gt-explow.h
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \
- toplev.h $(GGC_H) real.h $(TM_P_H) except.h
+ toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h
dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
$(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h
sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h ggc.h \
- sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h
+ sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
debug.h langhooks.h
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf2.h \
debug.h flags.h insn-config.h reload.h output.h diagnostic.h real.h \
hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
- $(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h
+ $(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h gt-dwarf2out.h
dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
- output.h dwarf2asm.h $(TM_P_H)
+ output.h dwarf2asm.h $(TM_P_H) $(GGC_H)
vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
output.h vmsdbg.h debug.h langhooks.h
xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) xcoffout.h \
integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
- $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h
+ $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H)
output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H)
cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
- output.h function.h cselib.h $(GGC_H) $(OBSTACK_H) $(TM_P_H)
+ output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h
cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h \
$(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H)
gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) hard-reg-set.h \
flags.h real.h insn-config.h ggc.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
- function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h
+ function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h
sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(REGS_H) function.h \
hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \
profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TARGET_H) \
- langhooks.h profile.h libfuncs.h
+ langhooks.h profile.h libfuncs.h gt-profile.h
loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \
insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h \
local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H)
-bitmap.o : bitmap.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(BASIC_BLOCK_H) \
- $(REGS_H)
+bitmap.o : bitmap.c $(GCONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h \
+ $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
global.o : global.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h reload.h function.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h \
$(TM_P_H)
-varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) varray.h $(RTL_H) $(TREE_H) bitmap.h \
- errors.h
+varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) varray.h $(GGC_H) errors.h
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h output.h \
$(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
$(REGS_H) function.h real.h toplev.h $(TM_P_H)
$(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h hard-reg-set.h \
$(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
- $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H)
+ $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
+ gt-alias.h
regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
$(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
$(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(RECOG_H) \
$(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
- varray.h function.h $(TM_P_H)
+ varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h
predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
$(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H) $(PREDICT_H) real.h \
flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
output.h except.h $(TM_P_H)
dependence.o : dependence.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) \
- $(C_COMMON_H) flags.h varray.h $(EXPR_H)
+ $(C_COMMON_H) flags.h varray.h $(EXPR_H) $(GGC_H) gt-dependence.h
params.o : params.c $(CONFIG_H) $(SYSTEM_H) $(PARAMS_H) toplev.h
hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) $(HOOKS_H)
$(SHELL) $(srcdir)/move-if-change tmp-preds.h tm-preds.h
$(STAMP) s-preds
+GTFILES = $(GCONFIG_H) \
+ $(HASHTAB_H) \
+ $(srcdir)/bitmap.h $(srcdir)/function.h $(srcdir)/rtl.h $(srcdir)/optabs.h \
+ $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h $(srcdir)/real.h \
+ $(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h $(srcdir)/cselib.h \
+ $(srcdir)/c-common.h $(srcdir)/c-tree.h \
+ $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c \
+ $(srcdir)/dependence.c $(srcdir)/dwarf2out.c $(srcdir)/emit-rtl.c \
+ $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
+ $(srcdir)/fold-const.c $(srcdir)/function.c \
+ $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
+ $(srcdir)/profile.c $(srcdir)/regclass.c $(srcdir)/reg-stack.c \
+ $(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \
+ $(srcdir)/tree.c $(srcdir)/varasm.c \
+ $(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parse.in \
+ $(out_file) \
+ $(srcdir)/c-decl.c $(srcdir)/c-pragma.c \
+ @all_gtfiles@
+
+gtype-desc.h gtype-desc.c gt-except.h gt-function.h : s-gtype; @true
+gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h gt-emit-rtl.h : s-gtype; @true
+gt-explow.h gt-stor-layout.h gt-regclass.h gt-lists.h : s-gtype; @true
+gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h gt-profile.h : s-gtype; @true
+gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dwarf2out.h : s-gtype ; @true
+gt-reg-stack.h gt-dependence.h : s-gtype ; @true
+gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h : s-gtype; @true
+gt-c-objc-common.h gtype-c.h : s-gtype ; @true
+
+s-gtype: gengtype$(build_exeext) $(GTFILES)
+ ./gengtype $(GTFILES)
+ $(STAMP) s-gtype
+
#\f
# Compile the programs that generate insn-* from the machine description.
# They are compiled with $(HOST_CC), and associated libraries,
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(OUTPUT_OPTION)
genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(HCONFIG_H) \
- $(SYSTEM_H) errors.h varray.h hash.h genattrtab.h
+ $(SYSTEM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genautomata.c $(OUTPUT_OPTION)
genoutput$(build_exeext) : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
genpreds.o : genpreds.c $(RTL_BASE_H) $(HCONFIG_H) $(SYSTEM_H)
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpreds.c $(OUTPUT_OPTION)
+gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
+ $(HOST_LIBDEPS)
+ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
+ gengtype.o gengtype-lex.o gengtype-yacc.o $(HOST_LIBS)
+
+gengtype.o : gengtype.c gengtype.h $(HCONFIG_H) $(SYSTEM_H) real.h
+ $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/gengtype.c $(OUTPUT_OPTION)
+
+gengtype-lex.o : gengtype-lex.c gengtype.h gengtype-yacc.c \
+ $(HCONFIG_H) $(SYSTEM_H)
+ $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/gengtype-lex.c $(OUTPUT_OPTION)
+
+gengtype-yacc.o : gengtype-yacc.c gengtype.h $(HCONFIG_H) $(SYSTEM_H)
+ $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/gengtype-yacc.c $(OUTPUT_OPTION)
+
+$(srcdir)/gengtype-lex.c : $(srcdir)/gengtype-lex.l
+ $(FLEX) $(FLEXFLAGS) -o$@ $(srcdir)/gengtype-lex.l \
+ || ( rm -f $@ && false )
+
+$(srcdir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
+ (cd $(srcdir) && \
+ $(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c gengtype-yacc.y || \
+ ( rm -f $@ && false ) )
+
#\f
# Compile the libraries to be used by gen*.
# If we are not cross-building, gen* use the same .o's that cc1 will use,
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(BUILD_PREFIX)print-rtl.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)print-rtl.c $(OUTPUT_OPTION)
-$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) $(SYSTEM_H) $(RTL_H) \
- flags.h $(BASIC_BLOCK_H) $(REGS_H)
+$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(HCONFIG_H) $(SYSTEM_H) \
+ $(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
rm -f $(BUILD_PREFIX)bitmap.c
sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
doc: $(BUILD_INFO) $(GENERATED_MANPAGES) gccbug
info: $(docdir)/cpp.info $(docdir)/gcc.info $(docdir)/gccint.info lang.info $(docdir)/cppinternals.info
-$(docdir)/cpp.info: $(docdir)/cpp.texi $(docdir)/include/fdl.texi \
+TEXI_CPP_FILES = $(docdir)/cpp.texi $(docdir)/include/fdl.texi \
$(docdir)/cppenv.texi $(docdir)/cppopts.texi
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cpp.info doc/cpp.texi
-$(docdir)/gcc.info: $(docdir)/gcc.texi $(docdir)/include/gcc-common.texi \
+TEXI_GCC_FILES = $(docdir)/gcc.texi $(docdir)/include/gcc-common.texi \
$(docdir)/frontends.texi $(docdir)/standards.texi \
$(docdir)/invoke.texi $(docdir)/extend.texi $(docdir)/md.texi \
$(docdir)/objc.texi $(docdir)/gcov.texi $(docdir)/trouble.texi \
$(docdir)/include/funding.texi $(docdir)/gnu.texi \
$(docdir)/include/gpl.texi $(docdir)/include/fdl.texi \
$(docdir)/contrib.texi $(docdir)/cppenv.texi $(docdir)/cppopts.texi
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gcc.info doc/gcc.texi
-$(docdir)/gccint.info: $(docdir)/gccint.texi \
+TEXI_GCCINT_FILES = $(docdir)/gccint.texi \
$(docdir)/include/gcc-common.texi $(docdir)/contribute.texi \
$(docdir)/makefile.texi $(docdir)/configterms.texi \
$(docdir)/portability.texi $(docdir)/interface.texi \
$(docdir)/headerdirs.texi $(docdir)/include/funding.texi \
$(docdir)/gnu.texi $(docdir)/include/gpl.texi \
$(docdir)/include/fdl.texi $(docdir)/contrib.texi \
- $(docdir)/languages.texi $(docdir)/sourcebuild.texi
+ $(docdir)/languages.texi $(docdir)/sourcebuild.texi \
+ $(docdir)/gty.texi
+
+TEXI_CPPINT_FILES = $(docdir)/cppinternals.texi
+
+$(docdir)/cpp.info: $(TEXI_CPP_FILES)
+ cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cpp.info doc/cpp.texi
+
+$(docdir)/gcc.info: $(TEXI_GCC_FILES)
+ cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gcc.info doc/gcc.texi
+
+$(docdir)/gccint.info: $(TEXI_GCCINT_FILES)
cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/gccint.info doc/gccint.texi
-$(docdir)/cppinternals.info: $(docdir)/cppinternals.texi
+$(docdir)/cppinternals.info: $(TEXI_CPPINT_FILES)
cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -I doc -I doc/include -o doc/cppinternals.info \
doc/cppinternals.texi
dvi: gcc.dvi gccint.dvi cpp.dvi lang.dvi cppinternals.dvi
# This works with GNU Make's default rule.
-cpp.dvi: $(docdir)/cpp.texi $(docdir)/include/fdl.texi \
- $(docdir)/cppenv.texi $(docdir)/cppopts.texi
+cpp.dvi: $(TEXI_CPP_FILES)
$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cpp.texi
-gcc.dvi: $(docdir)/gcc.texi $(docdir)/include/gcc-common.texi \
- $(docdir)/frontends.texi $(docdir)/standards.texi \
- $(docdir)/invoke.texi $(docdir)/extend.texi $(docdir)/md.texi \
- $(docdir)/objc.texi $(docdir)/gcov.texi $(docdir)/trouble.texi \
- $(docdir)/bugreport.texi $(docdir)/service.texi \
- $(docdir)/contribute.texi $(docdir)/vms.texi \
- $(docdir)/include/funding.texi $(docdir)/gnu.texi \
- $(docdir)/include/gpl.texi $(docdir)/include/fdl.texi \
- $(docdir)/contrib.texi $(docdir)/cppenv.texi $(docdir)/cppopts.texi
+gcc.dvi: $(TEXI_GCC_FILES)
$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gcc.texi
-gccint.dvi: $(docdir)/gccint.texi \
- $(docdir)/include/gcc-common.texi $(docdir)/contribute.texi \
- $(docdir)/makefile.texi $(docdir)/configterms.texi \
- $(docdir)/portability.texi $(docdir)/interface.texi \
- $(docdir)/passes.texi $(docdir)/c-tree.texi \
- $(docdir)/rtl.texi $(docdir)/md.texi $(docdir)/tm.texi \
- $(docdir)/hostconfig.texi $(docdir)/fragments.texi \
- $(docdir)/configfiles.texi $(docdir)/collect2.texi \
- $(docdir)/headerdirs.texi $(docdir)/include/funding.texi \
- $(docdir)/gnu.texi $(docdir)/include/gpl.texi \
- $(docdir)/include/fdl.texi $(docdir)/contrib.texi \
- $(docdir)/languages.texi $(docdir)/sourcebuild.texi
+gccint.dvi: $(TEXI_GCCINT_FILES)
$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/gccint.texi
-cppinternals.dvi: $(docdir)/cppinternals.texi
+cppinternals.dvi: $(TEXI_CPPINT_FILES)
$(TEXI2DVI) -I $(docdir) -I $(docdir)/include $(docdir)/cppinternals.texi
generated-manpages: $(docdir)/gcov.1 $(docdir)/cpp.1 $(docdir)/gcc.1 \
+2002-06-03 Geoffrey Keating <geoffk@redhat.com>
+
+ Merge from pch-branch:
+
+ * config-lang.in (gtfiles): Add ada-tree.h.
+ * ada-tree.h (SET_TYPE_CI_CO_LIST): New.
+ (SET_TYPE_MODULUS): New.
+ (SET_TYPE_INDEX): New.
+ (SET_TYPE_DIGITS_VALUE): New.
+ (SET_TYPE_RM_SIZE): New.
+ (SET_TYPE_UNCONSTRAINED_ARRAY): New.
+ (SET_TYPE_ADA_SIZE): New.
+ (SET_TYPE_ACTUAL_BOUNDS): New.
+ (SET_DECL_CONST_CORRESPONDING_VAR): New.
+ (SET_DECL_ORIGINAL_FIELD): New.
+ (TREE_LOOP_ID): Correct typo.
+ * decl.c: Use new macros.
+ * utils.c: Include debug.h, use new macros.
+ * utils2.c: Use new macros.
+
+ * ada-tree.h: Update all macros for new tree description.
+ (struct tree_loop_id): New.
+ (union lang_tree_node): New.
+ (struct lang_decl): New.
+ (struct lang_type): New.
+ * misc.c (gnat_mark_tree): Delete.
+ (LANG_HOOKS_MARK_TREE): Delete.
+ * trans.c (tree_transform): No longer any need to cast
+ for TREE_LOOP_ID.
+
+ * utils.c (struct language_function): New dummy structure.
+
+ * Makefile.in (decl.o): gt-ada-<filename.h> is in objdir, not srcdir.
+ (misc.o): Likewise.
+ (utils.o): Likewise; also gtype-ada.h.
+ * Make-lang.in (gnat1): Add dependency on s-gtype.
+ (gnatbind): Add dependency on $(CONFIG_H).
+ * utils.c: Correct last #include.
+ (stuct e_stack): Remove unnecessary 'static'.
+ (mark_e_stack): Remove unused prototype.
+
+ * scn-nlit.adb: Remove whitespace after version number to
+ keep lines under 80 chars.
+ * snames.adb: Likewise.
+ * treepr.ads: Likewise.
+
+ * Makefile.in (decl.o): Include gt-ada-<filename>.h.
+ (misc.o): Likewise.
+ (utils.o): Include gt-ada-<filename>.h and gtype-ada.h.
+ * config-lang.in (gtfiles): New.
+ * decl.c: Use gengtype for roots.
+ * gigi.h: Use gengtype for roots.
+ * trans.c: Use gengtype for roots.
+ * utils.c: Use gengtype for roots, marking. Include gtype-ada.h.
+
2002-06-02 Gabriel Dos Reis <gdr@codesourcery.com>
* misc.c (gnat_init): Adjust setting of internal_error_function.
$(SYSLIBS)
$(RM) stamp-gnatlib2 stamp-tools
-gnatbind$(exeext): ada/b_gnatb.o $(GNATBIND_OBJS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) \
- $(LIBIBERTY) $(LIBS)
-
# use target-gcc target-gnatmake target-gnatbind target-gnatlink
gnattools: $(GCC_PARTS) $(CONFIG_H) prefix.o force
$(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
# use cross-gcc
gnat-cross: force
$(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) gnat-cross
+
+gt-ada-decl.h gt-ada-trans.h gt-ada-utils.h gtype-ada.h : s-gtype ; @true
+
\f
# Build hooks:
ada/decl.o : ada/decl.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h \
$(srcdir)/toplev.h $(srcdir)/convert.h ada/ada.h ada/types.h ada/atree.h \
ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/snames.h \
- ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
+ ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
+ gt-ada-decl.h
ada/misc.o : ada/misc.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/expr.h \
insn-codes.h insn-flags.h insn-config.h $(srcdir)/recog.h \
ada/trans.o : ada/trans.c $(CONFIG_H) $(TREE_H) $(RTL_H) $(srcdir)/flags.h \
ada/ada.h $(srcdir)/except.h ada/types.h ada/atree.h ada/nlists.h \
ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/namet.h ada/snames.h \
- ada/stringt.h ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
+ ada/stringt.h ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h gt-ada-trans.h
ada/utils.o : ada/utils.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h \
$(srcdir)/expr.h $(srcdir)/convert.h $(srcdir)/defaults.h ada/ada.h \
ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h \
- ada/namet.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
+ ada/namet.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
+ gt-ada-utils.h gtype-ada.h
ada/utils2.o : ada/utils2.c $(CONFIG_H) $(TREE_H) $(srcdir)/flags.h ada/ada.h \
ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h \
};
#undef DEFTREECODE
+/* A tree to hold a loop ID. */
+struct tree_loop_id GTY(())
+{
+ struct tree_common common;
+ struct nesting *loop_id;
+};
+
+/* The language-specific tree. */
+union lang_tree_node
+ GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID")))
+{
+ union tree_node GTY ((tag ("0"),
+ desc ("tree_node_structure (&%h)")))
+ generic;
+ struct tree_loop_id GTY ((tag ("1"))) loop_id;
+};
+
+/* Ada uses the lang_decl and lang_type fields to hold more trees. */
+struct lang_decl GTY(())
+{
+ union lang_tree_node
+ GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) t;
+};
+struct lang_type GTY(())
+{
+ union lang_tree_node
+ GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"))) t;
+};
+
/* Flags added to GCC type nodes. */
/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a
by copy in copy out. It is a CONSTRUCTOR. For a full description of the
cico parameter passing mechanism refer to the routine gnat_to_gnu_entity. */
#define TYPE_CI_CO_LIST(NODE) \
- (tree) TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE))
+ (&TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE))->t.generic)
+#define SET_TYPE_CI_CO_LIST(NODE, X) \
+ (TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
/* For an INTEGER_TYPE with TYPE_MODULAR_P, this is the value of the
modulus. */
#define TYPE_MODULUS(NODE) \
- (tree) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+ (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
+#define SET_TYPE_MODULUS(NODE, X) \
+ (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
/* For an INTEGER_TYPE that is the TYPE_DOMAIN of some ARRAY_TYPE, points to
the type corresponding to the Ada index type. */
#define TYPE_INDEX_TYPE(NODE) \
- (tree) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+ (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
+#define SET_TYPE_INDEX_TYPE(NODE, X) \
+ (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
/* For an INTEGER_TYPE with TYPE_VAX_FLOATING_POINT_P, stores the
Digits_Value. */
#define TYPE_DIGITS_VALUE(NODE) \
- (long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))
+ ((long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)))
+#define SET_TYPE_DIGITS_VALUE(NODE, X) \
+ (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
/* For INTEGER_TYPE, stores the RM_Size of the type. */
#define TYPE_RM_SIZE_INT(NODE) TYPE_VALUES (INTEGER_TYPE_CHECK (NODE))
/* Likewise for ENUMERAL_TYPE. */
#define TYPE_RM_SIZE_ENUM(NODE) \
- (tree) TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE))
+ (&TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE))->t.generic)
+#define SET_TYPE_RM_SIZE_ENUM(NODE, X) \
+ (TYPE_LANG_SPECIFIC (ENUMERAL_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
#define TYPE_RM_SIZE(NODE) \
(TREE_CODE (NODE) == ENUMERAL_TYPE ? TYPE_RM_SIZE_ENUM (NODE) \
unconstrained object. Likewise for a RECORD_TYPE that is pointed
to by a thin pointer. */
#define TYPE_UNCONSTRAINED_ARRAY(NODE) \
- (tree) TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE))
+ (&TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE))->t.generic)
+#define SET_TYPE_UNCONSTRAINED_ARRAY(NODE, X) \
+ (TYPE_LANG_SPECIFIC (RECORD_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
/* For other RECORD_TYPEs and all UNION_TYPEs and QUAL_UNION_TYPEs, the Ada
size of the object. This differs from the GCC size in that it does not
include any rounding up to the alignment of the type. */
-#define TYPE_ADA_SIZE(NODE) (tree) TYPE_LANG_SPECIFIC (NODE)
+#define TYPE_ADA_SIZE(NODE) (&TYPE_LANG_SPECIFIC (NODE)->t.generic)
+#define SET_TYPE_ADA_SIZE(NODE, X) \
+ (TYPE_LANG_SPECIFIC (NODE) = (struct lang_type *)(X))
/* For an INTEGER_TYPE with TYPE_HAS_ACTUAL_BOUNDS_P or an ARRAY_TYPE, this is
the index type that should be used when the actual bounds are required for
a template. This is used in the case of packed arrays. */
-#define TYPE_ACTUAL_BOUNDS(NODE) (tree) TYPE_LANG_SPECIFIC (NODE)
+#define TYPE_ACTUAL_BOUNDS(NODE) (&TYPE_LANG_SPECIFIC (NODE)->t.generic)
+#define SET_TYPE_ACTUAL_BOUNDS(NODE, X) \
+ (TYPE_LANG_SPECIFIC (NODE) = (struct lang_type *)(X))
/* In an UNCONSTRAINED_ARRAY_TYPE, points to the record containing both
the template and object. */
memory. Used when a scalar constant is aliased or has its
address taken. */
#define DECL_CONST_CORRESPONDING_VAR(NODE) \
- (tree) DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE))
+ (&DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE))->t.generic)
+#define SET_DECL_CONST_CORRESPONDING_VAR(NODE, X) \
+ (DECL_LANG_SPECIFIC (CONST_DECL_CHECK (NODE)) = (struct lang_decl *)(X))
/* In a FIELD_DECL, points to the FIELD_DECL that was the ultimate
source of the decl. */
#define DECL_ORIGINAL_FIELD(NODE) \
- (tree) DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))
+ (&DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->t.generic)
+#define SET_DECL_ORIGINAL_FIELD(NODE, X) \
+ (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE)) = (struct lang_decl *)(X))
/* In a FIELD_DECL corresponding to a discriminant, contains the
discriminant number. */
/* This is a horrible kludge to store the loop_id of a loop into a tree
node. We need to find some other place to store it! */
-#define TREE_LOOP_ID(NODE) (TREE_CHECK (NODE, GNAT_LOOP_ID)->real_cst.rtl)
+#define TREE_LOOP_ID(NODE) \
+ (((union lang_tree_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id)
stagestuff="gnatbind\$(exeext) gnat1\$(exeext)"
+gtfiles="\$(srcdir)/ada/ada-tree.h \$(srcdir)/ada/gigi.h \$(srcdir)/ada/decl.c \$(srcdir)/ada/trans.c \$(srcdir)/ada/utils.c"
+
diff_excludes="-x ada/a-einfo.h -x ada/a-sinfo.h -x ada/nmake.adb -x ada/nmake.ads -x ada/treeprs.ads -x ada/sysid.ads"
outputs=ada/Makefile
|| Address_Taken (gnat_entity)
|| Is_Aliased (gnat_entity)
|| Is_Aliased (Etype (gnat_entity))))
- DECL_CONST_CORRESPONDING_VAR (gnu_decl)
- = create_var_decl (gnu_entity_id, gnu_ext_name, gnu_type,
+ SET_DECL_CONST_CORRESPONDING_VAR (gnu_decl,
+ create_var_decl (gnu_entity_id, gnu_ext_name, gnu_type,
gnu_expr, 0, Is_Public (gnat_entity), 0,
- static_p, 0);
+ static_p, 0));
/* If this is declared in a block that contains an block with an
exception handler, we must force this variable in memory to
if (! integer_zerop (gnu_modulus))
{
TYPE_MODULAR_P (gnu_type) = 1;
- TYPE_MODULUS (gnu_type) = gnu_modulus;
+ SET_TYPE_MODULUS (gnu_type, gnu_modulus);
gnu_high = fold (build (MINUS_EXPR, gnu_type, gnu_modulus,
convert (gnu_type, integer_one_node)));
}
gnu_field_type, gnu_type, 1, 0, 0, 1),
finish_record_type (gnu_type, gnu_field, 0, 0);
TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_type) = 1;
- TYPE_ADA_SIZE (gnu_type) = bitsize_int (esize);
+ SET_TYPE_ADA_SIZE (gnu_type, bitsize_int (esize));
}
break;
{
gnu_type = make_signed_type (esize);
TYPE_VAX_FLOATING_POINT_P (gnu_type) = 1;
- TYPE_DIGITS_VALUE (gnu_type)
- = UI_To_Int (Digits_Value (gnat_entity));
+ SET_TYPE_DIGITS_VALUE (gnu_type,
+ UI_To_Int (Digits_Value (gnat_entity)));
break;
}
= TYPE_REFERENCE_TO (gnu_type) = gnu_fat_type;
TYPE_MODE (gnu_type) = BLKmode;
TYPE_ALIGN (gnu_type) = TYPE_ALIGN (tem);
- TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type) = gnu_type;
+ SET_TYPE_UNCONSTRAINED_ARRAY (gnu_fat_type, gnu_type);
/* If the maximum size doesn't overflow, use it. */
if (TREE_CODE (gnu_max_size) == INTEGER_CST
DECL_FIELD_OFFSET (TREE_CHAIN (TYPE_FIELDS (tem))) = size_zero_node;
DECL_FIELD_BIT_OFFSET (TREE_CHAIN (TYPE_FIELDS (tem)))
= bitsize_zero_node;
- TYPE_UNCONSTRAINED_ARRAY (tem) = gnu_type;
+ SET_TYPE_UNCONSTRAINED_ARRAY (tem, gnu_type);
TYPE_OBJECT_RECORD_TYPE (gnu_type) = tem;
/* Give the thin pointer type a name. */
TYPE_HAS_ACTUAL_BOUNDS_P (gnu_inner_type) = 1;
}
- TYPE_ACTUAL_BOUNDS (gnu_inner_type) = NULL_TREE;
+ SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type, NULL_TREE);
for (gnat_index = First_Index (gnat_entity);
Present (gnat_index); gnat_index = Next_Index (gnat_index))
- TYPE_ACTUAL_BOUNDS (gnu_inner_type)
- = tree_cons (NULL_TREE,
+ SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type,
+ tree_cons (NULL_TREE,
get_unpadded_type (Etype (gnat_index)),
- TYPE_ACTUAL_BOUNDS (gnu_inner_type));
+ TYPE_ACTUAL_BOUNDS (gnu_inner_type)));
if (Convention (gnat_entity) != Convention_Fortran)
- TYPE_ACTUAL_BOUNDS (gnu_inner_type)
- = nreverse (TYPE_ACTUAL_BOUNDS (gnu_inner_type));
+ SET_TYPE_ACTUAL_BOUNDS (gnu_inner_type,
+ nreverse (TYPE_ACTUAL_BOUNDS (gnu_inner_type)));
if (TREE_CODE (gnu_type) == RECORD_TYPE
&& TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_type))
DECL_INTERNAL_P (gnu_field)
= DECL_INTERNAL_P (gnu_old_field);
- DECL_ORIGINAL_FIELD (gnu_field)
- = DECL_ORIGINAL_FIELD (gnu_old_field) != 0
- ? DECL_ORIGINAL_FIELD (gnu_old_field) : gnu_old_field;
+ SET_DECL_ORIGINAL_FIELD (gnu_field,
+ (DECL_ORIGINAL_FIELD (gnu_old_field) != 0
+ ? DECL_ORIGINAL_FIELD (gnu_old_field)
+ : gnu_old_field));
DECL_DISCRIMINANT_NUMBER (gnu_field)
= DECL_DISCRIMINANT_NUMBER (gnu_old_field);
TREE_THIS_VOLATILE (gnu_field)
TYPE_ALIGN (gnu_type) = TYPE_ALIGN (gnu_base_type);
TYPE_SIZE (gnu_type) = TYPE_SIZE (gnu_base_type);
TYPE_SIZE_UNIT (gnu_type) = TYPE_SIZE_UNIT (gnu_base_type);
- TYPE_ADA_SIZE (gnu_type) = TYPE_ADA_SIZE (gnu_base_type);
+ SET_TYPE_ADA_SIZE (gnu_type, TYPE_ADA_SIZE (gnu_base_type));
if (TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST
&& contains_placeholder_p (TYPE_SIZE (gnu_type)))
&& contains_placeholder_p (TYPE_ADA_SIZE (gnu_type)))
for (gnu_temp = gnu_subst_list;
gnu_temp; gnu_temp = TREE_CHAIN (gnu_temp))
- TYPE_ADA_SIZE (gnu_type)
- = substitute_in_expr (TYPE_ADA_SIZE (gnu_type),
+ SET_TYPE_ADA_SIZE (gnu_type,
+ substitute_in_expr (TYPE_ADA_SIZE (gnu_type),
TREE_PURPOSE (gnu_temp),
- TREE_VALUE (gnu_temp));
+ TREE_VALUE (gnu_temp)));
/* Recompute the mode of this record type now that we know its
actual size. */
if (gnu_type == 0)
{
gnu_type = make_node (RECORD_TYPE);
- TYPE_UNCONSTRAINED_ARRAY (gnu_type) = gnu_old;
+ SET_TYPE_UNCONSTRAINED_ARRAY (gnu_type, gnu_old);
TYPE_POINTER_TO (gnu_old) = gnu_type;
set_lineno (gnat_entity, 0);
if (TREE_CODE (gnu_type) == RECORD_TYPE
&& operand_equal_p (TYPE_ADA_SIZE (gnu_type),
TYPE_SIZE (gnu_type), 0))
- TYPE_ADA_SIZE (gnu_type) = TYPE_SIZE (gnu_type)
- = elaborate_expression_1 (gnat_entity, gnat_entity,
- TYPE_SIZE (gnu_type),
- get_identifier ("SIZE"),
- definition, 0);
+ {
+ TYPE_SIZE (gnu_type)
+ = elaborate_expression_1 (gnat_entity, gnat_entity,
+ TYPE_SIZE (gnu_type),
+ get_identifier ("SIZE"),
+ definition, 0);
+ SET_TYPE_ADA_SIZE (gnu_type, TYPE_SIZE (gnu_type));
+ }
else
{
TYPE_SIZE (gnu_type)
size_int (TYPE_ALIGN (gnu_type) / BITS_PER_UNIT));
if (TREE_CODE (gnu_type) == RECORD_TYPE)
- TYPE_ADA_SIZE (gnu_type)
- = elaborate_expression_1 (gnat_entity, gnat_entity,
+ SET_TYPE_ADA_SIZE (gnu_type,
+ elaborate_expression_1 (gnat_entity, gnat_entity,
TYPE_ADA_SIZE (gnu_type),
get_identifier ("RM_SIZE"),
- definition, 0);
+ definition, 0));
}
}
/* For the following two functions: for each GNAT entity, the GCC
tree node used as a dummy for that entity, if any. */
-static tree *dummy_node_table;
+static GTY((length ("max_gnat_nodes"))) tree * dummy_node_table;
/* Initialize the above table. */
{
Node_Id gnat_node;
- dummy_node_table = (tree *) xmalloc (max_gnat_nodes * sizeof (tree));
- ggc_add_tree_root (dummy_node_table, max_gnat_nodes);
+ dummy_node_table = (tree *) ggc_alloc (max_gnat_nodes * sizeof (tree));
for (gnat_node = 0; gnat_node < max_gnat_nodes; gnat_node++)
dummy_node_table[gnat_node] = NULL_TREE;
! DECL_NONADDRESSABLE_P (old_field));
DECL_INTERNAL_P (new_field) = DECL_INTERNAL_P (old_field);
- DECL_ORIGINAL_FIELD (new_field)
- = (DECL_ORIGINAL_FIELD (old_field) != 0
- ? DECL_ORIGINAL_FIELD (old_field) : old_field);
+ SET_DECL_ORIGINAL_FIELD (new_field,
+ (DECL_ORIGINAL_FIELD (old_field) != 0
+ ? DECL_ORIGINAL_FIELD (old_field) : old_field));
TREE_CHAIN (new_field) = field_list;
field_list = new_field;
}
/* Keep the RM_Size of the padded record as that of the old record
if requested. */
- TYPE_ADA_SIZE (record) = same_rm_size ? size : rm_size (type);
+ SET_TYPE_ADA_SIZE (record, same_rm_size ? size : rm_size (type));
/* Unless debugging information isn't being written for the input type,
write a record that shows what we are a subtype of and also make a
&& Is_Discrete_Or_Fixed_Point_Type (gnat_entity))
TYPE_RM_SIZE_INT (gnu_type) = size;
else if (TREE_CODE (gnu_type) == ENUMERAL_TYPE)
- TYPE_RM_SIZE_ENUM (gnu_type) = size;
+ SET_TYPE_RM_SIZE_ENUM (gnu_type, size);
else if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
&& ! TYPE_IS_FAT_POINTER_P (gnu_type))
- TYPE_ADA_SIZE (gnu_type) = size;
+ SET_TYPE_ADA_SIZE (gnu_type, size);
}
\f
/* Given a type TYPE, return a new type whose size is appropriate for SIZE.
new = build_range_type (TREE_TYPE (t), low, high);
if (TYPE_INDEX_TYPE (t))
- TYPE_INDEX_TYPE (new)
- = gnat_substitute_in_type (TYPE_INDEX_TYPE (t), f, r);
+ SET_TYPE_INDEX_TYPE (new,
+ gnat_substitute_in_type (TYPE_INDEX_TYPE (t), f, r));
return new;
}
}
DECL_CONTEXT (new_field) = new;
- DECL_ORIGINAL_FIELD (new_field)
- = DECL_ORIGINAL_FIELD (field) != 0
- ? DECL_ORIGINAL_FIELD (field) : field;
+ SET_DECL_ORIGINAL_FIELD (new_field,
+ (DECL_ORIGINAL_FIELD (field) != 0
+ ? DECL_ORIGINAL_FIELD (field) : field));
/* If the size of the old field was set at a constant,
propagate the size in case the type's size was variable.
{
TYPE_SIZE (new) = TYPE_SIZE (t);
TYPE_SIZE_UNIT (new) = TYPE_SIZE_UNIT (t);
- TYPE_ADA_SIZE (new) = TYPE_ADA_SIZE (t);
+ SET_TYPE_ADA_SIZE (new, TYPE_ADA_SIZE (t));
}
return new;
strcpy (Name_Buffer + len, suffix);
return get_identifier (Name_Buffer);
}
+
+#include "gt-ada-decl.h"
/* List of TREE_LIST nodes representing a block stack. TREE_VALUE
of each gives the variable used for the setjmp buffer in the current
block, if any. */
-extern tree gnu_block_stack;
+extern GTY(()) tree gnu_block_stack;
/* This is the main program of the back-end. It sets up all the table
structures and then generates code. */
ADT_raise_nodefer_decl,
ADT_LAST};
-extern tree gnat_std_decls[(int) ADT_LAST];
-extern tree gnat_raise_decls[(int) LAST_REASON_CODE + 1];
+extern GTY(()) tree gnat_std_decls[(int) ADT_LAST];
+extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1];
#define longest_float_type_node gnat_std_decls[(int) ADT_longest_float_type]
#define void_type_decl_node gnat_std_decls[(int) ADT_void_type_decl]
@c o
@c G N A T _ RM o
@c o
-@c $Revision: 1.6 $
+@c $Revision: 1.3.8.1 $
@c o
@c Copyright (C) 1995-2002 Free Software Foundation o
@c o
static tree gnat_eh_runtime_type PARAMS ((tree));
static int gnat_eh_type_covers PARAMS ((tree, tree));
static void gnat_parse_file PARAMS ((int));
-static void gnat_mark_tree PARAMS ((tree));
static rtx gnat_expand_expr PARAMS ((tree, rtx, enum machine_mode,
int));
#define LANG_HOOKS_DECODE_OPTION gnat_decode_option
#undef LANG_HOOKS_PARSE_FILE
#define LANG_HOOKS_PARSE_FILE gnat_parse_file
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE gnat_mark_tree
#undef LANG_HOOKS_HONOR_READONLY
#define LANG_HOOKS_HONOR_READONLY 1
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
gnat_argc = 1;
}
-static void
-gnat_mark_tree (t)
- tree t;
-{
- switch (TREE_CODE (t))
- {
- case FUNCTION_TYPE:
- ggc_mark_tree (TYPE_CI_CO_LIST (t));
- return;
-
- case INTEGER_TYPE:
- if (TYPE_MODULAR_P (t))
- ggc_mark_tree (TYPE_MODULUS (t));
- else if (TYPE_VAX_FLOATING_POINT_P (t))
- ;
- else if (TYPE_HAS_ACTUAL_BOUNDS_P (t))
- ggc_mark_tree (TYPE_ACTUAL_BOUNDS (t));
- else
- ggc_mark_tree (TYPE_INDEX_TYPE (t));
- return;
-
- case ENUMERAL_TYPE:
- ggc_mark_tree (TYPE_RM_SIZE_ENUM (t));
- return;
-
- case ARRAY_TYPE:
- ggc_mark_tree (TYPE_ACTUAL_BOUNDS (t));
- return;
-
- case RECORD_TYPE: case UNION_TYPE: case QUAL_UNION_TYPE:
- /* This is really TYPE_UNCONSTRAINED_ARRAY for fat pointers. */
- ggc_mark_tree (TYPE_ADA_SIZE (t));
- return;
-
- case CONST_DECL:
- ggc_mark_tree (DECL_CONST_CORRESPONDING_VAR (t));
- return;
-
- case FIELD_DECL:
- ggc_mark_tree (DECL_ORIGINAL_FIELD (t));
- return;
-
- default:
- return;
- }
-}
-
/* Here is the function to handle the compiler error processing in GCC. */
static void
-- --
-- B o d y --
-- --
--- $Revision$
-- --
-- Copyright (C) 2001-2002 Free Software Foundation, Inc. --
-- --
-- --
-- S p e c --
-- --
--- $Revision$
-- --
-- Copyright (C) 2001-2002 Free Software Foundation, Inc. --
-- --
-- --
-- B o d y --
-- --
--- $Revision$
-- --
-- Copyright (C) 2001-2002 Free Software Foundation, Inc. --
-- --
-- --
-- S p e c --
-- --
--- $Revision$
-- --
-- Copyright (C) 2001 Free Software Foundation, Inc. --
-- --
variables. TREE_VALUE is the VAR_DECL that stores the address of
the raised exception. Nonzero means we are in an exception
handler. Not used in the zero-cost case. */
-static tree gnu_except_ptr_stack;
+static GTY(()) tree gnu_except_ptr_stack;
/* Map GNAT tree codes to GCC tree codes for simple expressions. */
static enum tree_code gnu_codes[Number_Node_Kinds];
/* Variable that stores a list of labels to be used as a goto target instead of
a return in some functions. See processing for N_Subprogram_Body. */
-static tree gnu_return_label_stack;
+static GTY(()) tree gnu_return_label_stack;
static tree tree_transform PARAMS((Node_Id));
static void elaborate_all_entities PARAMS((Node_Id));
save_gnu_tree (Base_Type (standard_integer),
TYPE_NAME (integer_type_node), 0);
- ggc_add_tree_root (&gnu_block_stack, 1);
- ggc_add_tree_root (&gnu_except_ptr_stack, 1);
- ggc_add_tree_root (&gnu_return_label_stack, 1);
gnu_except_ptr_stack = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
dconstp5 = REAL_VALUE_ATOF ("0.5", DFmode);
{
tree gnu_loop_id = make_node (GNAT_LOOP_ID);
- TREE_LOOP_ID (gnu_loop_id) = (rtx) loop_id;
+ TREE_LOOP_ID (gnu_loop_id) = loop_id;
save_gnu_tree (Entity (Identifier (gnat_node)), gnu_loop_id, 1);
}
if (Present (Name (gnat_node)))
loop_id
- = (struct nesting *)
- TREE_LOOP_ID (get_gnu_tree (Entity (Name (gnat_node))));
+ = TREE_LOOP_ID (get_gnu_tree (Entity (Name (gnat_node))));
if (Present (Condition (gnat_node)))
gnu_cond = invert_truthvalue (gnat_truthvalue_conversion
gnu_codes[N_Op_Shift_Right] = RSHIFT_EXPR;
gnu_codes[N_Op_Shift_Right_Arithmetic] = RSHIFT_EXPR;
}
+
+#include "gt-ada-trans.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
+#include "debug.h"
#include "convert.h"
#include "ada.h"
/* Associates a GNAT tree node to a GCC tree node. It is used in
`save_gnu_tree', `get_gnu_tree' and `present_gnu_tree'. See documentation
of `save_gnu_tree' for more info. */
-static tree *associate_gnat_to_gnu;
+static GTY((length ("max_gnat_nodes"))) tree *associate_gnat_to_gnu;
/* This listhead is used to record any global objects that need elaboration.
TREE_PURPOSE is the variable to be elaborated and TREE_VALUE is the
initial value to assign. */
-static tree pending_elaborations;
+static GTY(()) tree pending_elaborations;
/* This stack allows us to momentarily switch to generating elaboration
lists for an inner context. */
-static struct e_stack {struct e_stack *next; tree elab_list; } *elist_stack;
+struct e_stack GTY(()) {
+ struct e_stack *next;
+ tree elab_list;
+};
+static GTY(()) struct e_stack *elist_stack;
/* This variable keeps a table for types for each precision so that we only
allocate each of them once. Signed and unsigned types are kept separate.
Note that these types are only used when fold-const requests something
special. Perhaps we should NOT share these types; we'll see how it
goes later. */
-static tree signed_and_unsigned_types[2 * MAX_BITS_PER_WORD + 1][2];
+static GTY(()) tree signed_and_unsigned_types[2 * MAX_BITS_PER_WORD + 1][2];
/* Likewise for float types, but record these by mode. */
-static tree float_types[NUM_MACHINE_MODES];
+static GTY(()) tree float_types[NUM_MACHINE_MODES];
/* For each binding contour we allocate a binding_level structure which records
the entities defined or declared in that contour. Contours include:
Binding contours are used to create GCC tree BLOCK nodes. */
-struct binding_level
+struct binding_level GTY(())
{
/* A chain of ..._DECL nodes for all variables, constants, functions,
parameters and type declarations. These ..._DECL nodes are chained
};
/* The binding level currently in effect. */
-static struct binding_level *current_binding_level = NULL;
+static GTY(()) struct binding_level *current_binding_level;
/* A chain of binding_level structures awaiting reuse. */
-static struct binding_level *free_binding_level = NULL;
+static GTY((deletable (""))) struct binding_level *free_binding_level;
/* The outermost binding level. This binding level is created when the
compiler is started and it will exist through the entire compilation. */
/* Binding level structures are initialized by copying this one. */
static struct binding_level clear_binding_level = {NULL, NULL, NULL, NULL};
+struct language_function GTY(())
+{
+ int unused;
+};
+
static tree merge_sizes PARAMS ((tree, tree, tree, int, int));
static tree compute_related_constant PARAMS ((tree, tree));
static tree split_plus PARAMS ((tree, tree *));
static tree convert_to_thin_pointer PARAMS ((tree, tree));
static tree make_descriptor_field PARAMS ((const char *,tree, tree,
tree));
-static void mark_binding_level PARAMS ((PTR));
-static void mark_e_stack PARAMS ((PTR));
\f
/* Initialize the association of GNAT nodes to GCC trees. */
{
Node_Id gnat_node;
- associate_gnat_to_gnu = (tree *) xmalloc (max_gnat_nodes * sizeof (tree));
- ggc_add_tree_root (associate_gnat_to_gnu, max_gnat_nodes);
+ associate_gnat_to_gnu = (tree *) ggc_alloc (max_gnat_nodes * sizeof (tree));
for (gnat_node = 0; gnat_node < max_gnat_nodes; gnat_node++)
associate_gnat_to_gnu[gnat_node] = NULL_TREE;
pending_elaborations = build_tree_list (NULL_TREE, NULL_TREE);
- ggc_add_tree_root (&pending_elaborations, 1);
- ggc_add_root ((PTR) &elist_stack, 1, sizeof (struct e_stack), mark_e_stack);
- ggc_add_tree_root (&signed_and_unsigned_types[0][0],
- (sizeof signed_and_unsigned_types
- / sizeof signed_and_unsigned_types[0][0]));
- ggc_add_tree_root (float_types, ARRAY_SIZE (float_types));
-
- ggc_add_root (¤t_binding_level, 1, sizeof current_binding_level,
- mark_binding_level);
}
/* GNAT_ENTITY is a GNAT tree node for an entity. GNU_DECL is the GCC tree
}
else
newlevel
- = (struct binding_level *) xmalloc (sizeof (struct binding_level));
+ = (struct binding_level *) ggc_alloc (sizeof (struct binding_level));
*newlevel = clear_binding_level;
DECL_FUNCTION_CODE (setjmp_decl) = BUILT_IN_SETJMP;
main_identifier_node = get_identifier ("main");
-
- ggc_add_tree_root (gnat_std_decls, ARRAY_SIZE (gnat_std_decls));
- ggc_add_tree_root (gnat_raise_decls, ARRAY_SIZE (gnat_raise_decls));
}
\f
/* This function is called indirectly from toplev.c to handle incomplete
/* Now set any of the values we've just computed that apply. */
if (! TYPE_IS_FAT_POINTER_P (record_type)
&& ! TYPE_CONTAINS_TEMPLATE_P (record_type))
- TYPE_ADA_SIZE (record_type) = ada_size;
+ SET_TYPE_ADA_SIZE (record_type, ada_size);
#ifdef ROUND_TYPE_SIZE
size = ROUND_TYPE_SIZE (record_type, size, TYPE_ALIGN (record_type));
|| TYPE_RETURNS_BY_REF_P (type) != returns_by_ref)
type = copy_type (type);
- TYPE_CI_CO_LIST (type) = cico_list;
+ SET_TYPE_CI_CO_LIST (type, cico_list);
TYPE_RETURNS_UNCONSTRAINED_P (type) = returns_unconstrained;
TYPE_RETURNS_STACK_DEPRESSED (type) = returns_with_dsp;
TYPE_RETURNS_BY_REF_P (type) = returns_by_ref;
else if (TYPE_INDEX_TYPE (type) != 0)
type = copy_type (type);
- TYPE_INDEX_TYPE (type) = index;
+ SET_TYPE_INDEX_TYPE (type, index);
return type;
}
\f
return result;
}
-/* Mark the binding level stack. */
-
-static void
-mark_binding_level (arg)
- PTR arg;
-{
- struct binding_level *level = *(struct binding_level **) arg;
-
- for (; level != 0; level = level->level_chain)
- {
- ggc_mark_tree (level->names);
- ggc_mark_tree (level->blocks);
- ggc_mark_tree (level->this_block);
- }
-}
-
-/* Mark the pending elaboration list. */
-
-static void
-mark_e_stack (data)
- PTR data;
-{
- struct e_stack *p = *((struct e_stack **) data);
-
- if (p != 0)
- {
- ggc_mark_tree (p->elab_list);
- mark_e_stack (&p->next);
- }
-}
-
/* Return nonzero if there are pending elaborations. */
int
void
push_pending_elaborations ()
{
- struct e_stack *p = (struct e_stack *) xmalloc (sizeof (struct e_stack));
+ struct e_stack *p = (struct e_stack *) ggc_alloc (sizeof (struct e_stack));
p->next = elist_stack;
p->elab_list = pending_elaborations;
pending_elaborations = p->elab_list;
elist_stack = p->next;
- free (p);
}
/* Return the current position in pending_elaborations so we can insert
TREE_CHAIN (TYPE_FIELDS (ptr)), new_ref));
for (var = TYPE_MAIN_VARIANT (ptr); var; var = TYPE_NEXT_VARIANT (var))
- TYPE_UNCONSTRAINED_ARRAY (var) = new_type;
+ SET_TYPE_UNCONSTRAINED_ARRAY (var, new_type);
TYPE_POINTER_TO (new_type) = TYPE_REFERENCE_TO (new_type)
= TREE_TYPE (new_type) = ptr;
return expr;
}
+
+#include "gt-ada-utils.h"
+#include "gtype-ada.h"
/* Copy the node so we ensure it can be modified to make it modular. */
op_type = copy_node (gnat_type_for_size (precision, unsignedp));
modulus = convert (op_type, modulus);
- TYPE_MODULUS (op_type) = modulus;
+ SET_TYPE_MODULUS (op_type, modulus);
TYPE_MODULAR_P (op_type) = 1;
lhs = convert (op_type, lhs);
rhs = convert (op_type, rhs);
{
tree div_type = copy_node (gnat_type_for_size (needed_precision, 1));
modulus = convert (div_type, modulus);
- TYPE_MODULUS (div_type) = modulus;
+ SET_TYPE_MODULUS (div_type, modulus);
TYPE_MODULAR_P (div_type) = 1;
result = convert (op_type,
fold (build (TRUNC_MOD_EXPR, div_type,
current function performs nonlocal memory memory references for the
purposes of marking the function as a constant function. */
-static rtx *reg_base_value;
+static GTY((length ("reg_base_value_size"))) rtx *reg_base_value;
static rtx *new_reg_base_value;
static unsigned int reg_base_value_size; /* size of reg_base_value array */
optimization. Loop unrolling can create a large number of
registers. */
reg_base_value_size = maxreg * 2;
- reg_base_value = (rtx *) xcalloc (reg_base_value_size, sizeof (rtx));
- ggc_add_rtx_root (reg_base_value, reg_base_value_size);
+ reg_base_value = (rtx *) ggc_alloc_cleared (reg_base_value_size
+ * sizeof (rtx));
new_reg_base_value = (rtx *) xmalloc (reg_base_value_size * sizeof (rtx));
reg_seen = (char *) xmalloc (reg_base_value_size);
reg_known_value_size = 0;
free (reg_known_equiv_p + FIRST_PSEUDO_REGISTER);
reg_known_equiv_p = 0;
- if (reg_base_value)
- {
- ggc_del_root (reg_base_value);
- free (reg_base_value);
- reg_base_value = 0;
- }
+ reg_base_value = 0;
reg_base_value_size = 0;
if (alias_invariant)
{
alias_invariant = 0;
}
}
+
+#include "gt-alias.h"
typedef bitmap regset;
/* Initialize a new regset. */
-#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD)
+#define INIT_REG_SET(HEAD) bitmap_initialize (HEAD, 1)
/* Clear a register set by freeing up the linked list. */
#define CLEAR_REG_SET(HEAD) bitmap_clear (HEAD)
#define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
/* Initialize a register set. Returns the new register set. */
-#define INITIALIZE_REG_SET(HEAD) bitmap_initialize (&HEAD)
+#define INITIALIZE_REG_SET(HEAD) bitmap_initialize (&HEAD, 1)
/* Do any cleanup needed on a regset when it is no longer used. */
#define FREE_REG_SET(REGSET) BITMAP_FREE(REGSET)
#include "rtl.h"
#include "flags.h"
#include "obstack.h"
+#include "ggc.h"
#include "bitmap.h"
/* Obstack to allocate bitmap elements from. */
/* Global data */
bitmap_element bitmap_zero_bits; /* An element of all zero bits. */
static bitmap_element *bitmap_free; /* Freelist of bitmap elements. */
+static GTY((deletable (""))) bitmap_element *bitmap_ggc_free;
+static void bitmap_elem_to_freelist PARAMS ((bitmap, bitmap_element *));
static void bitmap_element_free PARAMS ((bitmap, bitmap_element *));
-static bitmap_element *bitmap_element_allocate PARAMS ((void));
+static bitmap_element *bitmap_element_allocate PARAMS ((bitmap));
static int bitmap_element_zerop PARAMS ((bitmap_element *));
static void bitmap_element_link PARAMS ((bitmap, bitmap_element *));
static bitmap_element *bitmap_find_bit PARAMS ((bitmap, unsigned int));
\f
+/* Add ELEM to the appropriate freelist. */
+static INLINE void
+bitmap_elem_to_freelist (head, elt)
+ bitmap head;
+ bitmap_element *elt;
+{
+ if (head->using_obstack)
+ {
+ elt->next = bitmap_free;
+ bitmap_free = elt;
+ }
+ else
+ {
+ elt->next = bitmap_ggc_free;
+ bitmap_ggc_free = elt;
+ }
+}
+
/* Free a bitmap element. Since these are allocated off the
bitmap_obstack, "free" actually means "put onto the freelist". */
if (head->current)
head->indx = head->current->indx;
}
-
- elt->next = bitmap_free;
- bitmap_free = elt;
+ bitmap_elem_to_freelist (head, elt);
}
\f
/* Allocate a bitmap element. The bits are cleared, but nothing else is. */
static INLINE bitmap_element *
-bitmap_element_allocate ()
+bitmap_element_allocate (head)
+ bitmap head;
{
bitmap_element *element;
- if (bitmap_free != 0)
- {
- element = bitmap_free;
- bitmap_free = element->next;
- }
- else
+ if (head->using_obstack)
{
- /* We can't use gcc_obstack_init to initialize the obstack since
- print-rtl.c now calls bitmap functions, and bitmap is linked
- into the gen* functions. */
- if (!bitmap_obstack_init)
+ if (bitmap_free != 0)
{
- bitmap_obstack_init = TRUE;
-
- /* Let particular systems override the size of a chunk. */
+ element = bitmap_free;
+ bitmap_free = element->next;
+ }
+ else
+ {
+ /* We can't use gcc_obstack_init to initialize the obstack since
+ print-rtl.c now calls bitmap functions, and bitmap is linked
+ into the gen* functions. */
+ if (!bitmap_obstack_init)
+ {
+ bitmap_obstack_init = TRUE;
+
+ /* Let particular systems override the size of a chunk. */
#ifndef OBSTACK_CHUNK_SIZE
#define OBSTACK_CHUNK_SIZE 0
#endif
- /* Let them override the alloc and free routines too. */
+ /* Let them override the alloc and free routines too. */
#ifndef OBSTACK_CHUNK_ALLOC
#define OBSTACK_CHUNK_ALLOC xmalloc
#endif
#ifndef OBSTACK_CHUNK_FREE
#define OBSTACK_CHUNK_FREE free
#endif
-
+
#if !defined(__GNUC__) || (__GNUC__ < 2)
#define __alignof__(type) 0
#endif
-
- obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
- __alignof__ (bitmap_element),
- (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
- (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
+
+ obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
+ __alignof__ (bitmap_element),
+ (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
+ (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
+ }
+
+ element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
+ sizeof (bitmap_element));
}
-
- element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
- sizeof (bitmap_element));
+ }
+ else
+ {
+ if (bitmap_ggc_free != NULL)
+ {
+ element = bitmap_ggc_free;
+ bitmap_ggc_free = element->next;
+ }
+ else
+ element = ggc_alloc (sizeof (bitmap_element));
}
memset (element->bits, 0, sizeof (element->bits));
for (element = head->first; element != 0; element = next)
{
next = element->next;
- element->next = bitmap_free;
- bitmap_free = element;
+ bitmap_elem_to_freelist (head, element);
}
head->first = head->current = 0;
/* Copy elements in forward direction one at a time */
for (from_ptr = from->first; from_ptr; from_ptr = from_ptr->next)
{
- bitmap_element *to_elt = bitmap_element_allocate ();
+ bitmap_element *to_elt = bitmap_element_allocate (to);
to_elt->indx = from_ptr->indx;
if (ptr == 0)
{
- ptr = bitmap_element_allocate ();
+ ptr = bitmap_element_allocate (head);
ptr->indx = bit / BITMAP_ELEMENT_ALL_BITS;
ptr->bits[word_num] = bit_val;
bitmap_element_link (head, ptr);
changed = 1;
to_tmp = to_ptr;
to_ptr = to_ptr->next;
- to_tmp->next = bitmap_free;
- bitmap_free = to_tmp;
+ bitmap_elem_to_freelist (to, to_tmp);
}
if (to_ptr && to_ptr->indx == indx)
{
to_ptr = to_ptr->next;
}
else
- to_tmp = bitmap_element_allocate ();
+ to_tmp = bitmap_element_allocate (to);
/* Do the operation, and if any bits are set, link it into the
linked list. */
}
else
{
- to_tmp->next = bitmap_free;
- bitmap_free = to_tmp;
+ bitmap_elem_to_freelist (to, to_tmp);
}
}
changed = 1;
for (to_tmp = to_ptr; to_tmp->next ; to_tmp = to_tmp->next)
continue;
- to_tmp->next = bitmap_free;
- bitmap_free = to_ptr;
+ if (to->using_obstack)
+ {
+ to_tmp->next = bitmap_free;
+ bitmap_free = to_ptr;
+ }
+ else
+ {
+ to_tmp->next = bitmap_ggc_free;
+ bitmap_ggc_free = to_ptr;
+ }
}
#undef DOIT
/* Initialize a bitmap header. */
bitmap
-bitmap_initialize (head)
+bitmap_initialize (head, using_obstack)
bitmap head;
+ int using_obstack;
{
+ if (head == NULL && ! using_obstack)
+ head = ggc_alloc (sizeof (*head));
+
head->first = head->current = 0;
+ head->using_obstack = using_obstack;
return head;
}
});
fputs (suffix, file);
}
+
+#include "gt-bitmap.h"
having to realloc and copy a giant bit array. The `prev' field is
undefined for an element on the free list. */
-typedef struct bitmap_element_def
+typedef struct bitmap_element_def GTY(())
{
struct bitmap_element_def *next; /* Next element. */
struct bitmap_element_def *prev; /* Previous element. */
} bitmap_element;
/* Head of bitmap linked list. */
-typedef struct bitmap_head_def {
+typedef struct bitmap_head_def GTY(()) {
bitmap_element *first; /* First element in linked list. */
bitmap_element *current; /* Last element looked at. */
unsigned int indx; /* Index of last element looked at. */
-
-} bitmap_head, *bitmap;
+ int using_obstack; /* Are we using an obstack or ggc for
+ allocation? */
+} bitmap_head;
+typedef struct bitmap_head_def *bitmap;
/* Enumeration giving the various operations we support. */
enum bitmap_bits {
/* Print a bitmap */
extern void bitmap_print PARAMS ((FILE *, bitmap, const char *, const char *));
-/* Initialize a bitmap header. */
-extern bitmap bitmap_initialize PARAMS ((bitmap));
+/* Initialize a bitmap header. If HEAD is NULL, a new header will be
+ allocated. USING_OBSTACK indicates how elements should be allocated. */
+extern bitmap bitmap_initialize PARAMS ((bitmap head,
+ int using_obstack));
-/* Release all memory held by bitmaps. */
+/* Release all memory used by the bitmap obstack. */
extern void bitmap_release_memory PARAMS ((void));
/* A few compatibility/functions macros for compatibility with sbitmaps */
/* Allocate a bitmap with oballoc. */
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \
- bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)))
-
-/* Allocate a bitmap with alloca. Note alloca cannot be passed as an
- argument to a function, so we set a temporary variable to the value
- returned by alloca and pass that variable to bitmap_initialize().
- PTR is then set to the value returned from bitmap_initialize() to
- avoid having it appear more than once in case it has side effects. */
-#define BITMAP_ALLOCA(PTR) \
-do { \
- bitmap temp_bitmap_ = (bitmap) alloca (sizeof (bitmap_head)); \
- (PTR) = bitmap_initialize (temp_bitmap_); \
-} while (0)
+ bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
+
+/* Allocate a bitmap with ggc_alloc. */
+#define BITMAP_GGC_ALLOC() \
+ bitmap_initialize (NULL, 0)
/* Allocate a bitmap with xmalloc. */
#define BITMAP_XMALLOC() \
- bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)))
+ bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)), 1)
/* Do any cleanup needed on a bitmap when it is no longer used. */
#define BITMAP_FREE(BITMAP) \
return result;
}
-/* Mark P (a stmt_tree) for GC. The use of a `void *' for the
- parameter allows this function to be used as a GC-marking
- function. */
-
-void
-mark_stmt_tree (p)
- void *p;
-{
- stmt_tree st = (stmt_tree) p;
-
- ggc_mark_tree (st->x_last_stmt);
- ggc_mark_tree (st->x_last_expr_type);
-}
-
-/* Mark LD for GC. */
-
-void
-c_mark_lang_decl (c)
- struct c_lang_decl *c ATTRIBUTE_UNUSED;
-{
-}
-
-/* Mark F for GC. */
-
-void
-mark_c_language_function (f)
- struct language_function *f;
-{
- if (!f)
- return;
-
- mark_stmt_tree (&f->x_stmt_tree);
- ggc_mark_tree (f->x_scope_stmt_stack);
-}
-
/* Hook used by expand_expr to expand language-specific tree codes. */
rtx
ATTR_LAST
};
-static tree built_in_attributes[(int) ATTR_LAST];
+static GTY(()) tree built_in_attributes[(int) ATTR_LAST];
static bool c_attrs_initialized = false;
#undef DEF_ATTR_IDENT
#undef DEF_ATTR_TREE_LIST
#undef DEF_FN_ATTR
- ggc_add_tree_root (built_in_attributes, (int) ATTR_LAST);
c_attrs_initialized = true;
}
(*callback) (ctx, param, param_num);
}
+
+#include "gt-c-common.h"
/* Identifier part common to the C front ends. Inherits from
tree_identifier, despite appearances. */
-struct c_common_identifier
+struct c_common_identifier GTY(())
{
struct tree_common common;
- struct cpp_hashnode node;
+ struct cpp_hashnode GTY ((skip (""))) node;
};
#define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
/* A node for `((void) 0)'. */
#define void_zero_node c_global_trees[CTI_VOID_ZERO]
-extern tree c_global_trees[CTI_MAX];
+extern GTY(()) tree c_global_trees[CTI_MAX];
/* Mark which labels are explicitly declared.
These may be shadowed, and may be referenced from nested functions. */
/* Information about a statement tree. */
-struct stmt_tree_s {
+struct stmt_tree_s GTY(()) {
/* The last statement added to the tree. */
tree x_last_stmt;
/* The type of the last expression statement. (This information is
/* Global state pertinent to the current function. Some C dialects
extend this structure with additional fields. */
-struct language_function {
+struct c_language_function GTY(()) {
/* While we are parsing the function, this contains information
about the statement-tree that we are building. */
struct stmt_tree_s x_stmt_tree;
void *));
extern void prep_stmt PARAMS ((tree));
extern void expand_stmt PARAMS ((tree));
-extern void mark_stmt_tree PARAMS ((void *));
extern void shadow_warning PARAMS ((const char *,
tree, tree));
extern tree c_begin_if_stmt PARAMS ((void));
structure for FUNCTION_DECLs; all other DECLs have a NULL
DECL_LANG_SPECIFIC field. */
-struct c_lang_decl {
+struct c_lang_decl GTY(()) {
unsigned declared_inline : 1;
};
#define DECL_NUM_STMTS(NODE) \
(FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
-extern void c_mark_lang_decl PARAMS ((struct c_lang_decl *));
-
/* The variant of the C language being processed. Each C language
front-end defines this variable. */
after entering or leaving a header file. */
extern void extract_interface_info PARAMS ((void));
-extern void mark_c_language_function PARAMS ((struct language_function *));
-
extern int case_compare PARAMS ((splay_tree_key,
splay_tree_key));
/* The current statement tree. */
-static struct stmt_tree_s c_stmt_tree;
+static GTY(()) struct stmt_tree_s c_stmt_tree;
/* The current scope statement stack. */
-static tree c_scope_stmt_stack;
+static GTY(()) tree c_scope_stmt_stack;
/* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
that have names. Here so we can clear out their names' definitions
at the end of the function. */
-static tree named_labels;
+static GTY(()) tree named_labels;
/* A list of LABEL_DECLs from outer contexts that are currently shadowed. */
-static tree shadowed_labels;
+static GTY(()) tree shadowed_labels;
/* Nonzero when store_parm_decls is called indicates a varargs function.
Value not meaningful after store_parm_decls. */
/* Note that the information in the `names' component of the global contour
is duplicated in the IDENTIFIER_GLOBAL_VALUEs of all identifiers. */
-struct binding_level
+struct binding_level GTY(())
{
/* A chain of _DECL nodes for all variables, constants, functions,
and typedef types. These are in the reverse of the order supplied.
/* The binding level currently in effect. */
-static struct binding_level *current_binding_level;
+static GTY(()) struct binding_level *current_binding_level;
/* A chain of binding_level structures awaiting reuse. */
-static struct binding_level *free_binding_level;
+static GTY((deletable (""))) struct binding_level *free_binding_level;
/* The outermost binding level, for names of file scope.
This is created when the compiler is started and exists
through the entire run. */
-static struct binding_level *global_binding_level;
+static GTY(()) struct binding_level *global_binding_level;
/* Binding level structures are initialized by copying this one. */
saved values of named_labels and shadowed_labels for
a label binding level outside the current one. */
-static struct binding_level *label_level_chain;
+static GTY(()) struct binding_level *label_level_chain;
/* Functions called automatically at the beginning and end of execution. */
/* Forward declarations. */
static struct binding_level * make_binding_level PARAMS ((void));
-static void mark_binding_level PARAMS ((void *));
+static void pop_binding_level PARAMS ((struct binding_level **));
static void clear_limbo_values PARAMS ((tree));
static int duplicate_decls PARAMS ((tree, tree, int));
static int redeclaration_error_message PARAMS ((tree, tree));
}
}
\f
-/* Create a new `struct binding_level'. */
+/* Reuse or create a struct for this binding level. */
static struct binding_level *
make_binding_level ()
{
- /* NOSTRICT */
- return (struct binding_level *) xmalloc (sizeof (struct binding_level));
+ if (free_binding_level)
+ {
+ struct binding_level *result = free_binding_level;
+ free_binding_level = result->level_chain;
+ return result;
+ }
+ else
+ return (struct binding_level *) ggc_alloc (sizeof (struct binding_level));
+}
+
+/* Remove a binding level from a list and add it to the level chain. */
+
+static void
+pop_binding_level (lp)
+ struct binding_level **lp;
+{
+ struct binding_level *l = *lp;
+ *lp = l->level_chain;
+
+ memset (l, 0, sizeof (struct binding_level));
+ l->level_chain = free_binding_level;
+ free_binding_level = l;
}
/* Nonzero if we are currently in the global binding level. */
named_labels = 0;
}
- /* Reuse or create a struct for this binding level. */
-
- if (free_binding_level)
- {
- newlevel = free_binding_level;
- free_binding_level = free_binding_level->level_chain;
- }
- else
- {
- newlevel = make_binding_level ();
- }
+ newlevel = make_binding_level ();
/* Add this level to the front of the chain (stack) of levels that
are active. */
/* Pop the current level, and free the structure for reuse. */
- {
- struct binding_level *level = current_binding_level;
- current_binding_level = current_binding_level->level_chain;
-
- level->level_chain = free_binding_level;
- free_binding_level = level;
- }
+ pop_binding_level (¤t_binding_level);
/* Dispose of the block that we just made inside some higher level. */
if (functionbody)
{
struct binding_level *newlevel;
- /* Reuse or create a struct for this binding level. */
-
- if (free_binding_level)
- {
- newlevel = free_binding_level;
- free_binding_level = free_binding_level->level_chain;
- }
- else
- {
- newlevel = make_binding_level ();
- }
+ newlevel = make_binding_level ();
/* Add this level to the front of the chain (stack) of label levels. */
shadowed_labels = level->shadowed;
/* Pop the current level, and free the structure for reuse. */
- label_level_chain = label_level_chain->level_chain;
- level->level_chain = free_binding_level;
- free_binding_level = level;
+ pop_binding_level (&label_level_chain);
}
\f
/* Push a definition or a declaration of struct, union or enum tag "name".
return t;
}
\f
-/* Mark ARG for GC. */
-
-static void
-mark_binding_level (arg)
- void *arg;
-{
- struct binding_level *level = *(struct binding_level **) arg;
-
- for (; level != 0; level = level->level_chain)
- {
- ggc_mark_tree (level->names);
- ggc_mark_tree (level->tags);
- ggc_mark_tree (level->shadowed);
- ggc_mark_tree (level->blocks);
- ggc_mark_tree (level->this_block);
- ggc_mark_tree (level->parm_order);
- ggc_mark_tree (level->incomplete_list);
- }
-}
-
/* Create the predefined scalar types of C,
and some nodes representing standard constants (0, 1, (void *) 0).
Initialize the global binding level.
make_fname_decl = c_make_fname_decl;
start_fname_decls ();
-
- /* Record our roots. */
-
- ggc_add_tree_root (c_global_trees, CTI_MAX);
- ggc_add_root (&c_stmt_tree, 1, sizeof c_stmt_tree, mark_stmt_tree);
- ggc_add_tree_root (&c_scope_stmt_stack, 1);
- ggc_add_tree_root (&named_labels, 1);
- ggc_add_tree_root (&shadowed_labels, 1);
- ggc_add_root (¤t_binding_level, 1, sizeof current_binding_level,
- mark_binding_level);
- ggc_add_root (&label_level_chain, 1, sizeof label_level_chain,
- mark_binding_level);
- ggc_add_tree_root (&static_ctors, 1);
- ggc_add_tree_root (&static_dtors, 1);
}
/* Create the VAR_DECL for __FUNCTION__ etc. ID is the name to give the
that keep track of the progress of compilation of the current function.
Used for nested functions. */
-struct c_language_function
+struct language_function GTY(())
{
- struct language_function base;
+ struct c_language_function base;
tree named_labels;
tree shadowed_labels;
int returns_value;
c_push_function_context (f)
struct function *f;
{
- struct c_language_function *p;
- p = ((struct c_language_function *)
- xmalloc (sizeof (struct c_language_function)));
- f->language = (struct language_function *) p;
+ struct language_function *p;
+ p = ((struct language_function *)
+ ggc_alloc (sizeof (struct language_function)));
+ f->language = p;
p->base.x_stmt_tree = c_stmt_tree;
p->base.x_scope_stmt_stack = c_scope_stmt_stack;
c_pop_function_context (f)
struct function *f;
{
- struct c_language_function *p
- = (struct c_language_function *) f->language;
+ struct language_function *p = f->language;
tree link;
/* Bring back all the labels that were shadowed. */
current_extern_inline = p->extern_inline;
current_binding_level = p->binding_level;
- free (p);
- f->language = 0;
-}
-
-/* Mark the language specific parts of F for GC. */
-
-void
-c_mark_function_context (f)
- struct function *f;
-{
- struct c_language_function *p
- = (struct c_language_function *) f->language;
-
- if (p == 0)
- return;
-
- mark_c_language_function (&p->base);
- ggc_mark_tree (p->shadowed_labels);
- ggc_mark_tree (p->named_labels);
- mark_binding_level (&p->binding_level);
+ f->language = NULL;
}
/* Copy the DECL_LANG_SPECIFIC data associated with DECL. */
DECL_LANG_SPECIFIC (decl) = ld;
}
-/* Mark the language specific bits in T for GC. */
-
-void
-c_mark_tree (t)
- tree t;
-{
- if (TREE_CODE (t) == IDENTIFIER_NODE)
- {
- struct lang_identifier *i = (struct lang_identifier *) t;
- ggc_mark_tree (i->global_value);
- ggc_mark_tree (i->local_value);
- ggc_mark_tree (i->label_value);
- ggc_mark_tree (i->implicit_decl);
- ggc_mark_tree (i->error_locus);
- ggc_mark_tree (i->limbo_value);
- }
- else if (TYPE_P (t) && TYPE_LANG_SPECIFIC (t))
- ggc_mark (TYPE_LANG_SPECIFIC (t));
- else if (DECL_P (t) && DECL_LANG_SPECIFIC (t))
- {
- ggc_mark (DECL_LANG_SPECIFIC (t));
- c_mark_lang_decl (&DECL_LANG_SPECIFIC (t)->base);
- ggc_mark_tree (DECL_LANG_SPECIFIC (t)->pending_sizes);
- }
-}
-
/* The functions below are required for functionality of doing
function at once processing in the C front end. Currently these
functions are not called from anywhere in the C front end, but as
itarget = tree_cons (attrs, target, NULL_TREE);
return build1 (INDIRECT_REF, quals, itarget);
}
+
+#include "gt-c-decl.h"
#include "tree.h"
#include "c-tree.h"
#include "c-common.h"
+#include "ggc.h"
#include "langhooks.h"
#include "langhooks-def.h"
#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
#undef LANG_HOOKS_SAFE_FROM_P
#define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE c_mark_tree
#undef LANG_HOOKS_EXPAND_EXPR
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
#undef LANG_HOOKS_MARK_ADDRESSABLE
#define LANG_HOOKS_FUNCTION_ENTER_NESTED c_push_function_context
#undef LANG_HOOKS_FUNCTION_LEAVE_NESTED
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context
-#undef LANG_HOOKS_FUNCTION_MARK
-#define LANG_HOOKS_FUNCTION_MARK c_mark_function_context
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
{
c_objc_common_finish_file ();
}
+
+#include "gtype-c.h"
static tree start_cdtor PARAMS ((int));
static void finish_cdtor PARAMS ((tree));
-static varray_type deferred_fns;
+static GTY(()) varray_type deferred_fns;
int
c_missing_noreturn_ok_p (decl)
}
VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns");
- ggc_add_tree_varray_root (&deferred_fns, 1);
return filename;
}
}
}
- VARRAY_FREE (deferred_fns);
+ deferred_fns = 0;
}
static tree
return 0;
}
}
+
+#include "gt-c-objc-common.h"
static int if_stmt_line;
/* List of types and structure classes of the current declaration. */
-static tree current_declspecs = NULL_TREE;
-static tree prefix_attributes = NULL_TREE;
+static GTY(()) tree current_declspecs;
+static GTY(()) tree prefix_attributes;
/* List of all the attributes applying to the identifier currently being
declared; includes prefix_attributes and possibly some more attributes
just after a comma. */
-static tree all_prefix_attributes = NULL_TREE;
+static GTY(()) tree all_prefix_attributes;
/* Stack of saved values of current_declspecs, prefix_attributes and
all_prefix_attributes. */
-static tree declspec_stack;
+static GTY(()) tree declspec_stack;
/* PUSH_DECLSPEC_STACK is called from setspecs; POP_DECLSPEC_STACK
should be called from the productions making use of setspecs. */
static int yylex PARAMS ((void));
static void init_reswords PARAMS ((void));
-/* Add GC roots for variables local to this file. */
+ /* Initialisation routine for this file. */
void
c_parse_init ()
{
init_reswords ();
-
- ggc_add_tree_root (&declspec_stack, 1);
- ggc_add_tree_root (¤t_declspecs, 1);
- ggc_add_tree_root (&prefix_attributes, 1);
- ggc_add_tree_root (&all_prefix_attributes, 1);
}
%}
|| (next_type == CPP_NAME && yylexname () == STRING));
yylval.ttype = combine_strings (strings);
-
- VARRAY_FREE (strings);
}
else
yylval.ttype = orig;
free (malloced_yyvs);
}
}
+
+#include "gt-c-parse.h"
#define GCC_BAD(msgid) do { warning (msgid); return; } while (0)
#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
-#ifdef HANDLE_PRAGMA_PACK
-static void handle_pragma_pack PARAMS ((cpp_reader *));
-
-#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
-typedef struct align_stack
+typedef struct align_stack GTY(())
{
int alignment;
unsigned int num_pushes;
struct align_stack * prev;
} align_stack;
-static struct align_stack * alignment_stack = NULL;
+static GTY(()) struct align_stack * alignment_stack;
+
+#ifdef HANDLE_PRAGMA_PACK
+static void handle_pragma_pack PARAMS ((cpp_reader *));
+#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
/* If we have a "global" #pragma pack(<n>) in effect when the first
#pragma pack(push,<n>) is encountered, this stores the value of
maximum_field_alignment in effect. When the final pop_alignment()
static void push_alignment PARAMS ((int, tree));
static void pop_alignment PARAMS ((tree));
-static void mark_align_stack PARAMS ((void *));
/* Push an alignment value onto the stack. */
static void
{
align_stack * entry;
- entry = (align_stack *) xmalloc (sizeof (* entry));
+ entry = (align_stack *) ggc_alloc (sizeof (* entry));
entry->alignment = alignment;
entry->num_pushes = 1;
else
maximum_field_alignment = entry->alignment;
- free (alignment_stack);
-
alignment_stack = entry;
}
}
-
-static void
-mark_align_stack (p)
- void *p;
-{
- align_stack *a = *(align_stack **) p;
-
- while (a)
- {
- ggc_mark_tree (a->id);
- a = a->prev;
- }
-}
#else /* not HANDLE_PRAGMA_PACK_PUSH_POP */
#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
#define push_alignment(ID, N) \
}
#endif /* HANDLE_PRAGMA_PACK */
+static GTY(()) tree pending_weaks;
+
#ifdef HANDLE_PRAGMA_WEAK
static void apply_pragma_weak PARAMS ((tree, tree));
static void handle_pragma_weak PARAMS ((cpp_reader *));
-static tree pending_weaks;
-
static void
apply_pragma_weak (decl, value)
tree decl, value;
}
#endif /* HANDLE_PRAGMA_WEAK */
+static GTY(()) tree pending_redefine_extname;
+
#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME
static void handle_pragma_redefine_extname PARAMS ((cpp_reader *));
-static tree pending_redefine_extname;
-
/* #pragma redefined_extname oldname newname */
static void
handle_pragma_redefine_extname (dummy)
}
#endif
+static GTY(()) tree pragma_extern_prefix;
+
#ifdef HANDLE_PRAGMA_EXTERN_PREFIX
static void handle_pragma_extern_prefix PARAMS ((cpp_reader *));
-static tree pragma_extern_prefix;
-
/* #pragma extern_prefix "prefix" */
static void
handle_pragma_extern_prefix (dummy)
#endif
#ifdef HANDLE_PRAGMA_WEAK
cpp_register_pragma (parse_in, 0, "weak", handle_pragma_weak);
- ggc_add_tree_root (&pending_weaks, 1);
#endif
#ifdef HANDLE_PRAGMA_REDEFINE_EXTNAME
cpp_register_pragma (parse_in, 0, "redefine_extname",
handle_pragma_redefine_extname);
- ggc_add_tree_root (&pending_redefine_extname, 1);
#endif
#ifdef HANDLE_PRAGMA_EXTERN_PREFIX
cpp_register_pragma (parse_in, 0, "extern_prefix",
handle_pragma_extern_prefix);
- ggc_add_tree_root (&pragma_extern_prefix, 1);
#endif
#ifdef REGISTER_TARGET_PRAGMAS
REGISTER_TARGET_PRAGMAS (parse_in);
#endif
-
-#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
- ggc_add_root (&alignment_stack, 1, sizeof(alignment_stack),
- mark_align_stack);
-#endif
}
+
+#include "gt-c-pragma.h"
lang_identifier nodes, because some keywords are only special in a
particular context. */
-struct lang_identifier
+struct lang_identifier GTY(())
{
- struct c_common_identifier ignore;
- tree global_value, local_value, label_value, implicit_decl;
- tree error_locus, limbo_value;
+ struct c_common_identifier common_id;
+ tree global_value;
+ tree local_value;
+ tree label_value;
+ tree implicit_decl;
+ tree error_locus;
+ tree limbo_value;
+};
+
+/* The resulting tree type. */
+
+union lang_tree_node
+ GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE")))
+{
+ union tree_node GTY ((tag ("0"),
+ desc ("tree_node_structure (&%h)")))
+ generic;
+ struct lang_identifier GTY ((tag ("1"))) identifier;
};
/* Language-specific declaration information. */
-struct lang_decl
+struct lang_decl GTY(())
{
struct c_lang_decl base;
/* The return types and parameter types may have variable size.
(DECL_LANG_SPECIFIC (NODE)->base.declared_inline)
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
-struct lang_type
+struct lang_type GTY(())
{
int len;
- tree elts[1];
+ tree GTY((length ("%h.len"))) elts[1];
};
/* Record whether a type or decl was written with nonconstant size.
extern void c_init_decl_processing PARAMS ((void));
extern void c_dup_lang_specific_decl PARAMS ((tree));
extern void c_print_identifier PARAMS ((FILE *, tree, int));
-extern void c_mark_tree PARAMS ((tree));
extern tree build_array_declarator PARAMS ((tree, tree, int, int));
extern tree build_enumerator PARAMS ((tree, tree));
extern int c_decode_option PARAMS ((int, char **));
extern tree lookup_name_current_level PARAMS ((tree));
extern void parmlist_tags_warning PARAMS ((void));
extern void pending_xref_error PARAMS ((void));
-extern void c_mark_function_context PARAMS ((struct function *));
extern void c_push_function_context PARAMS ((struct function *));
extern void c_pop_function_context PARAMS ((struct function *));
extern void pop_label_level PARAMS ((void));
/* In c-decl.c */
extern void c_finish_incomplete_decl PARAMS ((tree));
-extern tree static_ctors;
-extern tree static_dtors;
+extern GTY(()) tree static_ctors;
+extern GTY(()) tree static_dtors;
#endif /* ! GCC_C_TREE_H */
PARAMS ((enum machine_mode, rtx, unsigned HOST_WIDE_INT));
#endif
-static void alpha_init_machine_status
- PARAMS ((struct function *p));
-static void alpha_mark_machine_status
- PARAMS ((struct function *p));
-static void alpha_free_machine_status
- PARAMS ((struct function *p));
+static struct machine_function * alpha_init_machine_status
+ PARAMS ((void));
static void unicosmk_output_deferred_case_vectors PARAMS ((FILE *));
static void unicosmk_gen_dsib PARAMS ((unsigned long *imaskP));
/* Set up function hooks. */
init_machine_status = alpha_init_machine_status;
- mark_machine_status = alpha_mark_machine_status;
- free_machine_status = alpha_free_machine_status;
}
\f
/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones. */
\f
/* Machine-specific function data. */
-struct machine_function
+struct machine_function GTY(())
{
-#if TARGET_ABI_UNICOSMK
+ /* For unicosmk. */
/* List of call information words for calls from this function. */
struct rtx_def *first_ciw;
struct rtx_def *last_ciw;
/* List of deferred case vectors. */
struct rtx_def *addr_list;
-#else
-#if TARGET_ABI_OSF
+
+ /* For OSF. */
const char *some_ld_name;
-#else
- /* Non-empty struct. */
- char dummy;
-#endif
-#endif
};
-/* Register global variables and machine-specific functions with the
- garbage collector. */
+/* How to allocate a 'struct machine_function'. */
-static void
-alpha_init_machine_status (p)
- struct function *p;
+static struct machine_function *
+alpha_init_machine_status ()
{
- p->machine =
- (struct machine_function *) xcalloc (1, sizeof (struct machine_function));
-
-#if TARGET_ABI_UNICOSMK
- p->machine->first_ciw = NULL_RTX;
- p->machine->last_ciw = NULL_RTX;
- p->machine->ciw_count = 0;
- p->machine->addr_list = NULL_RTX;
-#endif
-#if TARGET_ABI_OSF
- p->machine->some_ld_name = NULL;
-#endif
-}
-
-static void
-alpha_mark_machine_status (p)
- struct function *p;
-{
- struct machine_function *machine = p->machine;
-
- if (machine)
- {
-#if TARGET_ABI_UNICOSMK
- ggc_mark_rtx (machine->first_ciw);
- ggc_mark_rtx (machine->addr_list);
-#endif
- }
-}
-
-static void
-alpha_free_machine_status (p)
- struct function *p;
-{
- free (p->machine);
- p->machine = NULL;
+ return ((struct machine_function *)
+ ggc_alloc_cleared (sizeof (struct machine_function)));
}
/* Functions to save and restore alpha_return_addr_rtx. */
}
#endif /* TARGET_ABI_UNICOSMK */
+
+#include "gt-alpha.h"
+
static void print_multi_reg PARAMS ((FILE *, Ccstar, int, int));
static Mmode select_dominance_cc_mode PARAMS ((rtx, rtx, Hint));
static Ccstar shift_op PARAMS ((rtx, Hint *));
-static void arm_init_machine_status PARAMS ((struct function *));
-static void arm_mark_machine_status PARAMS ((struct function *));
-static void arm_free_machine_status PARAMS ((struct function *));
+static struct machine_function * arm_init_machine_status PARAMS ((void));
static int number_of_first_bit_set PARAMS ((int));
static void replace_symbols_in_block PARAMS ((tree, rtx, rtx));
static void thumb_exit PARAMS ((FILE *, int, rtx));
static void
arm_add_gc_roots ()
{
- ggc_add_rtx_root (&arm_compare_op0, 1);
- ggc_add_rtx_root (&arm_compare_op1, 1);
- ggc_add_rtx_root (&arm_target_insn, 1); /* Not sure this is really a root. */
-
gcc_obstack_init(&minipool_obstack);
minipool_startobj = (char *) obstack_alloc (&minipool_obstack, 0);
}
/* Functions to save and restore machine-specific function data. */
-static void
-arm_mark_machine_status (p)
- struct function * p;
-{
- machine_function *machine = p->machine;
-
- if (machine)
- ggc_mark_rtx (machine->eh_epilogue_sp_ofs);
-}
-
-static void
-arm_init_machine_status (p)
- struct function * p;
+static struct machine_function *
+arm_init_machine_status ()
{
- p->machine =
- (machine_function *) xcalloc (1, sizeof (machine_function));
+ struct machine_function *machine;
+ machine = (machine_function *) ggc_alloc_cleared (sizeof (machine_function));
-#if ARM_FT_UNKNOWWN != 0
- ((machine_function *) p->machine)->func_type = ARM_FT_UNKNOWN;
+#if ARM_FT_UNKNOWN != 0
+ machine->func_type = ARM_FT_UNKNOWN;
#endif
-}
-
-static void
-arm_free_machine_status (p)
- struct function * p;
-{
- if (p->machine)
- {
- free (p->machine);
- p->machine = NULL;
- }
+ return machine;
}
/* Return an RTX indicating where the return address to the
{
/* Arrange to initialize and mark the machine per-function status. */
init_machine_status = arm_init_machine_status;
- mark_machine_status = arm_mark_machine_status;
- free_machine_status = arm_free_machine_status;
}
/* Generate the rest of a function's prologue. */
return name;
}
+rtx aof_pic_label;
+
#ifdef AOF_ASSEMBLER
/* Special functions only needed when producing AOF syntax assembler. */
-rtx aof_pic_label = NULL_RTX;
struct pic_chain
{
struct pic_chain * next;
if (aof_pic_label == NULL_RTX)
{
- /* We mark this here and not in arm_add_gc_roots() to avoid
- polluting even more code with ifdefs, and because it never
- contains anything useful until we assign to it here. */
- ggc_add_rtx_root (&aof_pic_label, 1);
aof_pic_label = gen_rtx_SYMBOL_REF (Pmode, "x$adcons");
}
extern int arm_target_label;
extern int arm_ccfsm_state;
-extern struct rtx_def * arm_target_insn;
+extern GTY(()) rtx arm_target_insn;
/* Run-time compilation parameters selecting different hardware subsets. */
extern int target_flags;
/* The floating point instruction architecture, can be 2 or 3 */
extern const char * target_fp_name;
/* Define the information needed to generate branch insns. This is
- stored from the compare operation. Note that we can't use "rtx" here
- since it hasn't been defined! */
-extern struct rtx_def * arm_compare_op0;
-extern struct rtx_def * arm_compare_op1;
+ stored from the compare operation. */
+extern GTY(()) rtx arm_compare_op0;
+extern GTY(()) rtx arm_compare_op1;
/* The label of the current constant pool. */
-extern struct rtx_def * pool_vector_label;
+extern rtx pool_vector_label;
/* Set to 1 when a return insn is output, this means that the epilogue
is not needed. */
extern int return_used_this_function;
+/* Used to produce AOF syntax assembler. */
+extern GTY(()) rtx aof_pic_label;
\f
/* Just in case configure has failed to define anything. */
#ifndef TARGET_CPU_DEFAULT
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
-typedef struct machine_function
+typedef struct machine_function GTY(())
{
/* Additionsl stack adjustment in __builtin_eh_throw. */
- struct rtx_def *eh_epilogue_sp_ofs;
+ rtx eh_epilogue_sp_ofs;
/* Records if LR has to be saved for far jumps. */
int far_jump_used;
/* Records if ARG_POINTER was ever live. */
extern int valid_parallel_operands_6 PARAMS ((rtx *, enum machine_mode));
-extern rtx smulhi3_libfunc;
-extern rtx umulhi3_libfunc;
-extern rtx fix_truncqfhi2_libfunc;
-extern rtx fixuns_truncqfhi2_libfunc;
-extern rtx fix_trunchfhi2_libfunc;
-extern rtx fixuns_trunchfhi2_libfunc;
-extern rtx floathiqf2_libfunc;
-extern rtx floatunshiqf2_libfunc;
-extern rtx floathihf2_libfunc;
-extern rtx floatunshihf2_libfunc;
-
-extern struct rtx_def *c4x_compare_op0; /* Operand 0 for comparisons. */
-extern struct rtx_def *c4x_compare_op1; /* Operand 1 for comparisons. */
+extern GTY(()) rtx smulhi3_libfunc;
+extern GTY(()) rtx umulhi3_libfunc;
+extern GTY(()) rtx fix_truncqfhi2_libfunc;
+extern GTY(()) rtx fixuns_truncqfhi2_libfunc;
+extern GTY(()) rtx fix_trunchfhi2_libfunc;
+extern GTY(()) rtx fixuns_trunchfhi2_libfunc;
+extern GTY(()) rtx floathiqf2_libfunc;
+extern GTY(()) rtx floatunshiqf2_libfunc;
+extern GTY(()) rtx floathihf2_libfunc;
+extern GTY(()) rtx floatunshihf2_libfunc;
+
+extern GTY(()) rtx c4x_compare_op0; /* Operand 0 for comparisons. */
+extern GTY(()) rtx c4x_compare_op1; /* Operand 1 for comparisons. */
#endif /* RTX_CODE */
extern void c4x_pr_INTERRUPT PARAMS ((cpp_reader *));
extern void c4x_pr_ignored PARAMS ((cpp_reader *));
extern void c4x_init_pragma PARAMS ((int (*) (tree *)));
-extern tree code_tree, data_tree, pure_tree, noreturn_tree, interrupt_tree;
#endif
+extern GTY(()) tree code_tree;
+extern GTY(()) tree data_tree;
+extern GTY(()) tree pure_tree;
+extern GTY(()) tree noreturn_tree;
+extern GTY(()) tree interrupt_tree;
+
#endif /* ! GCC_C4X_PROTOS_H */
/* Test and compare insns in c4x.md store the information needed to
generate branch and scc insns here. */
-struct rtx_def *c4x_compare_op0 = NULL_RTX;
-struct rtx_def *c4x_compare_op1 = NULL_RTX;
+rtx c4x_compare_op0;
+rtx c4x_compare_op1;
const char *c4x_rpts_cycles_string;
int c4x_rpts_cycles = 0; /* Max. cycles for RPTS. */
tree interrupt_tree = NULL_TREE;
/* Forward declarations */
-static void c4x_add_gc_roots PARAMS ((void));
static int c4x_isr_reg_used_p PARAMS ((unsigned int));
static int c4x_leaf_function_p PARAMS ((void));
static int c4x_assembler_function_p PARAMS ((void));
struct gcc_target targetm = TARGET_INITIALIZER;
\f
-/* Called to register all of our global variables with the garbage
- collector. */
-
-static void
-c4x_add_gc_roots ()
-{
- ggc_add_rtx_root (&c4x_compare_op0, 1);
- ggc_add_rtx_root (&c4x_compare_op1, 1);
- ggc_add_tree_root (&code_tree, 1);
- ggc_add_tree_root (&data_tree, 1);
- ggc_add_tree_root (&pure_tree, 1);
- ggc_add_tree_root (&noreturn_tree, 1);
- ggc_add_tree_root (&interrupt_tree, 1);
- ggc_add_rtx_root (&smulhi3_libfunc, 1);
- ggc_add_rtx_root (&umulhi3_libfunc, 1);
- ggc_add_rtx_root (&fix_truncqfhi2_libfunc, 1);
- ggc_add_rtx_root (&fixuns_truncqfhi2_libfunc, 1);
- ggc_add_rtx_root (&fix_trunchfhi2_libfunc, 1);
- ggc_add_rtx_root (&fixuns_trunchfhi2_libfunc, 1);
- ggc_add_rtx_root (&floathiqf2_libfunc, 1);
- ggc_add_rtx_root (&floatunshiqf2_libfunc, 1);
- ggc_add_rtx_root (&floathihf2_libfunc, 1);
- ggc_add_rtx_root (&floatunshihf2_libfunc, 1);
-}
-
-
/* Override command line options.
Called once after all options have been parsed.
Mostly we process the processor
This provides compatibility with the old -mno-aliases option. */
if (! TARGET_ALIASES && ! flag_argument_noalias)
flag_argument_noalias = 1;
-
- /* Register global variables with the garbage collector. */
- c4x_add_gc_roots ();
}
{
fprintf (asm_out_file, "\t.sect\t\"%s\"\n", name);
}
+
} while (0)
/* Per-function machine data. */
-struct machine_function
+struct machine_function GTY(())
{
int needs_return_address_on_stack;
};
static void cris_print_index PARAMS ((rtx, FILE *));
-static void cris_init_machine_status PARAMS ((struct function *));
+static struct machine_function * cris_init_machine_status PARAMS ((void));
static int cris_initial_frame_pointer_offset PARAMS ((void));
/* Zero initialization is OK for all current fields. */
-static void
-cris_init_machine_status (p)
- struct function *p;
+static struct machine_function *
+cris_init_machine_status ()
{
- p->machine = xcalloc (1, sizeof (struct machine_function));
+ return ggc_alloc_cleared (sizeof (struct machine_function));
}
/* Split a 2 word move (DI or presumably DF) into component parts.
}
#endif
+#include "gt-cris.h"
+
/*
* Local variables:
* eval: (c-set-style "gnu")
echo "#define L$$name" > tmp-$@ \
&& echo '#include "$<"' >> tmp-$@ \
&& mv -f tmp-$@ $@
+
+$(out_object_file): gt-cris.h
+gt-cris.h : s-gtype ; @true
/* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. */
-extern struct rtx_def *d30v_compare_op0;
-extern struct rtx_def *d30v_compare_op1;
+extern GTY(()) rtx d30v_compare_op0;
+extern GTY(()) rtx d30v_compare_op1;
/* Define the information needed to modify the epilogue for EH. */
static void d30v_print_operand_memory_reference PARAMS ((FILE *, rtx));
static void d30v_build_long_insn PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT,
rtx, rtx));
-static void d30v_add_gc_roots PARAMS ((void));
-static void d30v_init_machine_status PARAMS ((struct function *));
-static void d30v_mark_machine_status PARAMS ((struct function *));
-static void d30v_free_machine_status PARAMS ((struct function *));
+static struct machine_function * d30v_init_machine_status PARAMS ((void));
static void d30v_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static void d30v_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static int d30v_adjust_cost PARAMS ((rtx, rtx, rtx, int));
reg_class_from_letter['x'] = F0_REGS;
reg_class_from_letter['y'] = F1_REGS;
reg_class_from_letter['z'] = OTHER_FLAG_REGS;
-
- d30v_add_gc_roots ();
}
\f
/* Routine to allocate, mark and free a per-function,
machine specific structure. */
-static void
-d30v_init_machine_status (p)
- struct function *p;
+static struct machine_function *
+d30v_init_machine_status ()
{
- p->machine =
- (machine_function *) xcalloc (1, sizeof (machine_function));
-}
-
-static void
-d30v_mark_machine_status (p)
- struct function * p;
-{
- if (p->machine == NULL)
- return;
-
- ggc_mark_rtx (p->machine->eh_epilogue_sp_ofs);
-}
-
-static void
-d30v_free_machine_status (p)
- struct function *p;
-{
- struct machine_function *machine = p->machine;
-
- if (machine == NULL)
- return;
-
- free (machine);
- p->machine = NULL;
+ return ggc_alloc_cleared (sizeof (machine_function));
}
/* Do anything needed before RTL is emitted for each function. */
{
/* Arrange to save and restore machine status around nested functions. */
init_machine_status = d30v_init_machine_status;
- mark_machine_status = d30v_mark_machine_status;
- free_machine_status = d30v_free_machine_status;
}
/* Find the current function's return address.
{
return get_hard_reg_initial_val (Pmode, GPR_LINK);
}
-
-/* Called to register all of our global variables with the garbage
- collector. */
-
-static void
-d30v_add_gc_roots ()
-{
- ggc_add_rtx_root (&d30v_compare_op0, 1);
- ggc_add_rtx_root (&d30v_compare_op1, 1);
-}
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
-typedef struct machine_function
+typedef struct machine_function GTY(())
{
/* Additionsl stack adjustment in __builtin_eh_throw. */
- struct rtx_def * eh_epilogue_sp_ofs;
+ rtx eh_epilogue_sp_ofs;
} machine_function;
\f
extern char *machopic_non_lazy_ptr_name PARAMS ((const char*));
extern char *machopic_stub_name PARAMS ((const char*));
-extern void machopic_add_gc_roots PARAMS ((void));
-
extern void machopic_picsymbol_stub_section PARAMS ((void));
extern void machopic_symbol_stub_section PARAMS ((void));
extern void machopic_lazy_symbol_ptr_section PARAMS ((void));
/* This module assumes that (const (symbol_ref "foo")) is a legal pic
reference, which will not be changed. */
-static tree machopic_defined_list;
+static GTY(()) tree machopic_defined_list;
enum machopic_addr_class
machopic_classify_ident (ident)
return function_base;
}
-static tree machopic_non_lazy_pointers = NULL;
+static GTY(()) tree machopic_non_lazy_pointers;
/* Return a non-lazy pointer name corresponding to the given name,
either by finding it in our list of pointer names, or by generating
}
}
-static tree machopic_stubs = 0;
-
-/* Make sure the GC knows about our homemade lists. */
-
-void
-machopic_add_gc_roots ()
-{
- ggc_add_tree_root (&machopic_defined_list, 1);
- ggc_add_tree_root (&machopic_non_lazy_pointers, 1);
- ggc_add_tree_root (&machopic_stubs, 1);
-}
+static GTY(()) tree machopic_stubs;
/* Return the name of the stub corresponding to the given name,
generating a new stub name if necessary. */
if (!flag_pic)
fprintf (asm_out_file, ".reference .destructors_used\n");
}
+
+#include "gt-darwin.h"
+
rsect_const = tmp = (char *) xmalloc (strlen(".rsect ") +
strlen(const_seg_name) + 3);
sprintf (tmp, ".rsect \"%s\"", const_seg_name);
-
- /* Mark our global variables for GC. */
- ggc_add_rtx_root (&dsp16xx_addhf3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_subhf3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_mulhf3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_divhf3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_cmphf3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_fixhfhi2_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_floathihf2_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_neghf2_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_mulhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_udivqi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_udivhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_divqi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_divhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_modqi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_modhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_umodqi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_umodhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_ashrhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_ashlhi3_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_ucmphi2_libcall, 1);
- ggc_add_rtx_root (&dsp16xx_lshrhi3_libcall, 1);
}
int
extern const char *rsect_const;
extern const char *chip_name;
extern const char *save_chip_name;
-extern struct rtx_def *dsp16xx_compare_op0, *dsp16xx_compare_op1;
-extern struct rtx_def *dsp16xx_addhf3_libcall;
-extern struct rtx_def *dsp16xx_subhf3_libcall;
-extern struct rtx_def *dsp16xx_mulhf3_libcall;
-extern struct rtx_def *dsp16xx_divhf3_libcall;
-extern struct rtx_def *dsp16xx_cmphf3_libcall;
-extern struct rtx_def *dsp16xx_fixhfhi2_libcall;
-extern struct rtx_def *dsp16xx_floathihf2_libcall;
-extern struct rtx_def *dsp16xx_neghf2_libcall;
-extern struct rtx_def *dsp16xx_umulhi3_libcall;
-extern struct rtx_def *dsp16xx_mulhi3_libcall;
-extern struct rtx_def *dsp16xx_udivqi3_libcall;
-extern struct rtx_def *dsp16xx_udivhi3_libcall;
-extern struct rtx_def *dsp16xx_divqi3_libcall;
-extern struct rtx_def *dsp16xx_divhi3_libcall;
-extern struct rtx_def *dsp16xx_modqi3_libcall;
-extern struct rtx_def *dsp16xx_modhi3_libcall;
-extern struct rtx_def *dsp16xx_umodqi3_libcall;
-extern struct rtx_def *dsp16xx_umodhi3_libcall;
-
-extern struct rtx_def *dsp16xx_ashrhi3_libcall;
-extern struct rtx_def *dsp16xx_ashlhi3_libcall;
-extern struct rtx_def *dsp16xx_lshrhi3_libcall;
+extern GTY(()) rtx dsp16xx_compare_op0;
+extern GTY(()) rtx dsp16xx_compare_op1;
+extern GTY(()) rtx dsp16xx_addhf3_libcall;
+extern GTY(()) rtx dsp16xx_subhf3_libcall;
+extern GTY(()) rtx dsp16xx_mulhf3_libcall;
+extern GTY(()) rtx dsp16xx_divhf3_libcall;
+extern GTY(()) rtx dsp16xx_cmphf3_libcall;
+extern GTY(()) rtx dsp16xx_fixhfhi2_libcall;
+extern GTY(()) rtx dsp16xx_floathihf2_libcall;
+extern GTY(()) rtx dsp16xx_neghf2_libcall;
+extern GTY(()) rtx dsp16xx_umulhi3_libcall;
+extern GTY(()) rtx dsp16xx_mulhi3_libcall;
+extern GTY(()) rtx dsp16xx_udivqi3_libcall;
+extern GTY(()) rtx dsp16xx_udivhi3_libcall;
+extern GTY(()) rtx dsp16xx_divqi3_libcall;
+extern GTY(()) rtx dsp16xx_divhi3_libcall;
+extern GTY(()) rtx dsp16xx_modqi3_libcall;
+extern GTY(()) rtx dsp16xx_modhi3_libcall;
+extern GTY(()) rtx dsp16xx_umodqi3_libcall;
+extern GTY(()) rtx dsp16xx_umodhi3_libcall;
+
+extern GTY(()) rtx dsp16xx_ashrhi3_libcall;
+extern GTY(()) rtx dsp16xx_ashlhi3_libcall;
+extern GTY(()) rtx dsp16xx_lshrhi3_libcall;
/* RUN-TIME TARGET SPECIFICATION */
#define DSP16XX 1
#define X86_64_VARARGS_SIZE (REGPARM_MAX * UNITS_PER_WORD + SSE_REGPARM_MAX * 16)
/* Define the structure for the machine field in struct function. */
-struct machine_function
+struct machine_function GTY(())
{
rtx stack_locals[(int) MAX_MACHINE_MODE][MAX_386_STACK_LOCALS];
const char *some_ld_name;
static enum attr_ppro_uops ix86_safe_ppro_uops PARAMS ((rtx));
static void ix86_dump_ppro_packet PARAMS ((FILE *));
static void ix86_reorder_insn PARAMS ((rtx *, rtx *));
-static void ix86_init_machine_status PARAMS ((struct function *));
-static void ix86_mark_machine_status PARAMS ((struct function *));
-static void ix86_free_machine_status PARAMS ((struct function *));
+static struct machine_function * ix86_init_machine_status PARAMS ((void));
static int ix86_split_to_parts PARAMS ((rtx, rtx *, enum machine_mode));
static int ix86_nsaved_regs PARAMS ((void));
static void ix86_emit_save_regs PARAMS ((void));
/* Arrange to set up i386_stack_locals for all functions. */
init_machine_status = ix86_init_machine_status;
- mark_machine_status = ix86_mark_machine_status;
- free_machine_status = ix86_free_machine_status;
-
+
/* Validate -mregparm= value. */
if (ix86_regparm_string)
{
This is called from INIT_EXPANDERS once before RTL is emitted for each
function. */
-static void
-ix86_init_machine_status (p)
- struct function *p;
-{
- p->machine = (struct machine_function *)
- xcalloc (1, sizeof (struct machine_function));
-}
-
-/* Mark machine specific bits of P for GC. */
-static void
-ix86_mark_machine_status (p)
- struct function *p;
-{
- struct machine_function *machine = p->machine;
- enum machine_mode mode;
- int n;
-
- if (! machine)
- return;
-
- for (mode = VOIDmode; (int) mode < (int) MAX_MACHINE_MODE;
- mode = (enum machine_mode) ((int) mode + 1))
- for (n = 0; n < MAX_386_STACK_LOCALS; n++)
- ggc_mark_rtx (machine->stack_locals[(int) mode][n]);
-}
-
-static void
-ix86_free_machine_status (p)
- struct function *p;
+static struct machine_function *
+ix86_init_machine_status ()
{
- free (p->machine);
- p->machine = NULL;
+ return ggc_alloc_cleared (sizeof (struct machine_function));
}
/* Return a MEM corresponding to a stack slot with mode MODE.
/* Construct the SYMBOL_REF for the tls_get_addr function. */
+static GTY(()) rtx ix86_tls_symbol;
rtx
ix86_tls_get_addr ()
{
- static rtx symbol;
- if (!symbol)
+ if (!ix86_tls_symbol)
{
- symbol = gen_rtx_SYMBOL_REF (Pmode, (TARGET_GNU_TLS
+ ix86_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, (TARGET_GNU_TLS
? "___tls_get_addr"
: "__tls_get_addr"));
- ggc_add_rtx_root (&symbol, 1);
}
- return symbol;
+ return ix86_tls_symbol;
}
\f
/* Calculate the length of the memory address in the instruction
}
}
}
+
+#include "gt-i386.h"
/* Variables defined in ia64.c. */
#ifdef RTX_CODE
-extern rtx ia64_compare_op0, ia64_compare_op1;
+extern GTY(()) rtx ia64_compare_op0;
+extern GTY(()) rtx ia64_compare_op1;
#endif
/* Functions defined in ia64.c */
static enum machine_mode hfa_element_mode PARAMS ((tree, int));
static void fix_range PARAMS ((const char *));
-static void ia64_add_gc_roots PARAMS ((void));
-static void ia64_init_machine_status PARAMS ((struct function *));
-static void ia64_mark_machine_status PARAMS ((struct function *));
-static void ia64_free_machine_status PARAMS ((struct function *));
+static struct machine_function * ia64_init_machine_status PARAMS ((void));
static void emit_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_all_insn_group_barriers PARAMS ((FILE *, rtx));
static void emit_predicate_relation_info PARAMS ((void));
emit_move_insn (dest, temp);
}
+static GTY(()) rtx gen_tls_tga;
static rtx
gen_tls_get_addr ()
{
- static rtx tga;
- if (!tga)
+ if (!gen_tls_tga)
{
- tga = init_one_libfunc ("__tls_get_addr");
- ggc_add_rtx_root (&tga, 1);
- }
- return tga;
+ gen_tls_tga = init_one_libfunc ("__tls_get_addr");
+ }
+ return gen_tls_tga;
}
+static GTY(()) rtx thread_pointer_rtx;
static rtx
gen_thread_pointer ()
{
- static rtx tp;
- if (!tp)
+ if (!thread_pointer_rtx)
{
- tp = gen_rtx_REG (Pmode, 13);
- RTX_UNCHANGING_P (tp);
- ggc_add_rtx_root (&tp, 1);
+ thread_pointer_rtx = gen_rtx_REG (Pmode, 13);
+ RTX_UNCHANGING_P (thread_pointer_rtx);
}
return tp;
}
}
}
-/* Called to register all of our global variables with the garbage
- collector. */
-
-static void
-ia64_add_gc_roots ()
-{
- ggc_add_rtx_root (&ia64_compare_op0, 1);
- ggc_add_rtx_root (&ia64_compare_op1, 1);
-}
-
-static void
-ia64_init_machine_status (p)
- struct function *p;
-{
- p->machine =
- (struct machine_function *) xcalloc (1, sizeof (struct machine_function));
-}
-
-static void
-ia64_mark_machine_status (p)
- struct function *p;
-{
- struct machine_function *machine = p->machine;
-
- if (machine)
- {
- ggc_mark_rtx (machine->ia64_eh_epilogue_sp);
- ggc_mark_rtx (machine->ia64_eh_epilogue_bsp);
- ggc_mark_rtx (machine->ia64_gp_save);
- }
-}
-
-static void
-ia64_free_machine_status (p)
- struct function *p;
+static struct machine_function *
+ia64_init_machine_status ()
{
- free (p->machine);
- p->machine = NULL;
+ return ggc_alloc_cleared (sizeof (struct machine_function));
}
/* Handle TARGET_OPTIONS switches. */
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
- mark_machine_status = ia64_mark_machine_status;
- free_machine_status = ia64_free_machine_status;
-
- ia64_add_gc_roots ();
}
\f
static enum attr_itanium_requires_unit0 ia64_safe_itanium_requires_unit0 PARAMS((rtx));
ia64_select_rtx_section (mode, x, align);
flag_pic = save_pic;
}
+
+#include "gt-ia64.h"
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
/* This function contains machine specific function data. */
-struct machine_function
+struct machine_function GTY(())
{
/* The new stack pointer when unwinding from EH. */
- struct rtx_def* ia64_eh_epilogue_sp;
+ rtx ia64_eh_epilogue_sp;
/* The new bsp value when unwinding from EH. */
- struct rtx_def* ia64_eh_epilogue_bsp;
+ rtx ia64_eh_epilogue_bsp;
/* The GP value save register. */
- struct rtx_def* ia64_gp_save;
+ rtx ia64_gp_save;
/* The number of varargs registers to save. */
int n_varargs;
#ifdef RTX_CODE
extern rtx m68hc11_compare_op0;
extern rtx m68hc11_compare_op1;
-extern rtx m68hc11_soft_tmp_reg;
-extern rtx iy_reg;
-extern rtx ix_reg;
-extern rtx d_reg;
+extern GTY(()) rtx m68hc11_soft_tmp_reg;
+extern GTY(()) rtx ix_reg;
+extern GTY(()) rtx iy_reg;
+extern GTY(()) rtx d_reg;
+extern GTY(()) rtx da_reg;
+extern GTY(()) rtx stack_push_word;
+extern GTY(()) rtx stack_pop_word;
+extern GTY(()) rtx z_reg;
+extern GTY(()) rtx z_reg_qi;
extern void m68hc11_initialize_trampoline PARAMS((rtx, rtx, rtx));
const struct attribute_spec m68hc11_attribute_table[];
void create_regs_rtx PARAMS ((void));
-static void m68hc11_add_gc_roots PARAMS ((void));
static void asm_print_register PARAMS ((FILE *, int));
static void m68hc11_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
rtx stack_push_word;
rtx stack_pop_word;
static int regs_inited = 0;
-static rtx z_reg;
+rtx z_reg;
/* Set to 1 by expand_prologue() when the function is an interrupt handler. */
int current_function_interrupt;
int
m68hc11_override_options ()
{
- m68hc11_add_gc_roots ();
-
memset (m68hc11_reg_valid_for_index, 0,
sizeof (m68hc11_reg_valid_for_index));
memset (m68hc11_reg_valid_for_base, 0, sizeof (m68hc11_reg_valid_for_base));
int z_loaded_with_sp;
};
-static rtx z_reg_qi;
+rtx z_reg_qi;
static int m68hc11_check_z_replacement PARAMS ((rtx, struct replace_info *));
static void m68hc11_find_z_replacement PARAMS ((rtx, struct replace_info *));
static void
-m68hc11_add_gc_roots ()
-{
- ggc_add_rtx_root (&m68hc11_soft_tmp_reg, 1);
- ggc_add_rtx_root (&ix_reg, 1);
- ggc_add_rtx_root (&iy_reg, 1);
- ggc_add_rtx_root (&d_reg, 1);
- ggc_add_rtx_root (&da_reg, 1);
- ggc_add_rtx_root (&z_reg, 1);
- ggc_add_rtx_root (&z_reg_qi, 1);
- ggc_add_rtx_root (&stack_push_word, 1);
- ggc_add_rtx_root (&stack_pop_word, 1);
-}
-
-static void
m68hc11_asm_out_constructor (symbol, priority)
rtx symbol;
int priority;
#ifdef RTX_CODE
-extern rtx arch_compare_op0;
-extern rtx arch_compare_op1;
+extern GTY(()) rtx arch_compare_op0;
+extern GTY(()) rtx arch_compare_op1;
extern const char * mcore_output_bclri PARAMS ((rtx, int));
extern const char * mcore_output_bseti PARAMS ((rtx, int));
static rtx emit_new_cond_insn PARAMS ((rtx, int));
static rtx conditionalize_block PARAMS ((rtx));
static void conditionalize_optimization PARAMS ((rtx));
-static void mcore_add_gc_roots PARAMS ((void));
static rtx handle_structs_in_regs PARAMS ((enum machine_mode, tree, int));
static void mcore_mark_dllexport PARAMS ((tree));
static void mcore_mark_dllimport PARAMS ((tree));
return 0;
}
-/* Called to register all of our global variables with the garbage
- collector. */
-static void
-mcore_add_gc_roots ()
-{
- ggc_add_rtx_root (&arch_compare_op0, 1);
- ggc_add_rtx_root (&arch_compare_op1, 1);
-}
-
void
mcore_override_options ()
{
/* Only the m340 supports little endian code. */
if (TARGET_LITTLE_END && ! TARGET_M340)
target_flags |= M340_BIT;
-
- mcore_add_gc_roots ();
}
\f
int
static void abort_with_insn PARAMS ((rtx, const char *))
ATTRIBUTE_NORETURN;
static int symbolic_expression_p PARAMS ((rtx));
-static void mips_add_gc_roots PARAMS ((void));
static bool mips_assemble_integer PARAMS ((rtx, unsigned int, int));
static void mips_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
static void mips_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
static int mips_adjust_cost PARAMS ((rtx, rtx, rtx, int));
static int mips_issue_rate PARAMS ((void));
-static void mips_init_machine_status PARAMS ((struct function *));
-static void mips_free_machine_status PARAMS ((struct function *));
-static void mips_mark_machine_status PARAMS ((struct function *));
+static struct machine_function * mips_init_machine_status PARAMS ((void));
static void mips_select_section PARAMS ((tree, int, unsigned HOST_WIDE_INT))
ATTRIBUTE_UNUSED;
static void mips_unique_section PARAMS ((tree, int))
unsigned HOST_WIDE_INT));
static void mips_encode_section_info PARAMS ((tree, int));
-struct machine_function {
+struct machine_function GTY(()) {
/* Pseudo-reg holding the address of the current function when
generating embedded PIC code. Created by LEGITIMIZE_ADDRESS,
used by mips_finalize_pic if it was created. */
align_functions = 8;
}
- /* Register global variables with the garbage collector. */
- mips_add_gc_roots ();
-
- /* Functions to allocate, mark and deallocate machine-dependent
- function status. */
+ /* Function to allocate machine-dependent function status. */
init_machine_status = &mips_init_machine_status;
- free_machine_status = &mips_free_machine_status;
- mark_machine_status = &mips_mark_machine_status;
}
/* Allocate a chunk of memory for per-function machine-dependent data. */
-static void
-mips_init_machine_status (fn)
- struct function *fn;
-{
- fn->machine = ((struct machine_function *)
- xcalloc (1, sizeof (struct machine_function)));
-}
-
-/* Release the chunk of memory for per-function machine-dependent data. */
-static void
-mips_free_machine_status (fn)
- struct function *fn;
-{
- free (fn->machine);
- fn->machine = NULL;
-}
-
-/* Mark per-function machine-dependent data. */
-static void
-mips_mark_machine_status (fn)
- struct function *fn;
+static struct machine_function *
+mips_init_machine_status ()
{
- if (fn->machine)
- {
- ggc_mark_rtx (fn->machine->embedded_pic_fnaddr_rtx);
- ggc_mark_rtx (fn->machine->mips16_gp_pseudo_rtx);
- }
+ return ((struct machine_function *)
+ ggc_alloc_cleared (sizeof (struct machine_function)));
}
/* On the mips16, we want to allocate $24 (T_REG) before other
return 0;
}
-/* Called to register all of our global variables with the garbage
- collector. */
-
-static void
-mips_add_gc_roots ()
-{
- ggc_add_rtx_root (&mips_load_reg, 1);
- ggc_add_rtx_root (&mips_load_reg2, 1);
- ggc_add_rtx_root (&mips_load_reg3, 1);
- ggc_add_rtx_root (&mips_load_reg4, 1);
- ggc_add_rtx_root (branch_cmp, ARRAY_SIZE (branch_cmp));
-}
-
static enum processor_type
mips_parse_cpu (cpu_string)
const char *cpu_string;
mips_asm_file_end (stream);
}
#endif /* TARGET_IRIX6 */
+
+#include "gt-mips.h"
extern int set_volatile; /* # of nested .set volatile's */
extern int mips_branch_likely; /* emit 'l' after br (branch likely) */
extern int mips_dbx_regno[]; /* Map register # to debug register # */
-extern struct rtx_def *branch_cmp[2]; /* operands for compare */
+extern GTY(()) rtx branch_cmp[2]; /* operands for compare */
extern enum cmp_type branch_type; /* what type of branch to use */
extern enum processor_type mips_arch; /* which cpu to codegen for */
extern enum processor_type mips_tune; /* which cpu to schedule for */
extern int dslots_jump_filled; /* # filled jump delay slots */
extern int dslots_number_nops; /* # of nops needed by previous insn */
extern int num_refs[3]; /* # 1/2/3 word references */
-extern struct rtx_def *mips_load_reg; /* register to check for load delay */
-extern struct rtx_def *mips_load_reg2; /* 2nd reg to check for load delay */
-extern struct rtx_def *mips_load_reg3; /* 3rd reg to check for load delay */
-extern struct rtx_def *mips_load_reg4; /* 4th reg to check for load delay */
+extern GTY(()) rtx mips_load_reg; /* register to check for load delay */
+extern GTY(()) rtx mips_load_reg2; /* 2nd reg to check for load delay */
+extern GTY(()) rtx mips_load_reg3; /* 3rd reg to check for load delay */
+extern GTY(()) rtx mips_load_reg4; /* 4th reg to check for load delay */
extern int mips_string_length; /* length of strings for mips16 */
/* Functions to change what output section we are using. */
the shift patterns, and function_arg, which returns them when given
a VOIDmode argument. */
unsigned int num_adjusts;
- struct rtx_def *adjust[MAX_ARGS_IN_REGISTERS];
+ rtx adjust[MAX_ARGS_IN_REGISTERS];
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
static HOST_WIDEST_INT mmix_intval PARAMS ((rtx));
static void mmix_output_octa PARAMS ((FILE *, HOST_WIDEST_INT, int));
static bool mmix_assemble_integer PARAMS ((rtx, unsigned int, int));
+static struct machine_function * mmix_init_machine_status PARAMS ((void));
static void mmix_init_machine_status PARAMS ((struct function *));
static void mmix_encode_section_info PARAMS ((tree, int));
static const char *mmix_strip_name_encoding PARAMS ((const char *));
warning ("-f%s not supported: ignored", (flag_pic > 1) ? "PIC" : "pic");
flag_pic = 0;
}
-
- /* All other targets add GC roots from their override_options function,
- so play along. */
- ggc_add_rtx_root (&mmix_compare_op0, 1);
- ggc_add_rtx_root (&mmix_compare_op1, 1);
}
/* INIT_EXPANDERS. */
/* Set the per-function data. */
-static void
-mmix_init_machine_status (f)
- struct function *f;
+static struct machine_function *
+mmix_init_machine_status ()
{
- f->machine = xcalloc (1, sizeof (struct machine_function));
+ return ggc_alloc_cleared (sizeof (struct machine_function));
}
/* DATA_ALIGNMENT.
/* Declarations for helper variables that are not tied to a particular
target macro. */
-extern struct rtx_def *mmix_compare_op0;
-extern struct rtx_def *mmix_compare_op1;
+extern GTY(()) rtx mmix_compare_op0;
+extern GTY(()) rtx mmix_compare_op1;
/* Per-function machine data. This is normally an opaque type just
defined and used in the tm.c file, but we need to see the definition in
mmix.md too. */
-struct machine_function
+struct machine_function GTY(())
{
int has_landing_pad;
int highest_saved_stack_register;
else
fprintf (file, "\n\n");
output_file_directive (file, main_input_filename);
- ggc_add_rtx_root (&zero_dreg, 1);
- ggc_add_rtx_root (&zero_areg, 1);
}
/* Print operand X using operand code CODE to assembly language output file
SYMBOL_REF, LABEL_REF, SUBREG, REG, MEM }}, \
{"nshift_operator", { ASHIFTRT, LSHIFTRT, ASHIFT }},
-extern struct rtx_def *zero_dreg;
-extern struct rtx_def *zero_areg;
+extern GTY(()) rtx zero_dreg;
+extern GTY(()) rtx zero_areg;
static int pa_can_combine_p PARAMS ((rtx, rtx, rtx, int, rtx, rtx, rtx));
static int forward_branch_p PARAMS ((rtx));
static int shadd_constant_p PARAMS ((int));
-static void pa_add_gc_roots PARAMS ((void));
-static void mark_deferred_plabels PARAMS ((void *));
static void compute_zdepwi_operands PARAMS ((unsigned HOST_WIDE_INT, unsigned *));
static int compute_movstrsi_length PARAMS ((rtx));
static bool pa_assemble_integer PARAMS ((rtx, unsigned int, int));
/* Variables to handle plabels that we discover are necessary at assembly
output time. They are output after the current function. */
-struct deferred_plabel
+struct deferred_plabel GTY(())
{
rtx internal_label;
char *name;
-} *deferred_plabels = 0;
-int n_deferred_plabels = 0;
+};
+static GTY((length ("n_deferred_plabels"))) struct deferred_plabel *
+ deferred_plabels;
+static int n_deferred_plabels = 0;
\f
/* Initialize the GCC target structure. */
targetm.asm_out.unaligned_op.si = NULL;
targetm.asm_out.unaligned_op.di = NULL;
}
-
- /* Register global variables with the garbage collector. */
- pa_add_gc_roots ();
}
/* Return non-zero only if OP is a register of mode MODE,
if (deferred_plabels == 0)
deferred_plabels = (struct deferred_plabel *)
- xmalloc (1 * sizeof (struct deferred_plabel));
+ ggc_alloc (sizeof (struct deferred_plabel));
else
deferred_plabels = (struct deferred_plabel *)
- xrealloc (deferred_plabels,
+ ggc_realloc (deferred_plabels,
((n_deferred_plabels + 1)
* sizeof (struct deferred_plabel)));
|| GET_CODE (op) == LEU));
}
-/* Mark ARG (which is really a struct deferred_plabel **) for GC. */
-
-static void
-mark_deferred_plabels (arg)
- void *arg;
-{
- struct deferred_plabel *dp = *(struct deferred_plabel **) arg;
- int i;
-
- for (i = 0; i < n_deferred_plabels; ++i)
- ggc_mark_rtx (dp[i].internal_label);
-}
-
-/* Called to register all of our global variables with the garbage
- collector. */
-
-static void
-pa_add_gc_roots ()
-{
- ggc_add_rtx_root (&hppa_compare_op0, 1);
- ggc_add_rtx_root (&hppa_compare_op1, 1);
- ggc_add_root (&deferred_plabels, 1, sizeof (&deferred_plabels),
- &mark_deferred_plabels);
-}
-
/* On hpux10, the linker will give an error if we have a reference
in the read-only data section to a symbol defined in a shared
library. Therefore, expressions that might require a reloc can
else
data_section ();
}
+
+#include "gt-pa.h"
|| ((MODE) && GET_MODE_SIZE (MODE) > 8)))
\f
-extern struct rtx_def *hppa_compare_op0, *hppa_compare_op1;
+extern GTY(()) rtx hppa_compare_op0;
+extern GTY(()) rtx hppa_compare_op1;
extern enum cmp_type hppa_branch_type;
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
static int toc_hash_mark_entry PARAMS ((void **, void *));
static void toc_hash_mark_table PARAMS ((void *));
static int constant_pool_expr_1 PARAMS ((rtx, int *, int *));
-static void rs6000_free_machine_status PARAMS ((struct function *));
-static void rs6000_init_machine_status PARAMS ((struct function *));
+static struct machine_function * rs6000_init_machine_status PARAMS ((void));
static bool rs6000_assemble_integer PARAMS ((rtx, unsigned int, int));
static int rs6000_ra_ever_killed PARAMS ((void));
static tree rs6000_handle_longcall_attribute PARAMS ((tree *, tree, tree, int, bool *));
/* Arrange to save and restore machine status around nested functions. */
init_machine_status = rs6000_init_machine_status;
- free_machine_status = rs6000_free_machine_status;
}
/* Handle -mvrsave= options. */
return pic_offset_table_rtx;
}
\f
-/* Functions to init, mark and free struct machine_function.
- These will be called, via pointer variables,
- from push_function_context and pop_function_context. */
+/* Function to init struct machine_function.
+ This will be called, via a pointer variable,
+ from push_function_context. */
-static void
-rs6000_init_machine_status (p)
- struct function *p;
-{
- p->machine = (machine_function *) xcalloc (1, sizeof (machine_function));
-}
-
-static void
-rs6000_free_machine_status (p)
- struct function *p;
+static struct machine_function *
+rs6000_init_machine_status ()
{
- if (p->machine == NULL)
- return;
-
- free (p->machine);
- p->machine = NULL;
+ return ggc_alloc_cleared (sizeof (machine_function));
}
-
\f
/* Print an operand. Recognize special options, documented below. */
static void
rs6000_add_gc_roots ()
{
- ggc_add_rtx_root (&rs6000_compare_op0, 1);
- ggc_add_rtx_root (&rs6000_compare_op1, 1);
-
toc_hash_table = htab_create (1021, toc_hash_function, toc_hash_eq, NULL);
ggc_add_root (&toc_hash_table, 1, sizeof (toc_hash_table),
toc_hash_mark_table);
-
-#if TARGET_MACHO
- machopic_add_gc_roots ();
-#endif
}
#if TARGET_MACHO
\f
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
-typedef struct machine_function
+typedef struct machine_function GTY(())
{
/* Whether a System V.4 varargs area was created. */
int sysv_varargs_p;
stored from the compare operation. Note that we can't use "rtx" here
since it hasn't been defined! */
-extern struct rtx_def *rs6000_compare_op0, *rs6000_compare_op1;
+extern GTY(()) rtx rs6000_compare_op0;
+extern GTY(()) rtx rs6000_compare_op1;
extern int rs6000_compare_fp_p;
\f
/* Control the assembler format that we output. */
darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) $(RTL_BASE_H) \
$(REGS_H) hard-reg-set.h insn-config.h conditions.h output.h \
insn-attr.h flags.h $(TREE_H) $(EXPR_H) reload.h \
- function.h $(GGC_H) $(TM_P_H)
+ function.h $(GGC_H) $(TM_P_H) gt-darwin.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(C_TREE_H) c-pragma.h toplev.h cpplib.h $(TM_P_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+gt-darwin.h : s-gtype ; @true
+
# Build the libraries for both hard and soft floating point
MULTILIB_OPTIONS = msoft-float
\f
#include "ggc.h"
+static GTY(()) rtx fpscr_rtx;
rtx
get_fpscr_rtx ()
{
- static rtx fpscr_rtx;
-
if (! fpscr_rtx)
{
fpscr_rtx = gen_rtx (REG, PSImode, FPSCR_REG);
REG_USERVAR_P (fpscr_rtx) = 1;
- ggc_add_rtx_root (&fpscr_rtx, 1);
mark_user_reg (fpscr_rtx);
}
if (! reload_completed || mdep_reorg_phase != SH_AFTER_MDEP_REORG)
str += *str == '*';
return str;
}
+
+#include "gt-sh.h"
$(T)crtn.o: $(srcdir)/config/sh/crtn.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sh/crtn.asm
+$(out_object_file): gt-sh.h
+gt-sh.h : s-gtype ; @true
+
# These are not suitable for COFF.
# EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
static void sparc_output_addr_vec PARAMS ((rtx));
static void sparc_output_addr_diff_vec PARAMS ((rtx));
static void sparc_output_deferred_case_vectors PARAMS ((void));
-static void sparc_add_gc_roots PARAMS ((void));
static int check_return_regs PARAMS ((rtx));
static int epilogue_renumber PARAMS ((rtx *, int));
static bool sparc_assemble_integer PARAMS ((rtx, unsigned int, int));
/* Do various machine dependent initializations. */
sparc_init_modes ();
-
- /* Register global variables with the garbage collector. */
- sparc_add_gc_roots ();
}
\f
/* Miscellaneous utilities. */
}
\f
/* The table we use to reference PIC data. */
-static rtx global_offset_table;
+static GTY(()) rtx global_offset_table;
/* The function we use to get at it. */
-static rtx get_pc_symbol;
+static GTY(()) rtx get_pc_symbol;
static char get_pc_symbol_name[256];
/* Ensure that we are not using patterns that are not OK with PIC. */
}
/* We _ought_ to have only one kind per function, but... */
-static rtx sparc_addr_diff_list;
-static rtx sparc_addr_list;
+static GTY(()) rtx sparc_addr_diff_list;
+static GTY(()) rtx sparc_addr_list;
void
sparc_defer_case_vector (lab, vec, diff)
emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lab, Pmode);
}
\f
-/* Called to register all of our global variables with the garbage
- collector. */
-
-static void
-sparc_add_gc_roots ()
-{
- ggc_add_rtx_root (&sparc_compare_op0, 1);
- ggc_add_rtx_root (&sparc_compare_op1, 1);
- ggc_add_rtx_root (&global_offset_table, 1);
- ggc_add_rtx_root (&get_pc_symbol, 1);
- ggc_add_rtx_root (&sparc_addr_diff_list, 1);
- ggc_add_rtx_root (&sparc_addr_list, 1);
-}
-
#ifdef OBJECT_FORMAT_ELF
static void
sparc_elf_asm_named_section (name, flags)
reload_completed = 0;
no_new_pseudos = 0;
}
+
+#include "gt-sparc.h"
stored from the compare operation. Note that we can't use "rtx" here
since it hasn't been defined! */
-extern struct rtx_def *sparc_compare_op0, *sparc_compare_op1;
+extern GTY(()) rtx sparc_compare_op0;
+extern GTY(()) rtx sparc_compare_op1;
\f
/* Generate the special assembly code needed to tell the assembler whatever
TARGET_LIBGCC2_CFLAGS += -mlongcalls
LIB2FUNCS_EXTRA += $(srcdir)/config/xtensa/lib2funcs.S
+
+$(out_object_file): gt-xtensa.h
+gt-xtensa.h : s-gtype ; @true
#define LARGEST_MOVE_RATIO 15
/* Define the structure for the machine field in struct function. */
-struct machine_function
+struct machine_function GTY(())
{
int accesses_prev_frame;
};
static rtx gen_conditional_move PARAMS ((rtx));
static rtx fixup_subreg_mem PARAMS ((rtx x));
static enum machine_mode xtensa_find_mode_for_size PARAMS ((unsigned));
-static void xtensa_init_machine_status PARAMS ((struct function *p));
-static void xtensa_free_machine_status PARAMS ((struct function *p));
+static struct machine_status * xtensa_init_machine_status PARAMS ((void));
static void printx PARAMS ((FILE *, signed int));
static void xtensa_select_rtx_section PARAMS ((enum machine_mode, rtx,
unsigned HOST_WIDE_INT));
}
-static void
-xtensa_init_machine_status (p)
- struct function *p;
+static struct machine_function *
+xtensa_init_machine_status ()
{
- p->machine = (struct machine_function *)
- xcalloc (1, sizeof (struct machine_function));
-}
-
-
-static void
-xtensa_free_machine_status (p)
- struct function *p;
-{
- free (p->machine);
- p->machine = NULL;
+ return ggc_alloc_cleared (sizeof (struct machine_function));
}
}
init_machine_status = xtensa_init_machine_status;
- free_machine_status = xtensa_free_machine_status;
/* Check PIC settings. There's no need for -fPIC on Xtensa and
some targets need to always use PIC. */
if (TREE_CODE (decl) == FUNCTION_DECL && ! TREE_PUBLIC (decl))
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
}
+
+#include "gt-xtensa.h"
fi
# Find some useful tools
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
ansidecl.h )
tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
defaults.h )
- tm_file_list="${tm_file_list} $f" ;;
+ tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
*) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
esac
done
case $f in
ansidecl.h )
host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
- auto-host.h | defaults.h )
+ auto-host.h )
host_xm_file_list="${host_xm_file_list} $f" ;;
+ defaults.h )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
*) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
esac
done
case $f in
ansidecl.h )
build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
- auto-build.h | auto-host.h | defaults.h )
+ auto-build.h | auto-host.h )
build_xm_file_list="${build_xm_file_list} $f" ;;
+ defaults.h )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
*) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
esac
done
# Figure out what assembler we will be using.
echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:6845: checking what assembler to use" >&5
+echo "configure:6849: checking what assembler to use" >&5
gcc_cv_as=
gcc_cv_gas_major_version=
gcc_cv_gas_minor_version=
# Figure out what linker we will be using.
echo $ac_n "checking what linker to use""... $ac_c" 1>&6
-echo "configure:6939: checking what linker to use" >&5
+echo "configure:6943: checking what linker to use" >&5
gcc_cv_ld=
gcc_cv_gld_major_version=
gcc_cv_gld_minor_version=
# Figure out what nm we will be using.
echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:7032: checking what nm to use" >&5
+echo "configure:7036: checking what nm to use" >&5
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
elif test "x$program_prefix" != xNONE; then
# Figure out what objdump we will be using.
echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
-echo "configure:7044: checking what objdump to use" >&5
+echo "configure:7048: checking what objdump to use" >&5
if test -x objdump$host_exeext; then
gcc_cv_objdump=./objdump$host_exeext
elif test "x$program_prefix" != xNONE; then
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
-echo "configure:7056: checking assembler alignment features" >&5
+echo "configure:7060: checking assembler alignment features" >&5
gcc_cv_as_alignment_features=none
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
# Gas version 2.6 and later support for .balign and .p2align.
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
-echo "configure:7104: checking assembler subsection support" >&5
+echo "configure:7108: checking assembler subsection support" >&5
gcc_cv_as_subsections=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
-echo "configure:7144: checking assembler weak support" >&5
+echo "configure:7148: checking assembler weak support" >&5
gcc_cv_as_weak=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
echo "$ac_t""$gcc_cv_as_weak" 1>&6
echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
-echo "configure:7167: checking assembler hidden support" >&5
+echo "configure:7171: checking assembler hidden support" >&5
gcc_cv_as_hidden=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 \
echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
-echo "configure:7230: checking assembler leb128 support" >&5
+echo "configure:7234: checking assembler leb128 support" >&5
gcc_cv_as_leb128=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
echo "$ac_t""$gcc_cv_as_leb128" 1>&6
echo $ac_n "checking assembler eh_frame optimization""... $ac_c" 1>&6
-echo "configure:7275: checking assembler eh_frame optimization" >&5
+echo "configure:7279: checking assembler eh_frame optimization" >&5
gcc_cv_as_eh_frame=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
echo "$ac_t""$gcc_cv_as_eh_frame" 1>&6
echo $ac_n "checking assembler section merging support""... $ac_c" 1>&6
-echo "configure:7356: checking assembler section merging support" >&5
+echo "configure:7360: checking assembler section merging support" >&5
gcc_cv_as_shf_merge=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
echo "$ac_t""$gcc_cv_as_shf_merge" 1>&6
echo $ac_n "checking assembler thread-local storage support""... $ac_c" 1>&6
-echo "configure:7379: checking assembler thread-local storage support" >&5
+echo "configure:7383: checking assembler thread-local storage support" >&5
gcc_cv_as_tls=no
conftest_s=
tls_first_major=
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
echo $ac_n "checking assembler supports explicit relocations""... $ac_c" 1>&6
-echo "configure:7471: checking assembler supports explicit relocations" >&5
+echo "configure:7475: checking assembler supports explicit relocations" >&5
if eval "test \"`echo '$''{'gcc_cv_as_explicit_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
;;
sparc*-*-*)
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:7521: checking assembler .register pseudo-op support" >&5
+echo "configure:7525: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
-echo "configure:7549: checking assembler supports -relax" >&5
+echo "configure:7553: checking assembler supports -relax" >&5
if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
-echo "configure:7577: checking assembler and linker support unaligned pc related relocs" >&5
+echo "configure:7581: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking assembler and linker support unaligned pc related relocs against hidden symbols""... $ac_c" 1>&6
-echo "configure:7604: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
+echo "configure:7608: checking assembler and linker support unaligned pc related relocs against hidden symbols" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "x$gcc_cv_as_flags64" != xno; then
echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
-echo "configure:7645: checking for assembler offsetable %lo() support" >&5
+echo "configure:7649: checking for assembler offsetable %lo() support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
-echo "configure:7685: checking assembler instructions" >&5
+echo "configure:7689: checking assembler instructions" >&5
gcc_cv_as_instructions=
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
echo "$ac_t""$gcc_cv_as_instructions" 1>&6
echo $ac_n "checking assembler GOTOFF in data directives""... $ac_c" 1>&6
-echo "configure:7712: checking assembler GOTOFF in data directives" >&5
+echo "configure:7716: checking assembler GOTOFF in data directives" >&5
gcc_cv_as_gotoff_in_data=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
then
esac
echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:7742: checking assembler dwarf2 debug_line support" >&5
+echo "configure:7746: checking assembler dwarf2 debug_line support" >&5
gcc_cv_as_dwarf2_debug_line=no
# ??? Not all targets support dwarf2 debug_line, even within a version
# of gas. Moreover, we need to emit a valid instruction to trigger any
echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
echo $ac_n "checking assembler --gdwarf2 support""... $ac_c" 1>&6
-echo "configure:7798: checking assembler --gdwarf2 support" >&5
+echo "configure:7802: checking assembler --gdwarf2 support" >&5
gcc_cv_as_gdwarf2_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
echo "$ac_t""$gcc_cv_as_gdwarf2_flag" 1>&6
echo $ac_n "checking assembler --gstabs support""... $ac_c" 1>&6
-echo "configure:7827: checking assembler --gstabs support" >&5
+echo "configure:7831: checking assembler --gstabs support" >&5
gcc_cv_as_gstabs_flag=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
then
echo "$ac_t""$gcc_cv_as_gstabs_flag" 1>&6
echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
-echo "configure:7855: checking linker PT_GNU_EH_FRAME support" >&5
+echo "configure:7859: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:8018: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:8022: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
# List of language makefile fragments.
all_lang_makefiles=
+# Files for gengtype
+all_gtfiles=
# Add the language fragments.
# Languages are added via two mechanisms. Some information must be
compilers=
stagestuff=
outputs=
+ gtfiles=
. ${srcdir}/$s/config-lang.in
if test "x$language" = x
then
all_compilers="$all_compilers $compilers"
all_stagestuff="$all_stagestuff $stagestuff"
all_outputs="$all_outputs $outputs"
+ all_gtfiles="$all_gtfiles $gtfiles"
fi
done
+
# Echo that links are built
if test x$host = x$target
then
s%@subdirs@%$subdirs%g
s%@all_boot_languages@%$all_boot_languages%g
s%@all_compilers@%$all_compilers%g
+s%@all_gtfiles@%$all_gtfiles%g
s%@all_lang_makefiles@%$all_lang_makefiles%g
s%@all_languages@%$all_languages%g
s%@all_stagestuff@%$all_stagestuff%g
ansidecl.h )
tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
defaults.h )
- tm_file_list="${tm_file_list} $f" ;;
+ tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
*) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
esac
done
case $f in
ansidecl.h )
host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
- auto-host.h | defaults.h )
+ auto-host.h )
host_xm_file_list="${host_xm_file_list} $f" ;;
+ defaults.h )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
*) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
esac
done
case $f in
ansidecl.h )
build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
- auto-build.h | auto-host.h | defaults.h )
+ auto-build.h | auto-host.h )
build_xm_file_list="${build_xm_file_list} $f" ;;
+ defaults.h )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
*) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
esac
done
all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
# List of language makefile fragments.
all_lang_makefiles=
+# Files for gengtype
+all_gtfiles=
# Add the language fragments.
# Languages are added via two mechanisms. Some information must be
compilers=
stagestuff=
outputs=
+ gtfiles=
. ${srcdir}/$s/config-lang.in
if test "x$language" = x
then
all_compilers="$all_compilers $compilers"
all_stagestuff="$all_stagestuff $stagestuff"
all_outputs="$all_outputs $outputs"
+ all_gtfiles="$all_gtfiles $gtfiles"
fi
done
AC_SUBST(subdirs)
AC_SUBST(all_boot_languages)
AC_SUBST(all_compilers)
+AC_SUBST(all_gtfiles)
AC_SUBST(all_lang_makefiles)
AC_SUBST(all_languages)
AC_SUBST(all_stagestuff)
+2002-06-03 Geoffrey Keating <geoffk@redhat.com>
+
+ * pt.c (inline_parm_levels): Mark for GC.
+
+ * mangle.c (start_mangling): Allocate G.substitutions here...
+ (init_mangle): ... rather than here.
+ (finish_mangling): Clear the varray pointer when done with it.
+ * spew.c (yylexstring): Don't use VARRAY_FREE.
+ * search.c (bfs_walk): Don't use VARRAY_FREE.
+ * decl2.c (pending_statics): Use gengtype to mark.
+ (deferred_fns): Likewise.
+ (ssdf_decls): Likewise.
+ (init_decl2): Delete.
+ * decl.c (pop_from_top_level): Don't use VARRAY_FREE.
+ (cxx_init_decl_processing): Don't call init_decl2.
+ (cxx_pop_function_context): Don't use VARRAY_FREE.
+ * cp-tree.h (struct saved_scope): No need for special marking
+ of varrays.
+ (struct language_function): Likewise.
+ (local_classes): Use gengtype to mark.
+ (init_decl2): Delete prototype.
+ * class.c (init_class_processing): Don't use
+ ggc_add_tree_varray_root.
+ (build_vtbl_initializer): Don't use VARRAY_FREE.
+
+ * decl.c (typename_compare): Don't use same_type_p.
+
+ * decl.c: Include hashtab.h instead of hash.h.
+ (typename_hash): Update to use htab_h.
+ (typename_compare): Likewise.
+ (typename_htab): Use gengtype to mark.
+ (build_typename_type): Update to use htab_h.
+ * Make-lang.in (cp/decl.o): Use HASHTAB_H instead of hash.h.
+
+ * Make-lang.in (gt-cp-tree.h): New rule.
+ (cp/tree.o): Depend on gt-cp-tree.h.
+ * config-lang.in (gtfiles): Add cp/tree.c.
+ * tree.c: Include gt-cp-tree.h.
+ (list_hash_table): Use gengtype to mark.
+ (init_tree): Use gengtype to mark trees.
+
+ * Make-lang.in (cp/decl.o): Add debug.h dependency.
+ * call.c (struct z_candidate): Use gengtype.
+ (USER_CONV_CAND): Use WRAPPER_ZC.
+ (convert_class_to_reference): Use build_zc_wrapper.
+ (build_type_conversion_1): Likewise.
+ (build_over_call): Use WRAPPER_ZC.
+ (add_warning): Use build_zc_wrapper.
+ * cp-lang.c (LANG_HOOKS_MARK_TREE): Delete.
+ * cp-tree.h (struct lang_identifier): Use gengtype.
+ (struct template_parm_index_s): Likewise.
+ (struct ptrmem_cst): Likewise.
+ (struct tree_binding): Likewise.
+ (struct tree_overload): Likewise.
+ (struct tree_srcloc): Likewise.
+ (struct tree_wrapper): Likewise. Also modify to have a pointer
+ to struct z_candidate rather than void.
+ (enum cp_tree_node_structure_enum): New.
+ (union lang_tree_node): New.
+ (cxx_mark_tree): Delete prototype.
+ (cp_tree_node_structure): New prototype.
+ (build_ptr_wrapper): Delete prototype.
+ (build_int_wrapper): Delete prototype.
+ (build_zc_wrapper): New prototype.
+ * decl.c: Include debug.h
+ (cxx_mark_tree): Delete.
+ (cp_tree_node_structure): New.
+ * tree.c (build_ptr_wrapper): Delete.
+ (build_int_wrapper): Delete.
+ (build_zc_wrapper): New.
+
+ * cp-tree.h [! ENABLE_TREE_CHECKING] (LANG_TYPE_PTRMEM_CHECK):
+ Correct typo. Patch from k_fukui@highway.ne.jp.
+
+ * semantics.c (current_stmt_tree): Update for change to
+ struct language_function.
+ (finish_mem_initializers): Likewise.
+ * decl.c (cxx_init_decl_processing): Don't set mark_lang_status.
+ * cp-tree.h (struct language_function): Rename from
+ cp_language_function. Change all uses.
+ (cp_function_chain): Don't need to cast.
+
+ * class.c (duplicate_tag_error): Reset discriminator.
+ (check_bases_and_members): Update for data structure changes.
+ * cp-tree.h (struct lang_id2): Use gengtype.
+ (flagged_type_tree): Likewise.
+ (SET_LANG_ID): Use GGC on struct lang_id2.
+ (struct cp_language_function): Use gengtype. Remove field
+ 'x_vcalls_possible_p'.
+ (current_vcalls_possible_p): Delete.
+ (struct lang_type_header): New.
+ (struct lang_type_class): Rename from struct lang_type. Include
+ struct lang_type_header.
+ (struct lang_type_ptrmem): New.
+ (struct lang_type): New.
+ (LANG_TYPE_CLASS_CHECK): New. Use it in all the appropriate macros.
+ (LANG_TYPE_PTRMEM_CHECK): New. Use it in all the appropriate macros.
+ (TYPE_SET_PTRMEMFUNC_TYPE): Set discriminator, update for changes.
+ (struct lang_decl_flags): Use gengtype. Add discriminators.
+ (struct lang_decl): Use gengtype. Add and use discriminators.
+ Update the macros that reference moved fields.
+ (LANG_DECL_U2_CHECK): New function. Use it when appropriate.
+ (SET_DECL_THUNK_P): Set discriminator too.
+ (clear_inline_text_obstack): Delete prototype.
+ (finish_inline_definitions): Delete prototype.
+ (mark_pending_inlines): Delete prototype.
+ (lang_check_failed): New prototype.
+ * decl.c (struct named_label_use_list): Use gengtype.
+ (struct named_label_list): Likewise.
+ (mark_binding_level): Delete.
+ (mark_named_label_lists): Delete.
+ (push_local_name): Set discriminator on DECL_LANG_SPECIFIC.
+ (cxx_init_decl_processing): Use generated marker routine.
+ (begin_destructor_body): Delete dead set to
+ current_vcalls_possible_p.
+ (mark_lang_function): Delete.
+ (mark_cp_function_context): Delete.
+ (lang_mark_tree): Use generated marker routines.
+ * decl2.c (start_objects): Set discriminator when setting
+ GLOBAL_INIT_PRIORITY.
+ * lex.c (retrofit_lang_decl): Set discriminators.
+ (copy_lang_type): Update for changes to lang_type structure.
+ (cp_make_lang_type): Set discriminator.
+ * parse.y: Use gengtype on YYLVAL. Don't use dots in identifiers.
+ * search.c: Include ggc.h.
+ * semantics.c (anon_aggr_type_p): Use the macro, don't hand-code it.
+ (finish_inline_definitions): Delete.
+ * spew.c (struct token): Use gengtype.
+ (struct token_chunk): New.
+ (struct unparsed_text): Use gengtype. Store tokens in chunks.
+ (struct feed): Use gengtype.
+ (feed_obstack): Delete.
+ (feed): Mark as GC root.
+ (pending_inlines): Mark as GC root.
+ (pending_inlines_tail): Likewise.
+ (processing_these_inlines): Likewise.
+ (token_obstack): Make static.
+ (first_token): Likewise.
+ (init_spew): Don't initialise deleted things; use gengtype for roots.
+ (clear_inline_text_obstack): Delete.
+ (feed_input): Use GC for struct feed. Update for changes to
+ struct unparsed_text.
+ (mark_pending_inlines): Delete.
+ (next_token): Rename from add_token. Change all callers. Update
+ for changes to struct unparsed_text.
+ (space_for_token): New.
+ (remove_last_token): New.
+ (alloc_unparsed_text): New.
+ (snarf_block): Take an unparsed_text. Update for changes to struct
+ unparsed_text.
+ (snarf_method): Update for changes to struct unparsed_text.
+ (snarf_defarg): Update for changes to struct unparsed_text.
+ * tree.c (lang_check_failed): New.
+
+ * Make-lang.in (gt-cp-call.h gt-cp-decl2.h gt-cp-parse.h
+ gt-cp-pt.h gt-cp-repo.h gt-cp-spew.h): New rules.
+ (cp/spew.o): Add dependency on gt-<filename>.h.
+ (cp/decl2.o): Add dependency on gt-<filename>.h.
+ (cp/call.o): Add dependency on gt-<filename>.h.
+ (cp/pt.o): Add dependency on gt-<filename>.h.
+ (cp/repo.o): Add dependency on gt-<filename>.h.
+ (cp/parse.o): Add dependency on gt-<filename>.h.
+ * call.c: Use gengtype for roots.
+ * config-lang.in (gtfiles): Add cp-tree.h decl.h lex.h call.c
+ decl2.c parse.y pt.c repo.c spew.c.
+ * cp-tree.h: Use gengtype for roots.
+ (struct saved_scope): Use GGC, gengtype.
+ (cp_parse_init): Delete prototype.
+ (init_pt): Delete prototype.
+ * decl.c: Use gengtype for roots.
+ (mark_saved_scope): Delete.
+ (cxx_init_decl_processing): Don't call deleted initilisation
+ routines.
+ (signed_size_zero_node): Delete, unused.
+ * decl.h: Use gengtype for roots.
+ * decl2.c: Use gengtype for roots.
+ * lex.h: Use gengtype for roots.
+ * parse.y: Use gengtype for roots.
+ (cp_parse_init): Delete.
+ * pt.c: Use gengtype for roots.
+ (init_pt): Delete.
+ * repo.c: Use gengtype for roots.
+ * spew.c: Use gengtype for roots.
+
+ * Make-lang.in: Allow for filename changes. Add gtype-cp.h.
+ (cp/decl.o): Add dependency on gtype-cp.h.
+ * decl.c: Remove use of add_deletable_root, use GTY marker instead.
+ Include gtype-cp.h. Allow for filename changes.
+
+ * Make-lang.in (cp/gt-decl.h): Generate using gengtype.
+ (cp/decl.o): Add cp/gt-decl.h dependency.
+ * config-lang.in (gtfiles): New.
+ * tree.h: Rename struct binding_level to struct cp_binding_level.
+ * decl.c: Rename struct binding_level to struct cp_binding_level.
+ Include cp/gt-decl.h.
+ (struct cp_binding_level): Use gengtype.
+ (make_binding_level): Use GGC on struct cp_binding_level.
+ (mark_binding_level): Use gt_ggc_m_cp_binding_level.
+ (cxx_init_decl_processing): Mark free_binding_level as
+ deletable.
+
+ * decl.c (mark_cp_function_context): Update calling sequence.
+
+ * decl.c (start_function): Don't free 'struct
+ cp_language_function'.
+ (pop_cp_function_context): Likewise.
+ (save_function_data): Allocate it using GC.
+ * semantics.c (genrtl_start_function): Don't free 'struct
+ cp_language_function'.
+
2002-05-31 Matthew Woodcraft <mattheww@chiark.greenend.org.uk>
* lang-specs.h: Use cpp_debug_options.
false ; \
fi
+gtype-cp.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h : s-gtype; @true
+gt-cp-parse.h gt-cp-pt.h gt-cp-repo.h gt-cp-spew.h : s-gtype; @true
+gt-cp-tree.h : s-gtype; @true
+
#\f
# Build hooks:
function.h varray.h $(SYSTEM_H) $(CONFIG_H) $(TARGET_H) \
$(srcdir)/../include/hashtab.h $(srcdir)/../include/splay-tree.h
-cp/spew.o: cp/spew.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h toplev.h
+cp/spew.o: cp/spew.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h toplev.h \
+ gt-cp-spew.h
cp/lex.o: cp/lex.c $(CXX_TREE_H) cp/parse.h flags.h cp/lex.h c-pragma.h \
toplev.h output.h mbchar.h $(GGC_H) input.h diagnostic.h cp/operators.def \
$(TM_P_H)
cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) toplev.h langhooks.h $(LANGHOOKS_DEF_H) \
c-common.h
cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
- output.h $(EXPR_H) except.h toplev.h hash.h $(GGC_H) $(RTL_H) \
- cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h
+ output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(GGC_H) $(RTL_H) \
+ cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
+ debug.h gt-cp-decl.h gtype-cp.h
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
- output.h except.h toplev.h $(GGC_H) $(RTL_H) c-common.h
+ output.h except.h toplev.h $(GGC_H) $(RTL_H) c-common.h gt-cp-decl2.h
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H) \
diagnostic.h
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
diagnostic.h
cp/class.o: cp/class.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(TARGET_H)
cp/call.o: cp/call.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \
- $(GGC_H) diagnostic.h
+ $(GGC_H) diagnostic.h gt-cp-call.h
cp/friend.o: cp/friend.c $(CXX_TREE_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
cp/init.o: cp/init.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
$(GGC_H) except.h
cp/cvt.o: cp/cvt.c $(CXX_TREE_H) cp/decl.h flags.h toplev.h convert.h
cp/search.o: cp/search.c $(CXX_TREE_H) stack.h flags.h toplev.h $(RTL_H)
cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
- insn-config.h integrate.h tree-inline.h real.h
+ insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(SYSTEM_H)
cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h
cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
cp/expr.o: cp/expr.c $(CXX_TREE_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
except.h $(TM_P_H)
cp/pt.o: cp/pt.c $(CXX_TREE_H) cp/decl.h cp/parse.h cp/lex.h toplev.h \
- $(GGC_H) $(RTL_H) except.h tree-inline.h
+ $(GGC_H) $(RTL_H) except.h tree-inline.h gt-cp-pt.h
cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h flags.h real.h \
$(LANGHOOKS_DEF_H)
-cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H) diagnostic.h
+cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H) diagnostic.h \
+ gt-cp-repo.h
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \
flags.h $(GGC_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \
tree-inline.h
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) toplev.h real.h
cp/parse.o: cp/parse.c $(CXX_TREE_H) flags.h cp/lex.h except.h output.h \
- $(SYSTEM_H) toplev.h $(GGC_H)
+ $(SYSTEM_H) toplev.h $(GGC_H) gt-cp-parse.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
$(srcdir)/cp/parse.c $(OUTPUT_OPTION)
#\f
/* New overloading code. */
-struct z_candidate {
+struct z_candidate GTY(()) {
tree fn;
tree convs;
tree second_conv;
should be created to hold the result of the conversion. */
#define NEED_TEMPORARY_P(NODE) TREE_LANG_FLAG_4 (NODE)
-#define USER_CONV_CAND(NODE) \
- ((struct z_candidate *)WRAPPER_PTR (TREE_OPERAND (NODE, 1)))
+#define USER_CONV_CAND(NODE) WRAPPER_ZC (TREE_OPERAND (NODE, 1))
#define USER_CONV_FN(NODE) (USER_CONV_CAND (NODE)->fn)
int
conv = build1 (IDENTITY_CONV, s, expr);
conv = build_conv (USER_CONV, TREE_TYPE (TREE_TYPE (cand->fn)),
conv);
- TREE_OPERAND (conv, 1) = build_ptr_wrapper (cand);
+ TREE_OPERAND (conv, 1) = build_zc_wrapper (cand);
ICS_USER_FLAG (conv) = 1;
if (cand->viable == -1)
ICS_BAD_FLAG (conv) = 1;
(USER_CONV,
(DECL_CONSTRUCTOR_P (cand->fn)
? totype : non_reference (TREE_TYPE (TREE_TYPE (cand->fn)))),
- expr, build_ptr_wrapper (cand));
+ expr, build_zc_wrapper (cand));
ICS_USER_FLAG (cand->second_conv) = ICS_USER_FLAG (*p) = 1;
if (cand->viable == -1)
case USER_CONV:
{
struct z_candidate *cand
- = WRAPPER_PTR (TREE_OPERAND (convs, 1));
+ = WRAPPER_ZC (TREE_OPERAND (convs, 1));
tree convfn = cand->fn;
tree args;
/* Give any warnings we noticed during overload resolution. */
if (cand->warnings)
for (val = cand->warnings; val; val = TREE_CHAIN (val))
- joust (cand, WRAPPER_PTR (TREE_VALUE (val)), 1);
+ joust (cand, WRAPPER_ZC (TREE_VALUE (val)), 1);
if (DECL_FUNCTION_MEMBER_P (fn))
enforce_access (cand->basetype_path, fn);
return convert_from_reference (fn);
}
-static tree java_iface_lookup_fn;
+static GTY(()) tree java_iface_lookup_fn;
/* Make an expression which yields the address of the Java interface
method FN. This is achieved by generating a call to libjava's
= builtin_function ("_Jv_LookupInterfaceMethodIdx",
build_function_type (ptr_type_node, t),
0, NOT_BUILT_IN, NULL);
- ggc_add_tree_root (&java_iface_lookup_fn, 1);
}
/* Look up the pointer to the runtime java.lang.Class object for `instance'.
struct z_candidate *winner, *loser;
{
winner->warnings = tree_cons (NULL_TREE,
- build_ptr_wrapper (loser),
+ build_zc_wrapper (loser),
winner->warnings);
}
return convert_like (conv, expr);
}
+
+#include "gt-cp-call.h"
memset ((char *) TYPE_LANG_SPECIFIC (t), 0, sizeof (struct lang_type));
BINFO_BASETYPES(binfo) = NULL_TREE;
+ TYPE_LANG_SPECIFIC (t)->u.h.is_lang_type_class = 1;
TYPE_BINFO (t) = binfo;
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
/* Figure out whether or not we will need a cookie when dynamically
allocating an array of this type. */
- TYPE_LANG_SPECIFIC (t)->vec_new_uses_cookie
+ TYPE_LANG_SPECIFIC (t)->u.c.vec_new_uses_cookie
= type_requires_array_cookie (t);
}
= (class_stack_node_t) xmalloc (current_class_stack_size
* sizeof (struct class_stack_node));
VARRAY_TREE_INIT (local_classes, 8, "local_classes");
- ggc_add_tree_varray_root (&local_classes, 1);
access_default_node = build_int_2 (0, 0);
access_public_node = build_int_2 (ak_public, 0);
VARRAY_TREE_INIT (vid.fns, 32, "fns");
/* Add the vcall and vbase offset entries. */
build_vcall_and_vbase_vtbl_entries (binfo, &vid);
- /* Clean up. */
- VARRAY_FREE (vid.fns);
/* Clear BINFO_VTABLE_PATH_MARKED; it's set by
build_vbase_offset_vtbl_entries. */
for (vbase = CLASSTYPE_VBASECLASSES (t);
stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
target_libs="${libstdcxx_version} target-gperf"
+
+gtfiles="\$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/parse.y \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/spew.c \$(srcdir)/cp/tree.c"
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES cxx_insert_default_attributes
-#undef LANG_HOOKS_MARK_TREE
-#define LANG_HOOKS_MARK_TREE cxx_mark_tree
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_UNSAFE_FOR_REEVAL c_common_unsafe_for_reeval
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
#undef LANG_HOOKS_FUNCTION_INIT
#define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context
-#undef LANG_HOOKS_FUNCTION_FREE
-#define LANG_HOOKS_FUNCTION_FREE cxx_pop_function_context
-#undef LANG_HOOKS_FUNCTION_MARK
-#define LANG_HOOKS_FUNCTION_MARK cxx_mark_function_context
+#undef LANG_HOOKS_FUNCTION_FINAL
+#define LANG_HOOKS_FUNCTION_FINAL cxx_pop_function_context
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
\f
/* Language-dependent contents of an identifier. */
-struct lang_identifier
+struct lang_identifier GTY(())
{
- struct c_common_identifier ignore;
+ struct c_common_identifier c_common;
tree namespace_bindings;
tree bindings;
tree class_value;
#define LANG_IDENTIFIER_CAST(NODE) \
((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
-struct lang_id2
+struct lang_id2 GTY(())
{
- tree label_value, implicit_decl;
+ tree label_value;
+ tree implicit_decl;
tree error_locus;
};
-typedef struct
+typedef struct flagged_type_tree_s GTY(())
{
tree t;
int new_type_flag;
tree lookups;
} flagged_type_tree;
-typedef struct
+typedef struct template_parm_index_s GTY(())
{
struct tree_common common;
HOST_WIDE_INT index;
tree decl;
} template_parm_index;
-typedef struct ptrmem_cst
+struct ptrmem_cst GTY(())
{
struct tree_common common;
/* This isn't used, but the middle-end expects all constants to have
this field. */
rtx rtl;
tree member;
-}* ptrmem_cst_t;
+};
+typedef struct ptrmem_cst * ptrmem_cst_t;
/* Nonzero if this binding is for a local scope, as opposed to a class
or namespace scope. */
&& MAIN_NAME_P (DECL_NAME (NODE)))
-struct tree_binding
+struct tree_binding GTY(())
{
struct tree_common common;
- union {
- tree scope;
- struct binding_level *level;
- } scope;
+ union tree_binding_u {
+ tree GTY ((tag ("0"))) scope;
+ struct cp_binding_level * GTY ((tag ("1"))) level;
+ } GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) scope;
tree value;
};
is not important for this node. */
#define OVL_USED(NODE) TREE_USED (NODE)
-struct tree_overload
+struct tree_overload GTY(())
{
struct tree_common common;
tree function;
#define SET_BASELINK_P(NODE) \
(TREE_LANG_FLAG_1 (NODE) = 1)
-#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.ptr)
-#define WRAPPER_INT(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.i)
+#define WRAPPER_ZC(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->z_c)
-struct tree_wrapper
+struct tree_wrapper GTY(())
{
struct tree_common common;
- union {
- void *ptr;
- int i;
- } u;
+ struct z_candidate *z_c;
};
#define SRCLOC_FILE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->filename)
#define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
-struct tree_srcloc
+struct tree_srcloc GTY(())
{
struct tree_common common;
const char *filename;
(LANG_IDENTIFIER_CAST (NODE)->x \
? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
-#define SET_LANG_ID(NODE, VALUE, NAME) \
- (LANG_IDENTIFIER_CAST (NODE)->x == 0 \
- ? LANG_IDENTIFIER_CAST (NODE)->x \
- = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
+#define SET_LANG_ID(NODE, VALU