GCC Middle and Back End API Reference
toplev.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  toplev
 

Functions

void rest_of_decl_compilation (tree, int, int)
 
void rest_of_type_compilation (tree, int)
 
void init_optimization_passes (void)
 
bool enable_rtl_dump_file (void)
 
void init_eh (void)
 
void announce_function (tree)
 
void wrapup_global_declaration_1 (tree)
 
bool wrapup_global_declaration_2 (tree)
 
bool wrapup_global_declarations (tree *, int)
 
void global_decl_processing (void)
 
void dump_memory_report (const char *)
 
void dump_profile_report (void)
 
void target_reinit (void)
 
void print_version (FILE *, const char *, bool)
 
const char * get_src_pwd (void)
 
bool set_src_pwd (const char *)
 
HOST_WIDE_INT get_random_seed (bool)
 
void set_random_seed (const char *)
 
void parse_alignment_opts (void)
 
void initialize_rtl (void)
 

Variables

struct cl_decoded_optionsave_decoded_options
 
unsigned int save_decoded_options_count
 
vec< cl_decoded_option > * save_opt_decoded_options
 
unsigned local_tick
 
int flag_rerun_cse_after_global_opts
 
struct ht * ident_hash
 
struct ht * ident_hash_extra
 

Function Documentation

◆ announce_function()

void announce_function ( tree decl)
extern
Called when the start of a function definition is parsed,
this function prints on stderr the name of the function.   

References DECL_NAME, lang_hooks::decl_printable_name, diagnostic_set_last_function, global_dc, IDENTIFIER_POINTER, identifier_to_locale(), diagnostic_context::m_printer, NULL, and pp_needs_newline().

Referenced by cgraph_node::expand().

◆ dump_memory_report()

◆ dump_profile_report()

void dump_profile_report ( void )
extern
Output profile consistency.   

References gcc::pass_manager::dump_profile_report(), g, and gcc::context::get_passes().

Referenced by finalize().

◆ enable_rtl_dump_file()

bool enable_rtl_dump_file ( void )
extern
Enable RTL dump for all the RTL passes.   

References DK_rtl, gcc::dump_manager::dump_enable_all(), g, gcc::context::get_dumps(), NULL, TDF_BLOCKS, and TDF_DETAILS.

Referenced by handle_common_deferred_options().

◆ get_random_seed()

HOST_WIDE_INT get_random_seed ( bool noinit)
extern
Functions used to manipulate the random seed.   
Obtain the random_seed.  Unless NOINIT, initialize it if
it's not provided in the command line.   

References local_tick, O_RDONLY, and random_seed.

Referenced by get_file_function_name(), and lto_get_section_name().

◆ get_src_pwd()

const char * get_src_pwd ( void )
extern
Functions used to get and set GCC's notion of in what directory
compilation was started.   
Return the directory from which the translation unit was initiated,
in case set_src_pwd() was not called before to assign it a
different value.   

References src_pwd.

Referenced by comp_dir_string(), ctf_add_cuname(), lto_location_cache::input_location_and_block(), and lto_output_location_1().

◆ global_decl_processing()

void global_decl_processing ( void )
extern
Generic global declaration processing.  This is meant to be called
by the front-ends at the end of parsing.  C/C++ do their own thing,
but other front-ends may call this.   

References DECL_CHAIN, lang_hooks::decls, free(), lang_hooks_for_decls::getdecls, i, list_length(), timevar_start(), timevar_stop(), and wrapup_global_declarations().

◆ init_eh()

◆ init_optimization_passes()

void init_optimization_passes ( void )
extern

◆ initialize_rtl()

◆ parse_alignment_opts()

void parse_alignment_opts ( void )
extern
Process -falign-foo=N[:M[:N2[:M2]]] options.   

References align_functions, align_jumps, align_labels, align_loops, and parse_N_M().

Referenced by invoke_set_current_function_hook().

◆ print_version()

void print_version ( FILE * file,
const char * indent,
bool show_global_state )
extern
Print version information to FILE.
Each line begins with INDENT (for the case where FILE is the
assembler output file).

If SHOW_GLOBAL_STATE is true (for cc1 etc), we are within the compiler
proper and can print pertinent state (e.g. params and plugins).

If SHOW_GLOBAL_STATE is false (for use by libgccjit), we are outside the
compiler, and we don't hold the mutex on the compiler's global state:
we can't print params and plugins, since they might not be initialized,
or might be being manipulated by a compile running in another
thread.   

References _, __VERSION__, GCC_GMP_STRINGIFY_VERSION, N_, lang_hooks::name, and print_plugins_versions().

◆ rest_of_decl_compilation()

void rest_of_decl_compilation ( tree decl,
int top_level,
int at_end )
extern
This is called from various places for FUNCTION_DECL, VAR_DECL,
and TYPE_DECL nodes.

This does nothing for local (non-static) variables, unless the
variable is a register variable with DECL_ASSEMBLER_NAME set.  In
that case, or if the variable is not an automatic, it sets up the
RTL and outputs any assembler code (label definition, storage
allocation and initialization).

DECL is the declaration.  TOP_LEVEL is nonzero
if this declaration is not within a function.   

References asm_out_file, assemble_alias(), BUILTINS_LOCATION, current_function_decl, debug_hooks, DECL_ASSEMBLER_NAME_SET_P, DECL_ATTRIBUTES, DECL_DEFER_OUTPUT, DECL_EXTERNAL, decl_function_context(), DECL_HAS_VALUE_EXPR_P, DECL_INITIAL, DECL_REGISTER, DECL_SAVED_TREE, DECL_SOURCE_LOCATION, DECL_STRUCT_FUNCTION, decl_type_context(), gcc_debug_hooks::early_global_decl, finalize(), varpool_node::finalize_decl(), varpool_node::get_create(), get_identifier(), HAS_DECL_ASSEMBLER_NAME_P, last_assemble_variable_decl, lookup_attribute(), make_decl_rtl(), NULL, seen_error(), targetm, timevar_pop(), timevar_push(), TREE_CODE, TREE_STATIC, TREE_STRING_POINTER, TREE_VALUE, gcc_debug_hooks::type_decl, and VAR_P.

Referenced by expand_one_hard_reg_var(), and wrapup_global_declaration_2().

◆ rest_of_type_compilation()

void rest_of_type_compilation ( tree type,
int toplev )
extern
Called after finishing a record, union or enumeral type.   

References debug_hooks, seen_error(), timevar_pop(), timevar_push(), gcc_debug_hooks::type_decl, and TYPE_STUB_DECL.

◆ set_random_seed()

void set_random_seed ( const char * val)
extern
Set flag_random_seed to VAL, and if non-null, reinitialize random_seed.   

References crc32_string(), flag_random_seed, and random_seed.

Referenced by handle_common_deferred_options().

◆ set_src_pwd()

bool set_src_pwd ( const char * pwd)
extern
Initialize src_pwd with the given string, and return true.  If it
was already initialized, return false.  As a special case, it may
be called with a NULL argument to test whether src_pwd has NOT been
initialized yet.   

References src_pwd.

◆ target_reinit()

void target_reinit ( void )
extern

◆ wrapup_global_declaration_1()

void wrapup_global_declaration_1 ( tree decl)
extern
A subroutine of wrapup_global_declarations.  We've come to the end of
the compilation unit.  All deferred variables should be undeferred,
and all incomplete decls should be finalized.   

References DECL_DEFER_OUTPUT, DECL_SIZE, lang_hooks::finish_incomplete_decl, HAS_DECL_ASSEMBLER_NAME_P, and VAR_P.

Referenced by wrapup_global_declarations().

◆ wrapup_global_declaration_2()

bool wrapup_global_declaration_2 ( tree decl)
extern

◆ wrapup_global_declarations()

bool wrapup_global_declarations ( tree * vec,
int len )
extern
Do any final processing required for the declarations in VEC, of
which there are LEN.  We write out inline functions and variables
that have been deferred until this point, but which are required.
Returns nonzero if anything was put out.   

References i, wrapup_global_declaration_1(), and wrapup_global_declaration_2().

Referenced by global_decl_processing().

Variable Documentation

◆ flag_rerun_cse_after_global_opts

int flag_rerun_cse_after_global_opts
extern
See toplev.cc.   
Set to non-zero if CSE should run after all GCSE optimizations are done.   

Referenced by execute_rtl_cprop(), execute_rtl_hoist(), execute_rtl_pre(), execute_rtl_store_motion(), and rest_of_clean_state().

◆ ident_hash

struct ht* ident_hash
extern
The hashtables, so that the C front ends can pass them to cpplib.   
String pool for GCC.
   Copyright (C) 2000-2024 Free Software Foundation, Inc.

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/>.   
String text, identifier text and identifier node allocator.
Identifiers are uniquely stored in a hash table.

We use cpplib's hash table implementation.  libiberty's
hashtab.c is not used because it requires 100% average space
overhead per string, which is unacceptable.  Also, this algorithm
is faster.   

Referenced by get_identifier(), get_identifier_with_length(), ggc_mark_stringpool(), ggc_purge_stringpool(), gt_pch_save_stringpool(), init_stringpool(), maybe_get_identifier(), and stringpool_statistics().

◆ ident_hash_extra

struct ht* ident_hash_extra
extern

◆ local_tick

unsigned local_tick
extern
A unique local time stamp, might be zero if none is available.   
A local time stamp derived from the time of compilation. It will be
zero if the system cannot provide a time.  It will be -1u, if the
user has specified a particular random seed.   

Referenced by coverage_finish(), coverage_init(), get_random_seed(), and init_local_tick().

◆ save_decoded_options

struct cl_decoded_option* save_decoded_options
extern
toplev.h - Various declarations for functions found in toplev.cc
   Copyright (C) 1998-2024 Free Software Foundation, Inc.

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/>.   
Decoded options, and number of such options.   
Decoded options, and number of such options.   

Referenced by toplev::finalize(), init_asm_output(), lto_write_options(), toplev::main(), and process_options().

◆ save_decoded_options_count

unsigned int save_decoded_options_count
extern

◆ save_opt_decoded_options

vec<cl_decoded_option>* save_opt_decoded_options
extern
Vector of saved Optimization decoded command line options.   

Referenced by toplev::main().