|
GCC Middle and Back End API Reference
|

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_option * | save_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 |
|
extern |
Called when the start of a function definition is parsed, this function prints on stderr the name of the function.
References announce_function(), DECL_NAME, lang_hooks::decl_printable_name, diagnostic_set_last_function, diagnostics::context::get_reference_printer(), global_dc, IDENTIFIER_POINTER, identifier_to_locale(), and pp_needs_newline().
Referenced by announce_function(), cgraph_node::expand(), and init_optimization_passes().
|
extern |
References dump_alias_stats(), dump_alloc_pool_statistics(), dump_bitmap_statistics(), dump_ggc_loc_statistics(), dump_gimple_statistics(), dump_hash_table_loc_statistics(), dump_line_table_statistics(), dump_memory_report(), dump_pta_stats(), dump_rtx_statistics(), dump_tree_statistics(), dump_vec_loc_statistics(), fputc(), ggc_print_statistics(), i, and stringpool_statistics().
Referenced by symbol_table::compile(), dump_memory_report(), finalize(), and init_optimization_passes().
|
extern |
Output profile consistency.
References dump_profile_report(), gcc::pass_manager::dump_profile_report(), g, and gcc::context::get_passes().
Referenced by dump_profile_report(), finalize(), and init_optimization_passes().
|
extern |
Enable RTL dump for all the RTL passes.
References DK_rtl, gcc::dump_manager::dump_enable_all(), enable_rtl_dump_file(), g, gcc::context::get_dumps(), NULL, TDF_BLOCKS, and TDF_DETAILS.
Referenced by enable_rtl_dump_file(), handle_common_deferred_options(), and init_optimization_passes().
|
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 get_random_seed(), local_tick, O_RDONLY, and random_seed.
Referenced by get_file_function_name(), get_random_seed(), init_optimization_passes(), and lto_get_section_name().
|
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 get_src_pwd(), and src_pwd.
Referenced by comp_dir_string(), create_loc_map(), ctf_add_cuname(), get_src_pwd(), and init_optimization_passes().
|
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, global_decl_processing(), i, list_length(), timevar_start(), timevar_stop(), and wrapup_global_declarations().
Referenced by global_decl_processing(), and init_optimization_passes().
|
extern |
In except.cc. Initialize exception handling. This is used by the Ada and LTO front ends to initialize EH "on demand". See lto-streamer-in.cc and ada/gcc-interface/misc.cc.
References BITS_PER_WORD, build_array_type(), build_decl(), build_function_type_list(), build_index_type(), build_pointer_type(), BUILTINS_LOCATION, hash_map< KeyId, Value, Traits >::create_ggc(), DECL_ASSEMBLER_NAME, DECL_EXTERNAL, DECL_FIELD_BIT_OFFSET, DECL_FIELD_CONTEXT, DECL_FIELD_OFFSET, DECL_USER_ALIGN, get_identifier(), global_options, init_eh(), integer_type_node, layout_type(), lang_hooks_for_types::make_type, NULL, POINTER_SIZE, ptr_type_node, SET_DECL_ALIGN, setjmp_fn, size_int, sjlj_fc_call_site_ofs, sjlj_fc_data_ofs, sjlj_fc_jbuf_ofs, sjlj_fc_lsda_ofs, sjlj_fc_personality_ofs, sjlj_fc_type_node, targetm, TREE_CHAIN, TREE_PUBLIC, tree_to_uhwi(), TREE_TYPE, TYPE_FIELDS, lang_hooks_for_types::type_for_mode, type_to_runtime_map, lang_hooks::types, and UI_SJLJ.
Referenced by init_eh(), init_optimization_passes(), lang_dependent_init(), and lto_init_eh().
|
extern |
References announce_function(), dump_memory_report(), dump_profile_report(), enable_rtl_dump_file(), flag_rerun_cse_after_global_opts, get_random_seed(), get_src_pwd(), global_decl_processing(), ident_hash, ident_hash_extra, init_eh(), init_optimization_passes(), initialize_rtl(), local_tick, parse_alignment_opts(), print_version(), set_random_seed(), set_src_pwd(), target_reinit(), wrapup_global_declaration_1(), wrapup_global_declaration_2(), and wrapup_global_declarations().
Referenced by init_optimization_passes().
|
extern |
References backend_init_target(), g_timer, initialize_rtl(), ira_init_once(), rtl_initialized, and this_target_rtl.
Referenced by init_function_start(), init_optimization_passes(), initialize_rtl(), read_rtl_function_body(), and read_rtl_function_body_from_file_range().
|
extern |
Process -falign-foo=N[:M[:N2[:M2]]] options.
References align_functions, align_jumps, align_labels, align_loops, parse_alignment_opts(), and parse_N_M().
Referenced by init_optimization_passes(), invoke_set_current_function_hook(), and parse_alignment_opts().
|
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, print_plugins_versions(), and print_version().
Referenced by toplev::main().
|
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, rest_of_decl_compilation(), 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(), rest_of_decl_compilation(), and wrapup_global_declaration_2().
|
extern |
Called after finishing a record, union or enumeral type.
References debug_hooks, rest_of_type_compilation(), seen_error(), timevar_pop(), timevar_push(), gcc_debug_hooks::type_decl, and TYPE_STUB_DECL.
Referenced by rest_of_type_compilation().
|
extern |
Set flag_random_seed to VAL, and if non-null, reinitialize random_seed.
References crc32_string(), flag_random_seed, random_seed, and set_random_seed().
Referenced by handle_common_deferred_options(), init_optimization_passes(), and set_random_seed().
|
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 set_src_pwd(), and src_pwd.
Referenced by init_optimization_passes(), and set_src_pwd().
|
extern |
Reinitialize everything when target parameters, such as register usage, have changed.
References crtl, global_options, global_options_set, init_emit_regs(), init_regs(), lang_dependent_init_target(), no_backend, NULL, optimization_current_node, optimization_default_node, regno_reg_rtx, target_reinit(), this_fn_optabs, this_target_rtl, and TREE_OPTIMIZATION.
Referenced by init_optimization_passes(), and target_reinit().
|
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, VAR_P, and wrapup_global_declaration_1().
Referenced by init_optimization_passes(), wrapup_global_declaration_1(), and wrapup_global_declarations().
A subroutine of wrapup_global_declarations. Decide whether or not DECL needs to be output. Return true if it is output.
References DECL_ARTIFICIAL, DECL_ASSEMBLER_NAME, DECL_COMDAT, DECL_EXTERNAL, DECL_HAS_VALUE_EXPR_P, varpool_node::get(), symbol_table::global_info_ready, rest_of_decl_compilation(), symtab, TREE_ASM_WRITTEN, TREE_PUBLIC, TREE_READONLY, TREE_STATIC, TREE_USED, VAR_P, and wrapup_global_declaration_2().
Referenced by init_optimization_passes(), wrapup_global_declaration_2(), and wrapup_global_declarations().
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(), wrapup_global_declaration_2(), and wrapup_global_declarations().
Referenced by global_decl_processing(), init_optimization_passes(), and wrapup_global_declarations().
|
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(), init_optimization_passes(), and rest_of_clean_state().
|
extern |
The hashtables, so that the C front ends can pass them to cpplib.
String pool for GCC. Copyright (C) 2000-2026 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_optimization_passes(), init_stringpool(), maybe_get_identifier(), and stringpool_statistics().
|
extern |
|
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_file(), coverage_init(), get_random_seed(), init_local_tick(), and init_optimization_passes().
|
extern |
toplev.h - Various declarations for functions found in toplev.cc Copyright (C) 1998-2026 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().
|
extern |
Referenced by toplev::finalize(), init_asm_output(), lto_write_options(), toplev::main(), and process_options().
|
extern |
Vector of saved Optimization decoded command line options.
Referenced by toplev::main().