GCC Middle and Back End API Reference
lto-section-out.cc File 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 "data-streamer.h"
#include "langhooks.h"
#include "lto-compress.h"
#include "print-tree.h"
Include dependency graph for lto-section-out.cc:

Functions

static void lto_append_data (const char *chars, unsigned int num_chars, void *opaque)
void lto_begin_section (const char *name, bool compress)
void lto_end_section (void)
void lto_write_data (const void *data, unsigned int size)
void lto_write_raw_data (const void *data, unsigned int size)
void lto_write_stream (struct lto_output_stream *obs)
struct lto_simple_output_blocklto_create_simple_output_block (enum lto_section_type section_type)
void lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
struct lto_out_decl_statelto_new_out_decl_state (void)
void lto_delete_out_decl_state (struct lto_out_decl_state *state)
struct lto_out_decl_statelto_get_out_decl_state (void)
void lto_push_out_decl_state (struct lto_out_decl_state *state)
struct lto_out_decl_statelto_pop_out_decl_state (void)
void lto_record_function_out_decl_state (tree fn_decl, struct lto_out_decl_state *state)

Variables

static vec< lto_out_decl_state_ptrdecl_state_stack
vec< lto_out_decl_state_ptrlto_function_decl_states
static struct lto_compression_streamcompression_stream = NULL

Function Documentation

◆ lto_append_data()

void lto_append_data ( const char * chars,
unsigned int num_chars,
void * opaque )
static
Flush compressed stream data function, sends NUM_CHARS from CHARS to the append lang hook, OPAQUE is currently always NULL.

References lang_hooks_for_lto::append_data, gcc_assert, lang_hooks::lto, and NULL.

◆ lto_begin_section()

◆ lto_create_simple_output_block()

◆ lto_delete_out_decl_state()

void lto_delete_out_decl_state ( struct lto_out_decl_state * state)

◆ lto_destroy_simple_output_block()

◆ lto_end_section()

◆ lto_get_out_decl_state()

◆ lto_new_out_decl_state()

struct lto_out_decl_state * lto_new_out_decl_state ( void )
Return a new lto_out_decl_state.

References i, lto_init_tree_ref_encoder(), and LTO_N_DECL_STREAMS.

Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and lto_output().

◆ lto_pop_out_decl_state()

struct lto_out_decl_state * lto_pop_out_decl_state ( void )
Pop the currently used out-decl state from top of stack.

References decl_state_stack.

Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and lto_output().

◆ lto_push_out_decl_state()

void lto_push_out_decl_state ( struct lto_out_decl_state * state)
Push STATE to top of out decl stack.

References decl_state_stack.

Referenced by ipa_write_optimization_summaries(), ipa_write_summaries_1(), and lto_output().

◆ lto_record_function_out_decl_state()

void lto_record_function_out_decl_state ( tree fn_decl,
struct lto_out_decl_state * state )
Record STATE after it has been used in serializing the body of FN_DECL. STATE should no longer be used by the caller. The ownership of it is taken over from this point.

References lto_out_decl_state::fn_decl, i, lto_function_decl_states, LTO_N_DECL_STREAMS, and NULL.

Referenced by lto_output().

◆ lto_write_data()

◆ lto_write_raw_data()

void lto_write_raw_data ( const void * data,
unsigned int size )
Write SIZE bytes starting at DATA to the assembler.

References lang_hooks_for_lto::append_data, lang_hooks::lto, and NULL.

Referenced by copy_function_or_variable().

◆ lto_write_stream()

Variable Documentation

◆ compression_stream

struct lto_compression_stream* compression_stream = NULL
static
Pointer to the current compression stream.

Referenced by lto_begin_section(), lto_end_section(), lto_write_data(), and lto_write_stream().

◆ decl_state_stack

vec<lto_out_decl_state_ptr> decl_state_stack
static
Functions for writing LTO sections. Copyright (C) 2009-2025 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/>.

Referenced by lto_get_out_decl_state(), lto_pop_out_decl_state(), and lto_push_out_decl_state().

◆ lto_function_decl_states

vec<lto_out_decl_state_ptr> lto_function_decl_states
List of out decl states used by functions. We use this to generate the decl directory later.

Referenced by cl_optimization_stream_in(), lto_record_function_out_decl_state(), and produce_asm_for_decls().