GCC Middle and Back End API Reference
|
Data Structures | |
struct | sccs |
struct | scc_entry |
Variables | |
static unsigned int | next_dfs_num |
static vec< scc_entry > | sccstack |
static struct pointer_map_t * | sccstate |
static struct obstack | sccstate_obstack |
|
static |
@verbatim Write the GIMPLE representation to a file stream.
Copyright (C) 2009-2013 Free Software Foundation, Inc. Contributed by Kenneth Zadeck zadec Re-implemented by Diego Novillo k@na tural brid ge.co mdnovi llo@ googl e.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
Clear the line info stored in DATA_IN.
References output_block::current_col, output_block::current_file, and output_block::current_line.
Referenced by create_output_block(), and output_function().
|
static |
Copy the function body of NODE without deserializing.
References symtab_node_base::decl, free(), len, lto_begin_section(), lto_end_section(), symtab_node_base::lto_file_data, lto_free_section_data(), lto_get_decl_name_mapping(), lto_get_function_in_decl_state(), lto_get_out_decl_state(), lto_get_section_data(), lto_get_section_name(), LTO_N_DECL_STREAMS, lto_output_data_stream(), LTO_section_function_body, lto_tree_ref_encoder_size(), lto_write_stream(), lto_tree_ref_table::size, lto_in_decl_state::streams, lto_out_decl_state::streams, cgraph_node::symbol, lto_tree_ref_table::trees, and lto_tree_ref_encoder::trees.
Referenced by lto_output().
|
read |
Create the output block and return it. SECTION_TYPE is LTO_section_function_body or LTO_static_initializer.
References output_block::cfg_stream, clear_line_info(), hash_table< Descriptor, Allocator >::create(), output_block::decl_state, lto_get_out_decl_state(), LTO_section_function_body, output_block::main_stream, output_block::obstack, output_block::section_type, streamer_tree_cache_create(), output_block::string_hash_table, output_block::string_stream, and output_block::writer_cache.
Referenced by inline_write_summary(), ipa_prop_write_all_agg_replacement(), ipa_prop_write_jump_functions(), lto_output_toplevel_asms(), output_cgraph_opt_summary(), output_function(), and produce_asm_for_decls().
void destroy_output_block | ( | ) |
Destroy the output block OB.
References output_block::cfg_stream, hash_table< Descriptor, Allocator >::dispose(), free(), LTO_section_function_body, output_block::main_stream, output_block::obstack, output_block::section_type, streamer_tree_cache_delete(), output_block::string_hash_table, output_block::string_stream, and output_block::writer_cache.
Referenced by inline_write_summary(), ipa_prop_write_all_agg_replacement(), ipa_prop_write_jump_functions(), lto_output_toplevel_asms(), output_cgraph_opt_summary(), output_function(), and produce_asm_for_decls().
|
static |
DFS walk EXPR and stream SCCs of tree bodies if they are not already in the streamer cache. Main routine called for each visit of EXPR.
References DFS_write_tree_body(), sccs::dfsnum, first, get_symbol_initial_value(), hash_scc(), internal_error(), sccs::low, lto_is_streamable(), lto_output_tree_1(), LTO_tree_scc, lto_write_tree_1(), next_dfs_num, streamer_tree_cache_d::nodes, pointer_map_insert(), sccstate_obstack, streamer_handle_as_builtin_p(), streamer_tree_cache_insert(), streamer_tree_cache_lookup(), streamer_write_record_start(), streamer_write_tree_header(), streamer_write_uhwi(), streamer_write_zero(), tree_code_name, tree_is_indexable(), and output_block::writer_cache.
Referenced by lto_output_tree().
|
static |
Handle the tree EXPR in the DFS walk with SCC state EXPR_STATE and DFS recurse for all tree edges originating from it.
References block_ultimate_origin(), and inlined_function_outer_scope_p().
Referenced by DFS_write_tree().
|
static |
For EXPR lookup and return what we want to stream to OB as DECL_INITIAL.
References output_block::decl_state, lto_symtab_encoder_encode_initializer_p(), lto_out_decl_state::symtab_node_encoder, and varpool_get_node().
Referenced by DFS_write_tree(), and lto_write_tree_1().
|
static |
Return a hash value for the SCC on the SCC stack from FIRST with size SIZE.
References first, hash_tree(), iterative_hash_hashval_t(), and scc_entry_compare().
Referenced by DFS_write_tree().
|
static |
Return a hash value for the tree T.
References FIXED_VALUE_TYPE, get_alias_set(), iterative_hash_hashval_t(), iterative_hash_host_wide_int(), NOT_BUILT_IN, streamer_tree_cache_get_hash(), streamer_tree_cache_lookup(), and strlen().
Referenced by hash_scc().
|
inlinestatic |
Return true if EXPR is a tree node that can be written to disk.
References is_lang_specific(), and tcc_statement.
Referenced by DFS_write_tree(), and lto_write_tree().
|
static |
Return the written size of STATE.
References LTO_N_DECL_STREAMS, lto_tree_ref_encoder_size(), and lto_out_decl_state::streams.
Referenced by produce_asm_for_decls().
|
static |
Main entry point from the pass manager.
References symtab_node_base::alias, bitmap_bit_p(), bitmap_set_bit(), copy_function(), symtab_node_base::decl, dyn_cast(), gimple_has_body_p(), lto_bitmap_alloc(), lto_bitmap_free(), lto_get_out_decl_state(), lto_new_out_decl_state(), lto_pop_out_decl_state(), lto_push_out_decl_state(), lto_record_function_out_decl_state(), lto_streamer_init(), lto_symtab_encoder_deref(), lto_symtab_encoder_encode_body_p(), lto_symtab_encoder_size(), output_function(), output_symtab(), cgraph_node::symbol, lto_out_decl_state::symtab_node_encoder, cgraph_node::thunk, and cgraph_thunk_info::thunk_p.
void lto_output_decl_state_refs | ( | struct output_block * | ob, |
struct lto_output_stream * | out_stream, | ||
struct lto_out_decl_state * | state | ||
) |
Write all the references in an lto_out_decl_state STATE using output block OB and output stream OUT_STREAM.
References lto_out_decl_state::fn_decl, LTO_N_DECL_STREAMS, lto_output_data_stream(), streamer_tree_cache_lookup(), lto_out_decl_state::streams, write_global_references(), and output_block::writer_cache.
Referenced by produce_asm_for_decls().
void lto_output_decl_state_streams | ( | struct output_block * | ob, |
struct lto_out_decl_state * | state | ||
) |
Write all the streams in an lto_out_decl_state STATE using output block OB and output stream OUT_STREAM.
References LTO_N_DECL_STREAMS, lto_out_decl_state::streams, and write_global_stream().
Referenced by produce_asm_for_decls().
void lto_output_location | ( | struct output_block * | ob, |
struct bitpack_d * | bp, | ||
location_t | loc | ||
) |
Output info about new location into bitpack BP. After outputting bitpack, lto_output_location_data has to be done to output actual data.
References bp_pack_value(), bp_pack_var_len_unsigned(), output_block::current_col, output_block::current_file, output_block::current_line, expand_location(), streamer_string_index(), and strlen().
Referenced by lto_streamer_hooks_init().
void lto_output_toplevel_asms | ( | void | ) |
Emit toplevel asms.
References asm_nodes, asm_node::asm_str, create_output_block(), destroy_output_block(), free(), lto_begin_section(), lto_end_section(), lto_get_section_name(), lto_asm_header::lto_header, lto_output_data_stream(), LTO_section_asm, lto_write_stream(), lto_asm_header::main_size, output_block::main_stream, lto_header::major_version, memset(), lto_header::minor_version, asm_node::next, asm_node::order, streamer_write_char_stream(), streamer_write_hwi(), streamer_write_string_cst(), lto_asm_header::string_size, output_block::string_stream, and lto_output_stream::total_size.
Referenced by output_symtab().
void lto_output_tree | ( | struct output_block * | ob, |
tree | expr, | ||
bool | ref_p, | ||
bool | this_ref_p | ||
) |
Emit the physical representation of tree node EXPR to output block OB. If THIS_REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. REF_P is used for streaming siblings of EXPR.
References DFS_write_tree(), LTO_null, LTO_NUM_TAGS, lto_output_tree_ref(), lto_stats, lto_tree_code_to_tag(), LTO_tree_pickle_reference, output_block::main_stream, next_dfs_num, lto_stats_d::num_pickle_refs_output, pointer_map_create(), pointer_map_destroy(), sccstate_obstack, streamer_tree_cache_lookup(), streamer_write_record_start(), streamer_write_uhwi(), tree_is_indexable(), and output_block::writer_cache.
Referenced by lto_streamer_hooks_init().
|
static |
Emit the physical representation of tree node EXPR to output block OB. If THIS_REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. REF_P is used for streaming siblings of EXPR.
References lto_write_tree(), streamer_handle_as_builtin_p(), streamer_tree_cache_insert(), streamer_write_builtin(), streamer_write_integer_cst(), tree_is_indexable(), and output_block::writer_cache.
Referenced by DFS_write_tree().
|
static |
If EXPR is an indexable tree node, output a reference to it to output block OB. Otherwise, output the physical representation of EXPR to OB.
References decl_function_context(), output_block::decl_state, LTO_const_decl_ref, LTO_field_decl_ref, LTO_function_decl_ref, LTO_global_decl_ref, LTO_imported_decl_ref, LTO_label_decl_ref, LTO_namespace_decl_ref, lto_output_field_decl_index(), lto_output_fn_decl_index(), lto_output_namespace_decl_index(), lto_output_type_decl_index(), lto_output_var_decl_index(), LTO_result_decl_ref, LTO_ssa_name_ref, LTO_translation_unit_decl_ref, LTO_type_decl_ref, output_block::main_stream, output_type_ref(), streamer_write_record_start(), and streamer_write_uhwi().
Referenced by lto_output_tree().
|
static |
Write a physical representation of tree node EXPR to output block OB. If REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. IX is the index into the streamer cache where EXPR is stored.
References internal_error(), lto_is_streamable(), lto_write_tree_1(), streamer_write_tree_header(), streamer_write_zero(), and tree_code_name.
Referenced by lto_output_tree_1().
|
static |
Write a physical representation of tree node EXPR to output block OB. If REF_P is true, the leaves of EXPR are emitted as references via lto_output_tree_ref. IX is the index into the streamer cache where EXPR is stored.
References bitpack_create(), get_symbol_initial_value(), output_block::main_stream, streamer_pack_tree_bitfields(), streamer_write_bitpack(), and streamer_write_tree_body().
Referenced by DFS_write_tree(), and lto_write_tree().
ipa_opt_pass_d* make_pass_ipa_lto_finish_out | ( | ) |
ipa_opt_pass_d* make_pass_ipa_lto_gimple_out | ( | ) |
|
static |
Output the cfg.
References loop::any_estimate, loop::any_upper_bound, output_block::cfg_stream, cfun, edge_def::count, edge_def::dest, EST_LAST, loop::estimate_state, edge_def::flags, get_loop(), loop::header, double_int::high, basic_block_def::index, double_int::low, output_block::main_stream, loop::nb_iterations_estimate, loop::nb_iterations_upper_bound, basic_block_def::next_bb, number_of_loops(), edge_def::probability, PROFILE_LAST, streamer_write_gcov_count(), streamer_write_hwi(), streamer_write_uhwi(), and basic_block_def::succs.
Referenced by output_function().
|
static |
Output landing pad LP to OB.
References eh_landing_pad_d::index, eh_region_d::index, LTO_eh_landing_pad, LTO_null, eh_landing_pad_d::next_lp, eh_landing_pad_d::post_landing_pad, eh_landing_pad_d::region, streamer_write_hwi(), streamer_write_record_start(), and streamer_write_zero().
Referenced by output_eh_regions().
|
static |
Output EH region R in function FN to OB. CURR_RN is the slot index that is being emitted in FN->EH->REGION_ARRAY. This is used to detect EH region sharing.
References eh_region_d::eh_region_u::allowed, bitpack_create(), eh_region_d::eh_region_u::eh_try, ERT_ALLOWED_EXCEPTIONS, ERT_CLEANUP, ERT_MUST_NOT_THROW, ERT_TRY, eh_region_d::eh_region_u::eh_region_u_must_not_throw::failure_decl, eh_region_d::eh_region_u::eh_region_u_must_not_throw::failure_loc, eh_region_d::eh_region_u::eh_region_u_allowed::filter, eh_region_d::eh_region_u::eh_region_u_try::first_catch, eh_landing_pad_d::index, eh_region_d::index, eh_region_d::inner, eh_region_d::eh_region_u::eh_region_u_allowed::label, eh_region_d::landing_pads, LTO_ert_allowed_exceptions, LTO_ert_cleanup, LTO_ert_must_not_throw, LTO_ert_try, LTO_null, output_block::main_stream, eh_region_d::eh_region_u::must_not_throw, eh_region_d::next_peer, eh_region_d::outer, output_eh_try_list(), streamer_write_bitpack(), streamer_write_hwi(), streamer_write_record_start(), streamer_write_uhwi(), streamer_write_zero(), eh_region_d::type, eh_region_d::eh_region_u::eh_region_u_allowed::type_list, and eh_region_d::u.
Referenced by output_eh_regions().
|
static |
Output the existing eh_table to OB.
References LTO_eh_table, LTO_null, output_block::main_stream, output_eh_lp(), output_eh_region(), streamer_write_char_stream(), streamer_write_hwi(), streamer_write_record_start(), targetm, and vec_safe_length().
Referenced by output_function().
|
static |
Output to OB a list of try/catch handlers starting with FIRST.
References eh_catch_d::filter_list, eh_catch_d::label, LTO_eh_catch, LTO_null, eh_catch_d::next_catch, streamer_write_record_start(), and eh_catch_d::type_list.
Referenced by output_eh_region().
|
static |
Output the body of function NODE->DECL.
References cfun, output_block::cgraph_node, clear_line_info(), create_output_block(), current_function_decl, symtab_node_base::decl, destroy_output_block(), gimple_has_body_p(), gimple_phi_result(), gimple_set_uid(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), inc_gimple_stmt_max_uid(), LTO_function, LTO_null, LTO_section_function_body, output_bb(), output_cfg(), output_eh_regions(), output_ssa_names(), output_struct_function_base(), pop_cfun(), produce_asm(), push_cfun(), set_gimple_stmt_max_uid(), streamer_write_chain(), streamer_write_char_stream(), streamer_write_record_start(), streamer_write_uhwi(), output_block::string_stream, cgraph_node::symbol, and virtual_operand_p().
Referenced by lto_output().
|
static |
Output all of the active ssa names to the ssa_names stream.
References len, output_block::main_stream, streamer_write_char_stream(), streamer_write_uhwi(), streamer_write_zero(), vec_safe_length(), and virtual_operand_p().
Referenced by output_function().
|
static |
Output the base body of struct function FN using output block OB.
References bitpack_create(), bp_pack_value(), output_block::main_stream, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_uhwi(), and vec_safe_length().
Referenced by output_function().
bool output_symbol_p | ( | ) |
Return true if NODE should appear in the plugin symbol table.
References cgraph_node::callers, symtab_node_base::decl, dyn_cast(), IPA_REF_ALIAS, ipa_ref::referring, cgraph_node::symbol, and symtab_real_symbol_p().
Referenced by produce_symtab().
|
static |
Look up NODE in the type table and write the index for it to OB.
References output_block::decl_state, lto_output_type_ref_index(), LTO_type_ref, output_block::main_stream, and streamer_write_record_start().
Referenced by lto_output_tree_ref().
void produce_asm | ( | ) |
Create the header in the file using OB. If the section type is for a function, set FN to the decl for that function.
References lto_function_header::cfg_size, output_block::cfg_stream, lto_function_header::compressed_size, free(), lto_begin_section(), lto_end_section(), lto_get_section_name(), lto_function_header::lto_header, lto_output_data_stream(), LTO_section_function_body, lto_write_stream(), lto_function_header::main_size, output_block::main_stream, lto_header::major_version, memset(), lto_header::minor_version, output_block::section_type, lto_function_header::string_size, output_block::string_stream, and lto_output_stream::total_size.
Referenced by inline_write_summary(), ipa_prop_write_all_agg_replacement(), ipa_prop_write_jump_functions(), output_cgraph_opt_summary(), and output_function().
|
static |
This pass is run after all of the functions are serialized and all of the IPA passes have written their serialized forms. This pass causes the vector of all of the global decls and types used from this file to be written in to a section that can then be read in to recover these on other side.
References alias_pairs, create_output_block(), output_block::decl_state, lto_decl_header::decl_state_size, destroy_output_block(), free(), output_block::global, lto_begin_section(), lto_delete_out_decl_state(), lto_end_section(), lto_function_decl_states, lto_get_out_decl_state(), lto_get_section_name(), lto_decl_header::lto_header, lto_out_decl_state_written_size(), lto_output_data_stream(), lto_output_decl_state_refs(), lto_output_decl_state_streams(), LTO_section_decls, lto_symtab_encoder_delete(), lto_write_options(), lto_write_stream(), lto_decl_header::main_size, output_block::main_stream, lto_header::major_version, memset(), lto_header::minor_version, lto_decl_header::num_nodes, produce_symtab(), streamer_write_char_stream(), lto_decl_header::string_size, output_block::string_stream, lto_out_decl_state::symtab_node_encoder, and lto_output_stream::total_size.
|
static |
Write an IL symbol table to OB. SET and VSET are cgraph/varpool node sets we are outputting.
References cache, output_block::decl_state, free(), lsei_end_p(), lsei_next(), lsei_node(), lsei_start(), lto_begin_section(), lto_end_section(), lto_get_section_name(), LTO_section_symtab, lto_write_stream(), memset(), output_symbol_p(), pointer_set_create(), pointer_set_destroy(), lto_out_decl_state::symtab_node_encoder, write_symbol(), and output_block::writer_cache.
Referenced by produce_asm_for_decls().
|
static |
Compare two SCC entries by their hash value for qsorting them.
References scc_entry::hash.
Referenced by hash_scc().
|
static |
Return true if tree node T is written to various tables. For these nodes, we sometimes want to write their phyiscal representation (via lto_output_tree), and sometimes we need to emit an index reference into a table (via lto_output_tree_ref).
References decl_function_context(), and variably_modified_type_p().
Referenced by DFS_write_tree(), lto_output_tree(), and lto_output_tree_1().
|
static |
Write a sequence of indices into the globals vector corresponding to the trees in ENCODER. These are used by the reader to map the indices used to refer to global entities within function bodies to their referents.
References lto_output_data_stream(), lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), streamer_tree_cache_lookup(), and output_block::writer_cache.
Referenced by lto_output_decl_state_refs().
|
static |
Write each node in encoded by ENCODER to OB, as well as those reachable from it and required for correct representation of its semantics. Each node in ENCODER must be a global declaration or a type. A node is written only once, even if it appears multiple times in the vector. Certain transitively-reachable nodes, such as those representing expressions, may be duplicated, but such nodes must not appear in ENCODER itself.
References lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), streamer_tree_cache_lookup(), and output_block::writer_cache.
Referenced by lto_output_decl_state_streams().
|
static |
Write symbol T into STREAM in CACHE. SEEN specifies symbols we wrote so far.
References cgraph_get_node(), HOST_WIDEST_INT, is_builtin_fn(), lto_output_data_stream(), pointer_set_contains(), pointer_set_insert(), streamer_tree_cache_lookup(), strlen(), targetm, varpool_get_node(), VISIBILITY_DEFAULT, VISIBILITY_HIDDEN, VISIBILITY_INTERNAL, and VISIBILITY_PROTECTED.
Referenced by produce_symtab().
|
static |
Referenced by DFS_write_tree(), and lto_output_tree().
|
static |
|
static |
Referenced by DFS_write_tree(), and lto_output_tree().