[lto][patch] Committed first cut at DWARF-less streamer for globals and types to lto-streamer branch
Kenneth Zadeck
zadeck@naturalbridge.com
Thu May 29 14:45:00 GMT 2008
Bill Maddox wrote:
> This patch replaces the DWARF-based reader for the LTO IR with
> a straightforward serialization of the tree nodes. It is currently a bit
> crude, and should evolve in the direction of the function body streamer
> to pack the stream more tightly and to use the tree access macros
> in preference to direct access to the underlying fields. The current
> low-level treatment of the fields is intended as a hedge against mistakes
> in my understanding of the complex ways in which some of the fields
> are overloaded for multiple purposes.
>
> At present, the LTO-specfic modifications to the DWARF writer
> have not been backed out, but the DWARF is ignored upon input.
>
> Please note that this change has been staged to a highly unstable
> branch of an already active development branch, and exhibits significant
> regressions on the test suite. If you are not an active participant in
> the development of the new streamer, you most likely do not want to
> check out the lto-streamer branch, but should continue working
> with the lto branch.
>
>
enopatch
> --Bill
>
> In gcc:
>
> * lto-tree-flags.def: Add flags for *_DECL
> and *_TYPE for use by g lobal streamer.
> * lto-function-out.c: Include lto-tree-out.h.
> (struct output_block): Moved to lto-tree-out.h.
> (create_output_block, destroy_output_block):
> Make non-static, now exported.
> (output_tree_flags, debug_tree_flags): Add ADD_CLASS_TYPE,
> ADD_TYPE_FLAG, ADD_FUN_FLAG macros. Fix bug where stream
> debugging info was sometimes omitted.
> (lto_static_init): Adjust lto_flags_needed_for and
> lto_types_needed_for for node types now newly handled by
> the global streamer.
> (output_tree, output_type_tree, output_global_record_start,
> output_field_decl, output_function_decl, output_var_decl,
> output_parm_decl, output_result_decl, output_type_decl,
> output_namespace_decl, output_translation_unit_decl,
> output_binfo, output_type, output_global_constructor)
> New functions.
> * lto_function-in.c: Include lto-tree-in.h.
> (struct data_in): Moved to lto-tree-in.h.
> (input_string_internal): Initialize input_block before
> reading string table size from the stream.
> (process_tree_flags): Add ADD_CLASS_TYPE_FLAG, ADD_TYPE_FLAG,
> ADD_FUN_FLAG.
> (input_local_var): Handle stream debugging information
> that was previously omitted due to a bug in the writer.
> (lto_static_init_local): Make non-static, now exported.
> Add ADD_CLASS_TYPE_FLAG, ADD_TYPE_FLAG, ADD_FUN_FLAG.
> (input_tree, input_type_tree, input_tree_operand,
> global_vector_enter, global_vector_fixup, input_field_decl,
> input_function_decl, input_var_decl, input_parm_decl,
> input_result_decl, input_type_decl, input_namespace_decl,
> input_translation_unit_decl, input_binfo, input_type):
> New functions.
> * lto-section.h (struct lto_decl_header): Add fields for
> sizes of globals stream and its associated debug and string
> table streams.
> * lto-tree-tags.def: MAP_EXPR_TAG and SET_NAME macro calls
> for newly-handled tree codes for global decls and types.
> * lto-section-in.c (dump_debug_stream): Fix typo in error message.
> * lto-section-in.h (lto_input_function_body,
> lto_input_constructors_and_inits): Moved to lto-tree-in.h.
> * lto-tags.h (enum LTO_tags): Added literals LTO_tree_vec,
> LTO_translation_unit_decl, LTO_*_type, LTO_tree_binfo,
> LTO_pickle_reference.
>
> In gcc/lto:
>
> * lto.c: Include lto-tree-in.h, lto-tags.h.
> (enum DWARF2_class, DW_cl_constant, struct DWARF2_form_data,
> struct lto_context, lto_fd_init, lto_info_fd_init,
> lto_abbrev_fd_init, lto_info_fd_close, lto_file_init,
> lto_file_close, lto_file_corrupt_error, lto_abi_mismatch_error,
> LTO_CHECK_INT_VAL, LTO_READ_TYPE, lto_read_uleb128, lto_read_sleb128,
> lto_read_initial_length, lto_abbrev_read_attrs, lto_abbrev_read,
> lto_abbrev_read_lookup, lto_read_section_offset,
> lto_read_comp_unit_header, find_cu_for_offset, lto_get_file_name,
> lto_resolve_reference,lto_read_form, attribute_value_as_int,
> make_signed_host_wide_int, attribute_value_as_constant, lto_cache_hash,
> lto_cache_eq, lto_cache_store_DIE, lto_cache_lookup_DIE,
> lto_find_integral_type, lto_find_integral_type_1,
> LTO_BEGIN_READ_ATTRS_UNCHECKED, LTO_BEGIN_READ_ATTRS, LTO_END_READ_ATTRS,
> lto_unsupported_attr_error, lto_get_identifier, lto_read_referenced_type_DIE,
> lto_read_compile_unit_DIE, lto_read_array_type_DIE,
> lto_read_structure_union_class_type_DIE, lto_read_enumerator_DIE,
> lto_read_enumeration_type_DIE, lto_read_only_for_child_DIEs,
> lto_read_only_for_child_DIEs, lto_read_member_DIE, lto_read_abbrev,
> lto_read_variable_formal_parameter_constant_DIE, lto_get_body):
> Removed.
> (preload_common_nodes): New function.
> (lto_read_decls): Convert for new global streamer.
> (lto_materialze_file_data, lto_read_subroutine_type_subprogram_die,
> lto_read_unspecified_parameters_DIE, lto_read_typedef_DIE,
> lto_read_pointer_reference_type_DIE, lto_read_subrange_type_DIE,
> lto_read_base_type_DIE, lto_read_const_volatile_restrict_type_DIE,
> lto_read_namespace_DIE, lto_read_unspecified_type_DIE, lto_read_DIE,
> lto_read_child_DIEs, lto_collect_child_DIEs): Removed.
> (lto_info_read, lto_set_cu_context): Removed.
> (lto_file_read): Convert for new global streamer.
> (lto_resolve_type_ref, lto_read_DIE_at_ptr, lto_resolve_var_ref,
> lto_resolve_fn_ref, lto_resolve_field_ref, lto_resolve_typedecl_ref,
> lto_resolve_namespacedecl_ref): Removed.
> (lto_file_init, lto_file_close): Moved to lto-elf.c.
> * lto-tree.h (lto_symtab_merge_var, lto_symtab_mergee_fun): Declare here.
> * lto-elf.c (lto_file_init, lto_file_close): Moved from lto.c.
> (lto_elf_file_open): Removed code to read DWARF debug sections.
> * lto.h (lto_context, DWARF2_attr, DWARF2_abbrev, DWARF2_CompUnit,
> lto_die_ptr, lto_die_cache_entry, lto_fd, lto_info_fd, lto_abbrev_fd):
> Removed.
> (lto_file): Removed debug_info and debug_abbrev fields.
> (lto_ref): Removed.
> (lto_file_init, lto_file_close, lto_resolve_type_ref, lto_resolve_var_ref,
> lto_resolve_fn_ref, lto_resolve_field_ref, lto_resolve_typedecl_ref,
> lto_resolve_namespacedecl_ref, lto_get_file_name): Removed declarations.
> (lto_symtab_merge_var, lto_symtab_merge_fn): Declarations moved to lto-tree.h.
> * lto-symtab.c (lto_compatible_attributes_p): Lobotomize this, as it barfs
> on "Hello, world!".
> * lto-section-out.c: Include lto-tree-out.h.
> (lto_hash_global_slot_node, lto_eq_global_slot_node, preload_common_nodes,
> write_global_stream, write_global_references): New functions.
> (produce_asm_for_decls): Convert for new global streamer.
> * lto-section-out.h (lto_hash_global_slot_node, lto_eq_global_slot_node):
> Declare.
>
More information about the Gcc-patches
mailing list