GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "cgraph.h"
#include "lto-streamer.h"
#include "lto-compress.h"
Data Structures | |
struct | lto_buffer |
struct | lto_data_header |
struct | lto_renaming_slot |
Functions | |
void | lto_set_in_hooks (struct lto_file_decl_data **data, lto_get_section_data_f *get_f, lto_free_section_data_f *free_f) |
struct lto_file_decl_data ** | lto_get_file_decl_data (void) |
static void | lto_append_data (const char *data, unsigned length, void *opaque) |
const char * | lto_get_section_data (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char *name, int order, size_t *len, bool decompress) |
const char * | lto_get_summary_section_data (struct lto_file_decl_data *file_data, enum lto_section_type section_type, size_t *len) |
const char * | lto_get_raw_section_data (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char *name, int order, size_t *len) |
void | lto_free_section_data (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char *name, const char *data, size_t len, bool decompress) |
void | lto_free_raw_section_data (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char *name, const char *data, size_t len) |
class lto_input_block * | lto_create_simple_input_block (struct lto_file_decl_data *file_data, enum lto_section_type section_type, const char **datar, size_t *len) |
void | lto_destroy_simple_input_block (struct lto_file_decl_data *file_data, enum lto_section_type section_type, class lto_input_block *ib, const char *data, size_t len) |
static hashval_t | hash_name (const void *p) |
static int | eq_name (const void *p1, const void *p2) |
static void | renaming_slot_free (void *slot) |
htab_t | lto_create_renaming_table (void) |
void | lto_record_renamed_decl (struct lto_file_decl_data *decl_data, const char *old_name, const char *new_name) |
const char * | lto_get_decl_name_mapping (struct lto_file_decl_data *decl_data, const char *name) |
struct lto_in_decl_state * | lto_new_in_decl_state (void) |
void | lto_delete_in_decl_state (struct lto_in_decl_state *state) |
struct lto_in_decl_state * | lto_get_function_in_decl_state (struct lto_file_decl_data *file_data, tree func) |
void | lto_free_function_in_decl_state (struct lto_in_decl_state *state) |
void | lto_free_function_in_decl_state_for_node (symtab_node *node) |
void | lto_section_overrun (class lto_input_block *ib) |
void | lto_value_range_error (const char *purpose, HOST_WIDE_INT val, HOST_WIDE_INT min, HOST_WIDE_INT max) |
Variables | |
const char * | lto_section_name [LTO_N_SECTION_TYPES] |
static struct lto_file_decl_data ** | file_decl_data |
static lto_get_section_data_f * | get_section_f |
static lto_free_section_data_f * | free_section_f |
|
static |
Returns nonzero if P1 and P2 are equal.
References lto_renaming_slot::new_name.
Referenced by lto_create_renaming_table().
|
static |
Returns a hash code for P.
References lto_renaming_slot::new_name.
Referenced by lto_create_renaming_table().
|
static |
Compression callback, append LENGTH bytes from DATA to the buffer pointed to by OPAQUE.
References lto_buffer::data, and lto_buffer::length.
Referenced by lto_get_section_data().
htab_t lto_create_renaming_table | ( | void | ) |
Create an empty hash table for recording declaration renamings.
References eq_name(), hash_name(), and renaming_slot_free().
class lto_input_block * lto_create_simple_input_block | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
const char ** | datar, | ||
size_t * | len ) |
Load a section of type SECTION_TYPE from FILE_DATA, parse the header and then return an input block pointing to the section. The raw pointer to the section is returned in DATAR and LEN. These are used to free the section. Return NULL if the section is not present.
References lto_input_block::file_data, lto_input_block::len, lto_get_section_data(), lto_simple_header::main_size, and NULL.
Referenced by input_offload_tables(), input_symtab(), ipa_profile_read_summary(), ipa_reference_read_optimization_summary(), and pure_const_read_summary().
void lto_delete_in_decl_state | ( | struct lto_in_decl_state * | state | ) |
Delete STATE and its components.
References ggc_free(), i, LTO_N_DECL_STREAMS, and vec_free().
void lto_destroy_simple_input_block | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
class lto_input_block * | ib, | ||
const char * | data, | ||
size_t | len ) |
Close the section returned from a call to LTO_CREATE_SIMPLE_INPUT_BLOCK. IB is the input block returned from that call. The FILE_DATA and SECTION_TYPE are the same as what was passed to that call and the DATA and LEN are what was returned from that call.
References lto_free_section_data(), and NULL.
Referenced by input_offload_tables(), input_symtab(), ipa_profile_read_summary(), ipa_reference_read_optimization_summary(), and pure_const_read_summary().
void lto_free_function_in_decl_state | ( | struct lto_in_decl_state * | state | ) |
Free decl_states.
References ggc_free(), i, LTO_N_DECL_STREAMS, and vec_free().
Referenced by lto_free_function_in_decl_state_for_node().
void lto_free_function_in_decl_state_for_node | ( | symtab_node * | node | ) |
Free decl_states associated with NODE. This makes it possible to furhter release trees needed by the NODE's body.
References hash_table< Descriptor, Lazy, Allocator >::clear_slot(), symtab_node::decl, hash_table< Descriptor, Lazy, Allocator >::find_slot(), lto_in_decl_state::fn_decl, lto_file_decl_data::function_decl_states, symtab_node::lto_file_data, lto_free_function_in_decl_state(), and NULL.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), cgraph_node::release_body(), cgraph_node::remove(), and varpool_node::remove().
void lto_free_raw_section_data | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
const char * | name, | ||
const char * | data, | ||
size_t | len ) |
Free data allocated by lto_get_raw_section_data.
References free_section_f, and lto_data_header::len.
Referenced by copy_function_or_variable().
void lto_free_section_data | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
const char * | name, | ||
const char * | data, | ||
size_t | len, | ||
bool | decompress ) |
Free the data found from the above call. The first three parameters are the same as above. DATA is the data to be freed and LEN is the length of that data.
References CONST_CAST, lto_data_header::data, free(), free_section_f, gcc_assert, and lto_data_header::len.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), inline_read_section(), input_cgraph_opt_section(), ipa_odr_read_section(), ipa_prop_read_section(), lto_destroy_simple_input_block(), lto_input_mode_table(), lto_input_toplevel_asms(), read_replacements_section(), and ipa_icf::sem_item_optimizer::read_section().
const char * lto_get_decl_name_mapping | ( | struct lto_file_decl_data * | decl_data, |
const char * | name ) |
Given a string NAME, return the string that it has been mapped to by lto_record_renamed_decl. If NAME was not renamed, it is returned unchanged. DECL_DATA holds the renaming hash table to use.
References lto_renaming_slot::new_name, and lto_file_decl_data::renaming_hash_table.
Referenced by copy_function_or_variable(), varpool_node::get_constructor(), and cgraph_node::get_untransformed_body().
struct lto_file_decl_data ** lto_get_file_decl_data | ( | void | ) |
Return an array of file decl datas for all of the files passed to this compilation.
References file_decl_data, and gcc_assert.
Referenced by input_cgraph_opt_summary(), input_offload_tables(), input_symtab(), ipa_fn_summary_read(), ipa_odr_summary_read(), ipa_profile_read_summary(), ipa_prop_read_jump_functions(), ipa_reference_read_optimization_summary(), ipcp_read_transformation_summaries(), pure_const_read_summary(), and ipa_icf::sem_item_optimizer::read_summary().
struct lto_in_decl_state * lto_get_function_in_decl_state | ( | struct lto_file_decl_data * | file_data, |
tree | func ) |
Search the in-decl state of a function FUNC contained in the file associated with FILE_DATA. Return NULL if not found.
References hash_table< Descriptor, Lazy, Allocator >::find_slot(), lto_in_decl_state::fn_decl, lto_file_decl_data::function_decl_states, and NULL.
Referenced by copy_function_or_variable(), varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), and lto_read_body_or_constructor().
const char * lto_get_raw_section_data | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
const char * | name, | ||
int | order, | ||
size_t * | len ) |
Get the section data without any header parsing or uncompression.
References get_section_f, and lto_data_header::len.
Referenced by copy_function_or_variable().
const char * lto_get_section_data | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
const char * | name, | ||
int | order, | ||
size_t * | len, | ||
bool | decompress ) |
Return a char pointer to the start of a data stream for an LTO pass or function. FILE_DATA indicates where to obtain the data. SECTION_TYPE is the type of information to be obtained. NAME is the name of the function and is only used when finding a function body; otherwise it is NULL. LEN is the size of the data returned.
References lto_buffer::data, lto_data_header::data, lto_section::get_compression(), get_section_f, lto_data_header::len, lto_buffer::length, lto_append_data(), lto_end_uncompression(), lto_file_decl_data::lto_section_header, LTO_section_lto, lto_start_uncompression(), lto_stats, lto_uncompress_block(), NULL, and lto_stats_d::section_size.
Referenced by varpool_node::get_constructor(), cgraph_node::get_untransformed_body(), lto_create_simple_input_block(), and lto_get_summary_section_data().
const char * lto_get_summary_section_data | ( | struct lto_file_decl_data * | file_data, |
enum lto_section_type | section_type, | ||
size_t * | len ) |
Return a char pointer to the start of a data stream for an LTO pass. FILE_DATA indicates where to obtain the data. SECTION_TYPE is the type of information to be obtained. LEN is the size of the data returned.
References lto_data_header::len, lto_get_section_data(), and NULL.
Referenced by input_cgraph_opt_summary(), ipa_fn_summary_read(), ipa_odr_summary_read(), ipa_prop_read_jump_functions(), ipcp_read_transformation_summaries(), lto_input_mode_table(), lto_input_toplevel_asms(), and ipa_icf::sem_item_optimizer::read_summary().
struct lto_in_decl_state * lto_new_in_decl_state | ( | void | ) |
Input decl state object.
Return a newly created in-decl state object.
References ggc_cleared_alloc().
void lto_record_renamed_decl | ( | struct lto_file_decl_data * | decl_data, |
const char * | old_name, | ||
const char * | new_name ) |
Record a declaration name mapping OLD_NAME -> NEW_NAME. DECL_DATA holds the renaming hash table to use.
References gcc_unreachable, lto_renaming_slot::new_name, NULL, lto_renaming_slot::old_name, and lto_file_decl_data::renaming_hash_table.
void lto_section_overrun | ( | class lto_input_block * | ib | ) |
Report read pass end of the section.
References fatal_error(), input_location, lto_input_block::len, and lto_input_block::p.
Referenced by read_identifier(), read_string(), streamer_read_uchar(), and streamer_read_uhwi().
void lto_set_in_hooks | ( | struct lto_file_decl_data ** | data, |
lto_get_section_data_f * | get_f, | ||
lto_free_section_data_f * | free_f ) |
This is called from the lto front end to set up the hooks that are used by the ipa passes to get the data that they will deserialize.
References file_decl_data, free_section_f, and get_section_f.
void lto_value_range_error | ( | const char * | purpose, |
HOST_WIDE_INT | val, | ||
HOST_WIDE_INT | min, | ||
HOST_WIDE_INT | max ) |
Report out of range value.
References fatal_error(), and input_location.
Referenced by bp_unpack_int_in_range(), and streamer_read_hwi_in_range().
|
static |
Free a renaming table entry.
References CONST_CAST, free(), lto_renaming_slot::new_name, and lto_renaming_slot::old_name.
Referenced by lto_create_renaming_table().
|
static |
Hooks so that the ipa passes can call into the lto front end to get sections.
Referenced by lto_get_file_decl_data(), and lto_set_in_hooks().
|
static |
Referenced by lto_free_raw_section_data(), lto_free_section_data(), and lto_set_in_hooks().
|
static |
Referenced by lto_get_raw_section_data(), lto_get_section_data(), and lto_set_in_hooks().
const char* lto_section_name[LTO_N_SECTION_TYPES] |
Input functions for reading LTO sections. Copyright (C) 2009-2024 Free Software Foundation, Inc. Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> 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/>.
Section names. These must correspond to the values of enum lto_section_type.
Referenced by create_output_block(), lto_get_section_name(), lto_write_tree_1(), print_lto_report(), and streamer_write_tree_header().