GCC Middle and Back End API Reference
|
|
static |
A helper function: used as the allocator function for identifier_to_locale.
Referenced by general_init().
void announce_function | ( | ) |
Called when the start of a function definition is parsed, this function prints on stderr the name of the function.
References lang_hooks::decl_printable_name, global_dc, identifier_to_locale(), and diagnostic_context::printer.
Referenced by expand_function().
|
static |
Initialize the compiler back end. This function is called only once, when starting the compiler.
References backend_init_target(), init_emit_once(), init_inline_once(), init_rtlanal(), init_varasm_once(), ira_init_once(), and save_register_info().
Referenced by do_compile().
|
static |
This function can be called multiple times to reinitialize the compiler back end when register classes or instruction sets have changed, before each function.
References expand_dummy_function_end(), init_alias_target(), init_alignments(), init_dummy_function_start(), init_emit_regs(), init_expmed(), init_fake_stack_mems(), init_lower_subreg(), init_regs(), and init_reload().
Referenced by backend_init(), and target_reinit().
void check_global_declaration_1 | ( | ) |
A subroutine of check_global_declarations. Issue appropriate warnings for the global declaration DECL.
References lang_hooks::decls, input_location, pedwarn(), lang_hooks_for_decls::warn_unused_global, and warning().
Referenced by check_global_declarations().
void check_global_declarations | ( | ) |
Issue appropriate warnings for the global declarations in V (of which there are LEN).
References check_global_declaration_1(), and len.
Referenced by write_global_declarations().
|
static |
Compile an entire translation unit. Write a file of assembly output and various debugging dumps.
References asan_finish_file(), lang_hooks::decls, dw2_output_indirect_constants(), dwarf2out_do_frame(), dwarf2out_frame_finish(), lang_hooks_for_decls::final_write_globals, gcc_debug_hooks::finish, finish_tm_clone_pairs(), ggc_protect_identifiers, HOST_WIDE_INT, invoke_plugin_callbacks(), mudflap_finish_file(), output_object_blocks(), output_shared_constant_pool(), lang_hooks::parse_file, pkgversion_string, process_pending_assemble_externals(), seen_error(), targetm, timevar_pop(), timevar_push(), timevar_start(), timevar_stop(), tsan_finish_file(), version_string, and weak_finish().
Referenced by do_compile().
|
static |
@verbatim 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 asm_out_file, current_function_decl, current_function_func_begin_label, debug_hooks, default_target_flag_state, local_tick, save_decoded_options, save_decoded_options_count, stack_limit_rtx, this_target_flag_state, user_defined_section_attribute, and user_label_prefix.
Referenced by general_init().
|
static |
Handler for fatal signals, such as SIGSEGV. These are transformed into ICE messages, which is much more user friendly. In case the error printer crashes, reset the signal to prevent infinite recursion.
References internal_error(), output_operand_lossage(), strsignal(), and this_is_asm_operands.
|
static |
Initialize the compiler, and compile the input file.
References backend_init(), compile_file(), coverage_init(), finalize(), ggc_protect_identifiers, init_adjust_machine_modes(), init_cgraph(), init_final(), invoke_plugin_callbacks(), lang_dependent_init(), process_options(), seen_error(), statistics_init(), timevar_init(), timevar_print(), timevar_start(), and timevar_stop().
Referenced by toplev_main().
void dump_memory_report | ( | ) |
References dump_alias_stats(), dump_alloc_pool_statistics(), dump_bitmap_statistics(), dump_ggc_loc_statistics(), dump_gimple_statistics(), dump_line_table_statistics(), dump_pta_stats(), dump_rtx_statistics(), dump_tree_statistics(), dump_vec_loc_statistics(), ggc_print_statistics(), and stringpool_statistics().
Referenced by compile(), and finalize().
void emit_debug_global_declarations | ( | ) |
Emit debugging information for all global declarations in VEC.
References gcc_debug_hooks::global_decl, len, seen_error(), timevar_pop(), and timevar_push().
Referenced by write_global_declarations().
|
static |
Referenced by do_compile().
|
static |
Clean up: close opened files, etc.
References dump_memory_report(), dump_profile_report(), fatal_error(), lang_hooks::finish, gcc::pass_manager::finish_optimization_passes(), g, gcc::context::get_passes(), ira_finish_once(), seen_error(), and statistics_fini().
|
static |
@verbatim Top level of GCC compilers (cc1, cc1plus, etc.)
Copyright (C) 1987-2013 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/.
This is the top level of cc1/c++. It parses command args, opens files, invokes the various passes in the proper order, and counts the time used by each. Error messages and low-level interface to malloc also handled here.
Referenced by toplev_main().
|
static |
Initialization of the front end environment, before command line options are parsed. Signal handlers, internationalization etc. ARGV0 is main's argv[0].
References alloc_for_identifier_to_locale(), crash_signal(), diagnostic_initialize(), host_hooks::extra_signals, finish_params(), g, gcc_init_libintl(), ggc_free(), ggc_round_alloc_size(), global_dc, global_init_params(), identifier_to_locale_alloc, identifier_to_locale_free, init_ggc(), init_ggc_heuristics(), init_reg_sets(), init_stringpool(), init_ttree(), diagnostic_context::internal_error, line_table, diagnostic_context::option_enabled, option_enabled(), option_name(), diagnostic_context::option_name, diagnostic_context::option_state, plugins_internal_error_function(), progname, realloc_for_line_map(), diagnostic_context::show_caret, diagnostic_context::show_column, diagnostic_context::show_option_requested, statistics_early_init(), strlen(), tree_diagnostics_defaults(), and virt_loc_aware_diagnostic_finalizer().
HOST_WIDE_INT get_random_seed | ( | ) |
Obtain the random_seed. Unless NOINIT, initialize it if it's not provided in the command line.
References init_random_seed().
Referenced by get_file_function_name(), and lto_get_section_name().
const char* get_src_pwd | ( | void | ) |
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.
Referenced by comp_dir_string(), and dbxout_init().
|
static |
Default the align_* variables to 1 if they're still unset, and set up the align_*_log variables.
References floor_log2().
Referenced by backend_init_target().
|
static |
Referenced by lang_dependent_init().
|
static |
Open assembly code output file. Do this even if -fsyntax-only is on, because then the driver will have provided the name of a temporary file or bit bucket for us. NAME is the file specified on the command line, possibly NULL.
References fatal_error(), inform(), input_location, len, memcpy(), print_switch_values(), print_to_asm_out_file(), print_version, strip_off_ending(), strlen(), SWITCH_TYPE_DESCRIPTIVE, and targetm.
|
static |
Initialize excess precision settings.
References EXCESS_PRECISION_DEFAULT, EXCESS_PRECISION_FAST, and EXCESS_PRECISION_STANDARD.
Referenced by lang_dependent_init_target().
|
static |
Initialize local_tick with a random number or -1 if flag_random_seed is set.
Referenced by toplev_main().
|
static |
Set up a default flag_random_seed and local_tick, unless the user already specified one. Must be called after init_local_tick.
References crc32_string().
Referenced by get_random_seed(), and print_switch_values().
|
static |
Referenced by do_compile().
|
static |
Language-dependent initialization. Returns nonzero on success.
References gcc_debug_hooks::init, lang_hooks::init, init_asm_output(), init_eh(), input_location, lang_dependent_init_target(), open_auxiliary_file(), timevar_pop(), and timevar_push().
|
static |
Initialize things that are both lang-dependent and target-dependent. This function can be called more than once if target parameters change.
References expand_dummy_function_end(), init_dummy_function_start(), init_excess_precision(), init_expr_target(), init_optabs(), init_set_costs(), and ira_init().
Referenced by lang_dependent_init(), and target_reinit().
|
static |
Open an auxiliary output file.
References fatal_error(), and free().
Referenced by lang_dependent_init().
void output_stack_usage | ( | void | ) |
Output stack usage information.
References lang_hooks::decl_printable_name, expand_location(), HOST_WIDE_INT, HOST_WIDE_INT_PRINT_DEC, and warning().
Referenced by rest_of_handle_thread_prologue_and_epilogue().
|
static |
Print an option value and return the adjusted position in the line. ??? print_fn doesn't handle errors, eg disk full; presumably other code will catch a disk full though.
References len, strlen(), SWITCH_TYPE_LINE_END, and SWITCH_TYPE_LINE_START.
Referenced by print_switch_values().
|
static |
Print active target switches using PRINT_FN. POS is the current cursor position and MAX is the size of a "line". Each line begins with INDENT and ends with TERM. Each switch is separated from the next by SEP.
References cl_options, cl_options_count, init_random_seed(), option_enabled(), print_single_switch(), SWITCH_TYPE_DESCRIPTIVE, SWITCH_TYPE_ENABLED, SWITCH_TYPE_LINE_END, and SWITCH_TYPE_PASSED.
Referenced by init_asm_output(), and process_options().
|
static |
References strlen(), SWITCH_TYPE_DESCRIPTIVE, SWITCH_TYPE_ENABLED, SWITCH_TYPE_LINE_END, SWITCH_TYPE_LINE_START, and SWITCH_TYPE_PASSED.
Referenced by init_asm_output().
|
static |
References SWITCH_TYPE_DESCRIPTIVE, SWITCH_TYPE_ENABLED, SWITCH_TYPE_LINE_END, SWITCH_TYPE_LINE_START, and SWITCH_TYPE_PASSED.
Referenced by process_options().
void print_version | ( | void | ) |
Print version information to FILE. Each line begins with INDENT (for the case where FILE is the assembler output file).
References lang_hooks::name, pkgversion_string, print_plugins_versions(), and version_string.
|
static |
Process the options that have been parsed.
References build_optimization_node(), diagnostic_context::classify_diagnostic, colorize_init(), DBX_DEBUG, dbx_debug_hooks, debug_type_names, diagnostic_classify_diagnostic(), diagnostic_inhibit_notes(), DIAGNOSTICS_COLOR_AUTO, DINFO_LEVEL_NONE, DINFO_LEVEL_NORMAL, do_nothing_debug_hooks, dump_go_spec_init(), DWARF2_DEBUG, dwarf2_debug_hooks, error(), fatal_error(), getenv(), global_dc, IRA_REGION_AUTODETECT, IRA_REGION_MIXED, IRA_REGION_ONE, maximum_field_alignment, NO_DEBUG, lang_hooks::post_options, print_switch_values(), print_to_stderr(), print_version, diagnostic_context::printer, SDB_DEBUG, sdb_debug_hooks, sorry(), strip_off_ending(), strlen(), target_supports_section_anchors_p(), targetm, gcc_debug_hooks::var_location, VMS_AND_DWARF2_DEBUG, VMS_DEBUG, vmsdbg_debug_hooks, warning(), XCOFF_DEBUG, and xcoff_debug_hooks.
Referenced by do_compile().
|
static |
A helper function; used as the reallocator function for cpp's line table.
Referenced by general_init().
const char* set_random_seed | ( | ) |
Modify the random_seed string to VAL. Return its previous value.
Referenced by handle_common_deferred_options().
void target_reinit | ( | void | ) |
Reinitialize everything when target parameters, such as register usage, have changed.
References backend_init_target(), lang_dependent_init_target(), memset(), and regno_reg_rtx.
Referenced by save_target_globals().
|
static |
Return true if the current target supports -fsection-anchors.
References targetm.
Referenced by process_options().
int toplev_main | ( | ) |
Entry point of cc1, cc1plus, jc1, f771, etc. Exit code is FATAL_EXIT_CODE if can't open files or if there were any errors, or SUCCESS_EXIT_CODE if compilation succeeded. It is not safe to call this function more than once.
References decode_cmdline_options_to_array_default_mask(), decode_options(), diagnostic_finish(), do_compile(), finalize_plugins(), general_init(), global_dc, handle_common_deferred_options(), init_local_tick(), lang_hooks::init_options, init_options_once(), lang_hooks::init_options_struct, init_options_struct(), initialize_plugins(), invoke_plugin_callbacks(), line_table, print_ignored_options(), print_plugins_help(), print_version, and seen_error().
Referenced by main().
void wrapup_global_declaration_1 | ( | ) |
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 lang_hooks::finish_incomplete_decl.
Referenced by wrapup_global_declarations().
bool wrapup_global_declaration_2 | ( | ) |
A subroutine of wrapup_global_declarations. Decide whether or not DECL needs to be output. Return true if it is output.
References symtab_node_base::alias, symtab_node_base::analyzed, cgraph_global_info_ready, symtab_node_base::definition, rest_of_decl_compilation(), varpool_node::symbol, and varpool_get_node().
Referenced by wrapup_global_declarations().
bool 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 len, wrapup_global_declaration_1(), and wrapup_global_declaration_2().
Referenced by write_global_declarations().