GCC Middle and Back End API Reference
|
Go to the source code of this file.
Functions | |
tree | tree_output_constant_def (tree) |
void | make_decl_rtl (tree) |
rtx | make_decl_rtl_for_debug (tree) |
void | make_decl_one_only (tree, tree) |
bool | supports_one_only (void) |
void | resolve_unique_section (tree, int, int) |
void | mark_referenced (tree) |
void | mark_decl_referenced (tree) |
void | notice_global_symbol (tree) |
void | set_user_assembler_name (tree, const char *) |
void | process_pending_assemble_externals (void) |
bool | decl_replaceable_p (tree, bool) |
bool | decl_binds_to_current_def_p (const_tree) |
enum tls_model | decl_default_tls_model (const_tree) |
void | declare_weak (tree) |
void | merge_weak (tree, tree) |
void | assemble_alias (tree, tree) |
tree | initializer_constant_valid_p (tree, tree, bool=false) |
bool | initializer_constant_valid_for_bitfield_p (const_tree) |
bool | constructor_static_from_elts_p (const_tree) |
void | init_varasm_status (void) |
rtx | assemble_static_space (unsigned HOST_WIDE_INT) |
rtx | assemble_trampoline_template (void) |
void | switch_to_comdat_section (section *, tree) |
Variables | |
tree | cold_function_name |
Make one symbol an alias for another.
Emit an assembler directive to make the symbol for DECL an alias to the symbol for TARGET.
References symtab_node::alias, alias_pairs, symtab_node::decl, DECL_ASSEMBLER_NAME, DECL_ATTRIBUTES, DECL_SOURCE_LOCATION, DECL_WEAK, do_assemble_alias(), error(), error_at(), EXPANSION, find_decl(), gcc_unreachable, cgraph_node::get_create(), varpool_node::get_create(), symbol_table::global_info_ready, lookup_attribute(), NULL, symbol_table::state, symtab, TARGET_SUPPORTS_ALIASES, TREE_ASM_WRITTEN, TREE_CODE, TREE_PUBLIC, TREE_USED, ultimate_transparent_alias_target(), and vec_safe_push().
Referenced by asan_add_global(), and rest_of_decl_compilation().
|
extern |
Allocate SIZE bytes writable static space with a gensym name and return an RTX to refer to its address.
References asm_out_file, const_labelno, ggc_strdup, symtab_node::name(), NULL_TREE, SYMBOL_FLAG_LOCAL, and SYMBOL_REF_FLAGS.
Referenced by expand_function_start().
|
extern |
|
extern |
Whether a constructor CTOR is a valid static constant initializer if all its elements are. This used to be internal to initializer_constant_valid_p and has been exposed to let other functions like categorize_ctor_elements evaluate the property while walking a constructor for other purposes.
References TREE_CODE, TREE_CONSTANT, and TREE_TYPE.
Referenced by categorize_ctor_elements_1(), and initializer_constant_valid_p_1().
|
extern |
Return true when references to DECL must bind to current definition in final executable. The condition is usually equivalent to whether the function binds to the current module (shared library or executable), that is to binds_local_p. We use this fact to avoid need for another target hook and implement the logic using binds_local_p and just special cases where decl_binds_to_current_def_p is stronger than binds_local_p. In particular the weak definitions (that can be overwritten at linktime by other definition from different object file) and when resolution info is available we simply use the knowledge passed to us by linker plugin.
References DECL_COMDAT_GROUP, DECL_COMMON, DECL_EXTERNAL, DECL_INITIAL, DECL_P, DECL_WEAK, error_mark_node, gcc_assert, symtab_node::get(), NULL, resolution_to_local_definition_p(), targetm, and TREE_PUBLIC.
Referenced by align_variable(), base_object_writable(), symtab_node::binds_to_current_def_p(), symtab_node::can_increase_alignment_p(), can_replace_by_local_alias(), compare_base_symbol_refs(), decl_replaceable_p(), default_use_anchors_for_symbol_p(), symtab_node::equal_address_to(), fndecl_abi(), get_range_strlen_tree(), get_variable_align(), maybe_instrument_pointer_overflow(), maybe_optimize_ubsan_ptr_ifn(), ipa_icf::sem_function::merge(), ipa_icf::sem_variable::merge(), symtab_node::noninterposable_alias(), symtab_node::noninterposable_alias(), optimize_weakref(), ptrs_compare_unequal(), rest_of_clean_state(), self_recursive_call_p(), and set_uids_in_ptset().
|
extern |
References optimize_dyn_tls_for_decl_p(), targetm, TLS_MODEL_GLOBAL_DYNAMIC, TLS_MODEL_INITIAL_EXEC, TLS_MODEL_LOCAL_DYNAMIC, and TLS_MODEL_LOCAL_EXEC.
Referenced by function_and_variable_visibility(), and init_ic_make_global_vars().
A replaceable function or variable is one which may be replaced at link-time with an entirely different definition, provided that the replacement has the same type. For example, functions declared with __attribute__((weak)) on most systems are replaceable. If SEMANTIC_INTERPOSITION_P is false allow interposition only on symbols explicitly declared weak. COMDAT functions are not replaceable, since all definitions of the function must be equivalent. It is important that COMDAT functions not be treated as replaceable so that use of C++ template instantiations is not penalized.
References decl_binds_to_current_def_p(), DECL_COMDAT, DECL_P, DECL_WEAK, gcc_assert, and TREE_PUBLIC.
Referenced by varpool_node::ctor_useable_for_folding_p(), cgraph_node::get_availability(), and varpool_node::get_availability().
|
extern |
Declare DECL to be a weak symbol.
References DECL_ATTRIBUTES, error(), gcc_assert, get_identifier(), lookup_attribute(), mark_weak(), NULL, TARGET_SUPPORTS_WEAK, TREE_ASM_WRITTEN, TREE_CODE, tree_cons(), TREE_PUBLIC, and warning().
|
extern |
Initialize constant pool hashing for a new function.
References create_constant_pool(), and crtl.
Referenced by prepare_function_start(), read_rtl_function_body(), and read_rtl_function_body_from_file_range().
|
extern |
Return true if VALUE is a valid constant-valued expression for use in initializing a static bit-field; one that can be an element of a "constant" initializer.
References CONSTRUCTOR_ELTS, FOR_EACH_CONSTRUCTOR_VALUE, initializer_constant_valid_for_bitfield_p(), TREE_CODE, and TREE_OPERAND.
Referenced by immediate_const_ctor_p(), and initializer_constant_valid_for_bitfield_p().
Return nonzero if VALUE is a valid constant-valued expression for use in initializing a static variable; one that can be an element of a "constant" initializer. Return null_pointer_node if the value is absolute; if it is relocatable, return the variable that determines the relocation. We assume that VALUE has been folded as much as possible; therefore, we do not need to check for such things as arithmetic-combinations of integers.
References AGGREGATE_TYPE_P, initializer_constant_valid_p_1(), NULL, null_pointer_node, NULL_TREE, and VECTOR_TYPE_P.
Referenced by categorize_ctor_elements_1(), tree_switch_conversion::switch_conversion::check_final_bb(), gimplify_init_constructor(), rtl_for_decl_init(), and tree_add_const_value_attribute().
Set up DECL as a public symbol that can be defined in multiple translation units without generating a linker error.
References DECL_COMMON, DECL_INITIAL, DECL_WEAK, error_mark_node, gcc_assert, cgraph_node::get_create(), varpool_node::get_create(), symtab_node::set_comdat_group(), SUPPORTS_ONE_ONLY, TARGET_SUPPORTS_WEAK, TREE_PUBLIC, VAR_OR_FUNCTION_DECL_P, and VAR_P.
Referenced by dw2_output_indirect_constant_1(), get_emutls_init_templ_addr(), new_emutls_decl(), and simd_clone_create().
|
extern |
Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL. DECL should have static storage duration. In other words, it should not be an automatic variable, including PARM_DECLs. There is, however, one exception: this function handles variables explicitly placed in a particular register by the user. This is never called for PARM_DECL nodes.
References accessible_reg_set, adjust_address_nv, asm_out_file, change_symbol_block(), create_block_symbol(), DECL_ASSEMBLER_NAME, DECL_COMMON, DECL_EXTERNAL, DECL_HARD_REGISTER, DECL_IN_CONSTANT_POOL, DECL_INITIAL, DECL_MODE, DECL_NAME, DECL_REGISTER, DECL_RTL, DECL_RTL_SET_P, DECL_SECTION_NAME, DECL_WEAK, decode_reg_name(), eliminable_regno_p(), error(), error_mark_node, gcc_assert, gen_raw_REG(), gen_rtx_MEM(), get_block_for_decl(), GET_CODE, GET_MODE, globalize_reg(), HARD_FRAME_POINTER_REGNUM, hard_regno_nregs(), IDENTIFIER_POINTER, in_hard_reg_set_p(), MEM_P, symtab_node::name(), NULL, NULL_TREE, operand_reg_set, ORIGINAL_REGNO, output_constant_def(), REG_USERVAR_P, SET_DECL_ASSEMBLER_NAME, SET_DECL_RTL, set_mem_attributes(), SET_SYMBOL_REF_DECL, SYMBOL_REF_HAS_BLOCK_INFO_P, SYMBOL_REF_WEAK, targetm, TREE_CODE, TREE_PUBLIC, TREE_STATIC, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ADDR_SPACE, use_blocks_for_decl_p(), use_object_blocks_p(), VAR_P, warning(), and XEXP.
Referenced by rt_bb_visited::check(), symtab_node::copy_visibility_from(), create_odr_indicator(), do_assemble_alias(), symtab_node::make_decl_local(), and rest_of_decl_compilation().
Like make_decl_rtl, but inhibit creation of new alias sets when calling make_decl_rtl. Also, reset DECL_RTL before returning the rtl.
References DECL_RTL, DECL_RTL_SET_P, NULL, and SET_DECL_RTL.
Referenced by expand_debug_expr(), and rtl_for_decl_location().
|
extern |
Set the symbol_referenced flag for DECL and notify callgraph.
References DECL_EXTERNAL, symtab_node::definition, symtab_node::force_output, cgraph_node::get_create(), varpool_node::get_create(), cgraph_node::mark_force_output(), TREE_CODE, and VAR_P.
Referenced by build_gcov_info_var_registration().
|
extern |
Set the symbol_referenced flag for ID.
References TREE_SYMBOL_REFERENCED.
Referenced by assemble_name_resolve().
Merge weak status.
Merge weak status between NEWDECL and OLDDECL.
References DECL_ASSEMBLER_NAME, DECL_WEAK, error(), gcc_assert, mark_weak(), TARGET_SUPPORTS_WEAK, TREE_ASM_WRITTEN, TREE_CHAIN, TREE_PUBLIC, TREE_SYMBOL_REFERENCED, TREE_USED, TREE_VALUE, and weak_decls.
|
extern |
DECL is an object (either VAR_DECL or FUNCTION_DECL) which is going to be output to assembler. Set first_global_object_name and weak_global_object_name as appropriate.
References DECL_ASSEMBLER_NAME, DECL_COMMON, DECL_EXTERNAL, DECL_HARD_REGISTER, DECL_INITIAL, DECL_NAME, DECL_ONE_ONLY, DECL_WEAK, error_mark_node, first_global_object_name, ggc_strdup, IDENTIFIER_POINTER, targetm, TREE_CODE, TREE_PUBLIC, ultimate_transparent_alias_target(), VAR_P, and weak_global_object_name.
Referenced by assemble_start_function(), assemble_variable(), varpool_node::finalize_decl(), and cgraph_node::finalize_function().
|
extern |
References get_identifier(), symtab_node::name(), NULL_RTX, pending_assemble_externals, pending_libcall_symbols, targetm, TREE_CHAIN, TREE_SYMBOL_REFERENCED, TREE_VALUE, XEXP, and XSTR.
Referenced by compile_file().
|
extern |
If required, set DECL_SECTION_NAME to a unique name.
References symtab_node::call_for_symbol_and_aliases(), DECL_ATTRIBUTES, DECL_COMDAT_GROUP, DECL_SECTION_NAME, symtab_node::get(), lookup_attribute(), NULL, set_implicit_section(), and targetm.
Referenced by expand_thunk(), and get_variable_section().
|
extern |
The user has asked for a DECL to have a particular name. Set (or change) it in such a way that we don't prefix an underscore to it.
References alloca, symbol_table::change_decl_assembler_name(), get_identifier(), symtab_node::name(), NULL_RTX, SET_DECL_RTL, and symtab.
Referenced by set_builtin_user_assembler_name(), and set_user_assembler_libfunc().
|
extern |
Returns true if the target configuration supports defining public symbols so that one of them will be chosen at link time instead of generating a multiply-defined symbol error, whether through the use of weak symbols or a target-specific mechanism for having duplicates discarded.
References SUPPORTS_ONE_ONLY, and TARGET_SUPPORTS_WEAK.
Switch to a COMDAT section with COMDAT name of decl. FIXME: resolve_unique_section needs to deal better with decls with both DECL_SECTION_NAME and DECL_ONE_ONLY. Once that is fixed, this if-else statement can be replaced with a single call to "switch_to_section (sect)".
References named_section::common, DECL_COMDAT_GROUP, section_common::flags, IDENTIFIER_POINTER, in_section, named_section::name, section::named, NULL, SECTION_LINKONCE, switch_to_section(), TARGET_PECOFF, targetm, and TREE_CODE.
Referenced by default_print_patchable_function_entry(), and handle_vtv_comdat_section().
Return a tree representing a reference to constant data in memory for the constant expression EXP. This is the counterpart of output_constant_def at the Tree level.
References add_constant_to_table(), exp(), varpool_node::finalize_decl(), constant_descriptor_tree::rtl, SYMBOL_REF_DECL, and XEXP.
Referenced by expand_expr_real_1(), gimple_lower_bitint(), and gimplify_init_constructor().
|
extern |
Declarations for varasm.h. Copyright (C) 2013-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/>.
The following global holds the "function name" for the code in the cold section of a function, if hot/cold function splitting is enabled and there was actually code that went into the cold section. A pseudo function name is needed for the cold section of code for some debugging tools that perform symbolization.
The following global holds the "function name" for the code in the cold section of a function, if hot/cold function splitting is enabled and there was actually code that went into the cold section. A pseudo function name is needed for the cold section of code for some debugging tools that perform symbolization.
Referenced by assemble_end_function(), assemble_start_function(), and final_scan_insn_1().