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

Go to the source code of this file.

Data Structures

struct  section_common
 
struct  named_section
 
struct  unnamed_section
 
struct  noswitch_section
 
union  section
 

Macros

#define ATTRIBUTE_ASM_FPRINTF(m, n)
 
#define assemble_aligned_integer(SIZE, VALUE)
 
#define SECTION_STYLE(SECT)
 

Typedefs

typedef void(* unnamed_section_callback) (const char *)
 
typedef bool(* noswitch_section_callback) (tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)
 

Enumerations

enum  section_flag {
  SECTION_UNNAMED = 0 , SECTION_ENTSIZE = (1UL << 8) - 1 , SECTION_CODE = 1UL << 8 , SECTION_WRITE = 1UL << 9 ,
  SECTION_DEBUG = 1UL << 10 , SECTION_LINKONCE = 1UL << 11 , SECTION_SMALL = 1UL << 12 , SECTION_BSS = 1UL << 13 ,
  SECTION_MERGE = 1UL << 14 , SECTION_STRINGS = 1UL << 15 , SECTION_OVERRIDE = 1UL << 16 , SECTION_TLS = 1UL << 17 ,
  SECTION_NOTYPE = 1UL << 18 , SECTION_DECLARED = 1UL << 19 , SECTION_NAMED = 1UL << 20 , SECTION_NOSWITCH = 1UL << 21 ,
  SECTION_STYLE_MASK = SECTION_NAMED | SECTION_NOSWITCH , SECTION_COMMON = 1UL << 22 , SECTION_RELRO = 1UL << 23 , SECTION_EXCLUDE = 1UL << 24 ,
  SECTION_RETAIN = 1UL << 25 , SECTION_LINK_ORDER = 1UL << 26 , SECTION_MACH_DEP = 1UL << 27
}
 
enum  section_category {
  SECCAT_TEXT , SECCAT_RODATA , SECCAT_RODATA_MERGE_STR , SECCAT_RODATA_MERGE_STR_INIT ,
  SECCAT_RODATA_MERGE_CONST , SECCAT_SRODATA , SECCAT_DATA , SECCAT_DATA_REL ,
  SECCAT_DATA_REL_LOCAL , SECCAT_DATA_REL_RO , SECCAT_DATA_REL_RO_LOCAL , SECCAT_SDATA ,
  SECCAT_TDATA , SECCAT_BSS , SECCAT_SBSS , SECCAT_TBSS
}
 

Functions

void init_final (const char *)
 
void app_enable (void)
 
void app_disable (void)
 
int dbr_sequence_length (void)
 
void init_insn_lengths (void)
 
int get_attr_length (rtx_insn *)
 
int get_attr_min_length (rtx_insn *)
 
void shorten_branches (rtx_insn *)
 
const char * get_some_local_dynamic_name ()
 
void final_start_function (rtx_insn *, FILE *, int)
 
void final_end_function (void)
 
void final (rtx_insn *, FILE *, int)
 
rtx_insnfinal_scan_insn (rtx_insn *, FILE *, int, int, int *)
 
rtx alter_subreg (rtx *, bool)
 
void output_operand (rtx, int)
 
void output_operand_lossage (const char *,...) ATTRIBUTE_PRINTF_1
 
void output_asm_insn (const char *, rtx *)
 
int insn_current_reference_address (rtx_insn *)
 
align_flags label_to_alignment (rtx)
 
void output_asm_label (rtx)
 
void mark_symbol_refs_as_used (rtx)
 
void output_address (machine_mode, rtx)
 
void output_addr_const (FILE *, rtx)
 
void fprint_whex (FILE *, unsigned HOST_WIDE_INT)
 
void fprint_ul (FILE *, unsigned long)
 
int sprint_ul (char *, unsigned long)
 
void asm_fprintf (FILE *file, const char *p,...) ATTRIBUTE_ASM_FPRINTF(2
 
void bool leaf_function_p (void)
 
bool final_forward_branch_p (rtx_insn *)
 
bool only_leaf_regs_used (void)
 
void leaf_renumber_regs_insn (rtx)
 
const char * get_insn_template (int, rtx_insn *)
 
void weak_finish (void)
 
int decode_reg_name (const char *)
 
int decode_reg_name_and_count (const char *, int *)
 
void do_assemble_alias (tree, tree)
 
void do_assemble_symver (tree, tree)
 
void default_assemble_visibility (tree, int)
 
void assemble_asm (tree)
 
const char * get_fnname_from_decl (tree)
 
void assemble_function_label_raw (FILE *, const char *)
 
void assemble_function_label_final (void)
 
void assemble_start_function (tree, const char *)
 
void assemble_end_function (tree, const char *)
 
void assemble_variable (tree, int, int, int)
 
void assemble_undefined_decl (tree)
 
void align_variable (tree decl, bool dont_output_data)
 
void assemble_external (tree)
 
void assemble_zeros (unsigned HOST_WIDE_INT)
 
void assemble_align (unsigned int)
 
void assemble_string (const char *, int)
 
void assemble_external_libcall (rtx)
 
void assemble_label (FILE *, const char *)
 
void assemble_name_raw (FILE *, const char *)
 
const char * assemble_name_resolve (const char *)
 
void assemble_name (FILE *, const char *)
 
const char * integer_asm_op (int, int)
 
void assemble_integer_with_op (const char *, rtx)
 
bool default_assemble_integer (rtx, unsigned int, int)
 
bool assemble_integer (rtx, unsigned, unsigned, int)
 
sectionget_named_text_section (tree, const char *, const char *)
 
void assemble_real (REAL_VALUE_TYPE, scalar_float_mode, unsigned, bool=false)
 
void assemble_addr_to_section (rtx, section *)
 
bool constant_pool_empty_p (void)
 
rtx_insnpeephole (rtx_insn *)
 
void output_shared_constant_pool (void)
 
void output_object_blocks (void)
 
void output_quoted_string (FILE *, const char *)
 
bool decl_readonly_section (const_tree, int)
 
int compute_reloc_for_constant (tree)
 
int compute_reloc_for_var (tree)
 
void default_function_pro_epilogue (FILE *)
 
void default_function_switched_text_sections (FILE *, tree, bool)
 
void no_asm_to_stream (FILE *)
 
sectionget_unnamed_section (unsigned int, void(*)(const char *), const char *)
 
sectionget_section (const char *, unsigned int, tree, bool not_existing=false)
 
sectionget_named_section (tree, const char *, int)
 
sectionget_variable_section (tree, bool)
 
void place_block_symbol (rtx)
 
rtx get_section_anchor (struct object_block *, HOST_WIDE_INT, enum tls_model)
 
sectionmergeable_constant_section (machine_mode, unsigned HOST_WIDE_INT, unsigned int)
 
sectionfunction_section (tree)
 
sectionunlikely_text_section (void)
 
sectioncurrent_function_section (void)
 
void switch_to_other_text_partition (void)
 
sectionget_cdtor_priority_section (int, bool)
 
bool unlikely_text_section_p (section *)
 
void switch_to_section (section *, tree=nullptr)
 
void output_section_asm_op (const char *)
 
void record_tm_clone_pair (tree, tree)
 
void finish_tm_clone_pairs (void)
 
tree get_tm_clone_pair (tree)
 
void default_asm_output_source_filename (FILE *, const char *)
 
void output_file_directive (FILE *, const char *)
 
unsigned int default_section_type_flags (tree, const char *, int)
 
bool have_global_bss_p (void)
 
bool bss_initializer_p (const_tree, bool=false)
 
void default_no_named_section (const char *, unsigned int, tree)
 
void default_elf_asm_named_section (const char *, unsigned int, tree)
 
enum section_category categorize_decl_for_section (const_tree, int)
 
void default_coff_asm_named_section (const char *, unsigned int, tree)
 
void default_pe_asm_named_section (const char *, unsigned int, tree)
 
void default_named_section_asm_out_destructor (rtx, int)
 
void default_dtor_section_asm_out_destructor (rtx, int)
 
void default_named_section_asm_out_constructor (rtx, int)
 
void default_ctor_section_asm_out_constructor (rtx, int)
 
sectiondefault_select_section (tree, int, unsigned HOST_WIDE_INT)
 
sectiondefault_elf_select_section (tree, int, unsigned HOST_WIDE_INT)
 
void default_unique_section (tree, int)
 
sectiondefault_function_rodata_section (tree, bool)
 
sectiondefault_no_function_rodata_section (tree, bool)
 
sectiondefault_clone_table_section (void)
 
sectiondefault_select_rtx_section (machine_mode, rtx, unsigned HOST_WIDE_INT)
 
sectiondefault_elf_select_rtx_section (machine_mode, rtx, unsigned HOST_WIDE_INT)
 
void default_encode_section_info (tree, rtx, int)
 
const char * default_strip_name_encoding (const char *)
 
void default_asm_output_anchor (rtx)
 
bool default_use_anchors_for_symbol_p (const_rtx)
 
bool default_binds_local_p (const_tree)
 
bool default_binds_local_p_1 (const_tree, int)
 
bool default_binds_local_p_2 (const_tree)
 
bool default_binds_local_p_3 (const_tree, bool, bool, bool, bool)
 
void default_globalize_label (FILE *, const char *)
 
void default_globalize_decl_name (FILE *, tree)
 
void default_emit_unwind_label (FILE *, tree, int, int)
 
void default_emit_except_table_label (FILE *)
 
void default_generate_internal_label (char *, const char *, unsigned long)
 
void default_internal_label (FILE *, const char *, unsigned long)
 
void default_asm_declare_constant_name (FILE *, const char *, const_tree, HOST_WIDE_INT)
 
void default_file_start (void)
 
void file_end_indicate_exec_stack (void)
 
void file_end_indicate_split_stack (void)
 
void default_elf_asm_output_external (FILE *file, tree, const char *)
 
void default_elf_asm_output_limited_string (FILE *, const char *)
 
void default_elf_asm_output_ascii (FILE *, const char *, unsigned int)
 
void default_elf_internal_label (FILE *, const char *, unsigned long)
 
void default_elf_init_array_asm_out_constructor (rtx, int)
 
void default_elf_fini_array_asm_out_destructor (rtx, int)
 
bool maybe_assemble_visibility (tree)
 
int default_address_cost (rtx, machine_mode, addr_space_t, bool)
 
void output_stack_usage (void)
 

Variables

rtx_sequencefinal_sequence
 
const char * first_global_object_name
 
const char * weak_global_object_name
 
rtx current_insn_predicate
 
rtx_insncurrent_output_insn
 
const rtx_insnthis_is_asm_operands
 
int size_directive_output
 
tree last_assemble_variable_decl
 
bool first_function_block_is_cold
 
const char * user_label_prefix
 
sectiontext_section
 
sectiondata_section
 
sectionreadonly_data_section
 
sectionsdata_section
 
sectionctors_section
 
sectiondtors_section
 
sectionbss_section
 
sectionsbss_section
 
sectionexception_section
 
sectioneh_frame_section
 
sectiontls_comm_section
 
sectioncomm_section
 
sectionlcomm_section
 
sectionbss_noswitch_section
 
sectionin_section
 
bool in_cold_section_p
 

Macro Definition Documentation

◆ assemble_aligned_integer

#define assemble_aligned_integer ( SIZE,
VALUE )
Value:
assemble_integer (VALUE, SIZE, (SIZE) * BITS_PER_UNIT, 1)
bool assemble_integer(rtx, unsigned, unsigned, int)
An interface to assemble_integer for the common case in which a value is
fully aligned and must be printed.  VALUE is the value of the integer
object and SIZE is the number of bytes it contains.   

◆ ATTRIBUTE_ASM_FPRINTF

#define ATTRIBUTE_ASM_FPRINTF ( m,
n )
Value:
ATTRIBUTE_NONNULL(m)
Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes.   

◆ SECTION_STYLE

#define SECTION_STYLE ( SECT)
Value:
((SECT)->common.flags & SECTION_STYLE_MASK)
@ SECTION_STYLE_MASK
Definition output.h:404
Return the style of section SECT.   

Referenced by assemble_variable(), function_mergeable_rodata_prefix(), get_block_for_decl(), output_object_block(), and switch_to_section().

Typedef Documentation

◆ noswitch_section_callback

typedef bool(* noswitch_section_callback) (tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded)
A callback that writes the assembly code for a decl in a
SECTION_NOSWITCH section.  DECL is the decl that should be assembled
and NAME is the name of its SYMBOL_REF.  SIZE is the size of the decl
in bytes and ROUNDED is that size rounded up to the next
BIGGEST_ALIGNMENT / BITS_PER_UNIT boundary.

Return true if the callback used DECL_ALIGN to set the object's
alignment.  A false return value implies that we are relying
on the rounded size to align the decl.   

◆ unnamed_section_callback

typedef void(* unnamed_section_callback) (const char *)
A callback that writes the assembly code for switching to an unnamed
section.  The argument provides callback-specific data.   

Enumeration Type Documentation

◆ section_category

A helper function for default_elf_select_section and
default_elf_unique_section.  Categorizes the DECL.   
Enumerator
SECCAT_TEXT 
SECCAT_RODATA 
SECCAT_RODATA_MERGE_STR 
SECCAT_RODATA_MERGE_STR_INIT 
SECCAT_RODATA_MERGE_CONST 
SECCAT_SRODATA 
SECCAT_DATA 
SECCAT_DATA_REL 
SECCAT_DATA_REL_LOCAL 
SECCAT_DATA_REL_RO 
SECCAT_DATA_REL_RO_LOCAL 
SECCAT_SDATA 
SECCAT_TDATA 
SECCAT_BSS 
SECCAT_SBSS 
SECCAT_TBSS 

◆ section_flag

Flags controlling properties of a section.   
Enumerator
SECTION_UNNAMED 
SECTION_ENTSIZE 
SECTION_CODE 
SECTION_WRITE 
SECTION_DEBUG 
SECTION_LINKONCE 
SECTION_SMALL 
SECTION_BSS 
SECTION_MERGE 
SECTION_STRINGS 
SECTION_OVERRIDE 
SECTION_TLS 
SECTION_NOTYPE 
SECTION_DECLARED 
SECTION_NAMED 
SECTION_NOSWITCH 
SECTION_STYLE_MASK 
SECTION_COMMON 
SECTION_RELRO 
SECTION_EXCLUDE 
SECTION_RETAIN 
SECTION_LINK_ORDER 
SECTION_MACH_DEP 

Function Documentation

◆ align_variable()

void align_variable ( tree decl,
bool dont_output_data )
extern

◆ alter_subreg()

rtx alter_subreg ( rtx * xp,
bool final_p )
extern
Replace a SUBREG with a REG or a MEM, based on the thing it is a
subreg of.   
If X is a SUBREG, try to replace it with a REG or a MEM, based on
the thing it is a subreg of.  Do it anyway if FINAL_P.   

References adjust_address, adjust_address_nv, byte_lowpart_offset(), gen_rtx_REG_offset(), GET_MODE, HARD_REGISTER_P, MEM_P, offset, paradoxical_subreg_p(), REG_P, simplify_subreg(), SUBREG_BYTE, subreg_lowpart_p(), SUBREG_REG, subreg_regno(), and y.

Referenced by alter_subregs(), cleanup_subreg_operands(), lra_eliminate_regs_1(), output_operand(), remove_pseudos(), simplify_operand_subreg(), and walk_alter_subreg().

◆ app_disable()

void app_disable ( void )
extern
Disable APP processing of subsequent output.
Called from varasm.cc before most kinds of output.   

References app_on, and asm_out_file.

Referenced by assemble_start_function(), assemble_variable(), final_end_function(), final_scan_insn_1(), and output_call_frame_info().

◆ app_enable()

void app_enable ( void )
extern
Enable APP processing of subsequent output.
Used before the output from an `asm' statement.   

References app_on, and asm_out_file.

Referenced by assemble_asm(), final_scan_insn_1(), and output_call_frame_info().

◆ asm_fprintf()

void asm_fprintf ( FILE * file,
const char * p,
... )
extern

◆ assemble_addr_to_section()

◆ assemble_align()

◆ assemble_asm()

void assemble_asm ( tree string)
extern
Output a string of literal assembler code
for an `asm' keyword used between functions.   

References app_enable(), asm_out_file, TREE_CODE, TREE_OPERAND, and TREE_STRING_POINTER.

Referenced by cgraph_order_sort::process().

◆ assemble_end_function()

void assemble_end_function ( tree decl,
const char * fnname )
extern
Output assembler code associated with defining the size of the
function.  DECL describes the function.  NAME is the function's name.   

References asm_out_file, ASM_OUTPUT_LABEL, cold_function_name, CONSTANT_POOL_BEFORE_FUNCTION, crtl, first_function_block_is_cold, function_section(), IDENTIFIER_POINTER, in_section, NULL_TREE, output_constant_pool(), switch_to_section(), text_section, and unlikely_text_section().

Referenced by rest_of_handle_final().

◆ assemble_external()

void assemble_external ( tree decl)
extern
Queue for outputting something to declare an external symbol to the
assembler.  (Most assemblers don't need this, so we normally output
nothing.)  Do nothing if DECL is not external.   
Output something to declare an external symbol to the assembler,
and qualifiers such as weakness.  (Most assemblers don't need
extern declaration, so we normally output nothing.)  Do nothing if
DECL is not external.   

References hash_set< KeyId, Lazy, Traits >::add(), asm_out_file, DECL_ATTRIBUTES, DECL_EXTERNAL, DECL_P, DECL_WEAK, EXPANSION, FINISHED, gcc_assert, lookup_attribute(), NULL, NULL_TREE, pending_assemble_externals, TARGET_SUPPORTS_WEAK, tree_cons(), TREE_PUBLIC, TREE_STATIC, value_member(), and weak_decls.

Referenced by final_scan_insn_1(), mark_symbol_refs_as_used(), and output_addr_const().

◆ assemble_external_libcall()

◆ assemble_function_label_final()

void assemble_function_label_final ( void )
extern
Finish outputting function label.  Needs to be called when outputting
function label without using assemble_function_label_raw ().   

References asan_function_start(), cfun, first_function_block_is_cold, in_cold_section_p, and SANITIZE_ADDRESS.

Referenced by assemble_function_label_raw().

◆ assemble_function_label_raw()

void assemble_function_label_raw ( FILE * file,
const char * name )
extern
Output function label, possibly with accompanying metadata.  No additional
code or data is output after the label.   

References ASM_OUTPUT_LABEL, assemble_function_label_final(), and symtab_node::name().

◆ assemble_integer()

bool assemble_integer ( rtx ,
unsigned ,
unsigned ,
int  )
extern
Assemble the integer constant X into an object of SIZE bytes.  ALIGN is
the alignment of the integer in bits.  Return 1 if we were able to output
the constant, otherwise 0.  If FORCE is nonzero the constant must
be outputable.  

Referenced by dw2_asm_output_data(), dw2_asm_output_data_sleb128(), dw2_asm_output_data_uleb128(), dw2_asm_output_encoded_addr_rtx(), dw2_asm_output_nstring(), dw2_assemble_integer(), dw2_output_indirect_constant_1(), output_ttype(), and profile_function().

◆ assemble_integer_with_op()

void assemble_integer_with_op ( const char * op,
rtx x )
extern
Use directive OP to assemble an integer object X.  Print OP at the
start of the line, followed immediately by the value of X.   

References asm_out_file, fputc(), and output_addr_const().

Referenced by default_assemble_integer().

◆ assemble_label()

void assemble_label ( FILE * file,
const char * name )
extern
Assemble a label named NAME.   

References ASM_OUTPUT_LABEL, and symtab_node::name().

Referenced by default_asm_declare_constant_name().

◆ assemble_name()

void assemble_name ( FILE * file,
const char * name )
extern
Like assemble_name_raw, but should be used when NAME might refer to
an entity that is also represented as a tree (like a function or
variable).  If NAME does refer to such an entity, that entity will
be marked as referenced.   

References assemble_name_raw(), assemble_name_resolve(), and symtab_node::name().

Referenced by default_assemble_visibility(), dw2_asm_output_delta_uleb128(), dw2_asm_output_symname_uleb128(), output_addr_const(), and output_asm_label().

◆ assemble_name_raw()

void assemble_name_raw ( FILE * file,
const char * name )
extern
Output to FILE (an assembly file) a reference to NAME.  If NAME
starts with a *, the rest of NAME is output verbatim.  Otherwise
NAME is transformed in a target-specific way (usually by the
addition of an underscore).   

References ASM_OUTPUT_LABELREF, and symtab_node::name().

Referenced by assemble_name(), default_elf_asm_named_section(), and default_print_patchable_function_entry().

◆ assemble_name_resolve()

const char * assemble_name_resolve ( const char * name)
extern
Return NAME that should actually be emitted, looking through
transparent aliases.  If NAME refers to an entity that is also
represented as a tree (like a function or variable), mark the entity
as referenced.   

References gcc_assert, IDENTIFIER_POINTER, mark_referenced(), maybe_get_identifier(), symtab_node::name(), targetm, TREE_CHAIN, and ultimate_transparent_alias_target().

Referenced by assemble_name().

◆ assemble_real()

void assemble_real ( REAL_VALUE_TYPE ,
scalar_float_mode ,
unsigned ,
bool = false )
extern
Assemble the floating-point constant D into an object of size MODE.  ALIGN
is the alignment of the constant in bits.  If REVERSE is true, D is output
in reverse storage order.   

◆ assemble_start_function()

◆ assemble_string()

void assemble_string ( const char * p,
int size )
extern
Assemble a string constant with the specified C string as contents.   

References asm_out_file, and ASM_OUTPUT_ASCII.

Referenced by lhd_append_data(), and output_constant().

◆ assemble_undefined_decl()

void assemble_undefined_decl ( tree decl)
extern
Assemble everything that is needed for a variable declaration that has
no definition in the current translation unit.   
Write out assembly for the variable DECL, which is not defined in
the current translation unit.   

References asm_out_file, DECL_RTL, symtab_node::name(), targetm, XEXP, and XSTR.

Referenced by symbol_table::output_variables(), and cgraph_order_sort::process().

◆ assemble_variable()

void assemble_variable ( tree decl,
int top_level,
int at_end,
int dont_output_data )
extern
Assemble everything that is needed for a variable or function declaration.
Not used for automatic variables, and not used for function definitions.
Should not be called for variables of incomplete structure type.

TOP_LEVEL is nonzero if this variable has file scope.
AT_END is nonzero if this is the special handling, at end of compilation,
to define things that have had only tentative definitions.
DONT_OUTPUT_DATA if nonzero means don't actually output the
initial value (that will be done by the caller).   

References align_variable(), app_disable(), asan_protect_global(), ASAN_RED_ZONE_SIZE, asan_red_zone_size(), asm_out_file, assemble_noswitch_variable(), assemble_variable_contents(), assemble_zeros(), section::common, DECL_ALIGN, DECL_EXTERNAL, DECL_IN_TEXT_SECTION, DECL_INITIAL, DECL_NAME, DECL_PRESERVE_P, DECL_RTL, DECL_RTL_SET_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_THREAD_LOCAL_P, error(), error_mark_node, section_common::flags, floor_log2(), gcc_assert, gcc_checking_assert, GET_CODE, get_variable_align(), get_variable_section(), globalize_decl(), handle_vtv_comdat_section(), last_assemble_variable_decl, layout_decl(), MAX, maybe_assemble_visibility(), MEM_P, named_section::name, symtab_node::name(), section::named, notice_global_symbol(), output_addressed_constants(), output_constant_def_contents(), place_block_symbol(), REG_P, SANITIZE_ADDRESS, SECTION_CODE, SECTION_COMMON, SECTION_MERGE, SECTION_NAMED, SECTION_NOSWITCH, SECTION_STRINGS, SECTION_STYLE, SET_DECL_ALIGN, set_mem_align(), switch_to_section(), SYMBOL_REF_BLOCK, SYMBOL_REF_DECL, SYMBOL_REF_HAS_BLOCK_INFO_P, targetm, TREE_ASM_WRITTEN, TREE_CONSTANT_POOL_ADDRESS_P, TREE_PUBLIC, tree_to_uhwi(), valid_constant_size_p(), VAR_P, XEXP, and XSTR.

Referenced by varpool_node::assemble_decl(), and dw2_output_indirect_constant_1().

◆ assemble_zeros()

◆ bss_initializer_p()

bool bss_initializer_p ( const_tree decl,
bool named )
extern
Return true if DECL's initializer is suitable for a BSS section.   

References DECL_COMMON, DECL_INITIAL, DECL_PERSISTENT_P, error_mark_node, initializer_zerop(), NULL, and TREE_READONLY.

Referenced by categorize_decl_for_section(), and get_variable_section().

◆ categorize_decl_for_section()

◆ compute_reloc_for_constant()

int compute_reloc_for_constant ( tree exp)
extern
This can be used to compute RELOC for the function above, when
given a constant expression.   
Determine what kind of relocations EXP may need.   

References CASE_CONVERT, compute_reloc_for_constant(), CONSTRUCTOR_ELTS, exp(), FOR_EACH_CONSTRUCTOR_VALUE, handled_component_p(), targetm, TREE_CODE, and TREE_OPERAND.

Referenced by compute_reloc_for_constant(), compute_reloc_for_var(), and get_constant_section().

◆ compute_reloc_for_var()

int compute_reloc_for_var ( tree decl)
extern
This can be used to compute RELOC for get_variable_section.   
Compute reloc for get_variable_section.  The return value
is a mask for which bit 1 indicates a global relocation, and bit 0
indicates a local relocation.   

References compute_reloc_for_constant(), contains_pointers_p(), DECL_INITIAL, error_mark_node, and TREE_TYPE.

Referenced by get_variable_section().

◆ constant_pool_empty_p()

bool constant_pool_empty_p ( void )
extern
Return TRUE if and only if the constant pool has no entries.  Note
that even entries we might end up choosing not to emit are counted
here, so there is the potential for missed optimizations.   

References crtl, and NULL.

◆ current_function_section()

section * current_function_section ( void )
extern

◆ dbr_sequence_length()

int dbr_sequence_length ( void )
extern
Return the number of slots filled in the current
delayed branch sequence (we don't count the insn needing the
delay slot).   Zero if not in a delayed branch sequence.   

References final_sequence, and XVECLEN.

◆ decl_readonly_section()

bool decl_readonly_section ( const_tree decl,
int reloc )
extern
Decide whether DECL needs to be in a writable section.
RELOC is the same as for SELECT_SECTION.   

References categorize_decl_for_section(), and decl_readonly_section_1().

Referenced by default_select_section(), and readonly_data_expr().

◆ decode_reg_name()

int decode_reg_name ( const char * name)
extern
Decode an `asm' spec for a declaration as a register name.
Return the register number, or -1 if nothing specified,
or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
or -3 if ASMSPEC is `cc' and is not recognized,
or -4 if ASMSPEC is `memory' and is not recognized.
Accept an exact spelling or a decimal number.
Prefixes such as % are optional.   

References count, and decode_reg_name_and_count().

Referenced by handle_common_deferred_options(), and make_decl_rtl().

◆ decode_reg_name_and_count()

int decode_reg_name_and_count ( const char * asmspec,
int * pnregs )
extern
Similar to decode_reg_name, but takes an extra parameter that is a
pointer to the number of (internal) registers described by the
external name.   
Decode an `asm' spec for a declaration as a register name.
Return the register number, or -1 if nothing specified,
or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
or -3 if ASMSPEC is `cc' and is not recognized,
or -4 if ASMSPEC is `memory' and is not recognized.
Accept an exact spelling or a decimal number.
Prefixes such as % are optional.   

References i, symtab_node::name(), reg_names, strip_reg_name(), and table.

Referenced by decode_reg_name(), expand_asm_stmt(), and fix_register().

◆ default_address_cost()

int default_address_cost ( rtx x,
machine_mode ,
addr_space_t ,
bool speed )
extern
If the target doesn't override, compute the cost as with arithmetic.   

References rtx_cost().

◆ default_asm_declare_constant_name()

void default_asm_declare_constant_name ( FILE * file,
const char * name,
const_tree exp,
HOST_WIDE_INT size )
extern
The default implementation of ASM_DECLARE_CONSTANT_NAME.   

References assemble_label().

◆ default_asm_output_anchor()

void default_asm_output_anchor ( rtx )
extern

◆ default_asm_output_source_filename()

void default_asm_output_source_filename ( FILE * file,
const char * name )
extern
The default hook for TARGET_ASM_OUTPUT_SOURCE_FILENAME.   

References output_quoted_string().

◆ default_assemble_integer()

bool default_assemble_integer ( rtx x,
unsigned int size,
int aligned_p )
extern
The default implementation of the asm_out.integer target hook.   

References assemble_integer_with_op(), integer_asm_op(), and POINTER_SIZE_UNITS.

◆ default_assemble_visibility()

void default_assemble_visibility ( tree decl,
int vis )
extern
Emit an assembler directive to set symbol for DECL visibility to
the visibility type VIS, which must not be VISIBILITY_DEFAULT.   

References asm_out_file, assemble_name(), DECL_ARTIFICIAL, DECL_ASSEMBLER_NAME, IDENTIFIER_POINTER, symtab_node::name(), NULL, type(), ultimate_transparent_alias_target(), and warning().

◆ default_binds_local_p()

bool default_binds_local_p ( const_tree exp)
extern
Assume ELF-ish defaults, since that's pretty much the most liberal
wrt cross-module name binding.   

References default_binds_local_p_3(), and exp().

◆ default_binds_local_p_1()

bool default_binds_local_p_1 ( const_tree exp,
int shlib )
extern

References default_binds_local_p_3(), and exp().

◆ default_binds_local_p_2()

bool default_binds_local_p_2 ( const_tree exp)
extern
Similar to default_binds_local_p, but common symbol may be local and
extern protected data is non-local.   

References default_binds_local_p_3(), and exp().

◆ default_binds_local_p_3()

bool default_binds_local_p_3 ( const_tree exp,
bool shlib,
bool weak_dominate,
bool extern_protected_data,
bool common_local_p )
extern
COMMON_LOCAL_P is true means that the linker can guarantee that an
uninitialized common symbol in the executable will still be defined
(through COPY relocation) in the executable.   

References DECL_ATTRIBUTES, DECL_COMMON, DECL_EXTERNAL, DECL_INITIAL, DECL_P, DECL_VISIBILITY, DECL_VISIBILITY_SPECIFIED, DECL_WEAK, error_mark_node, exp(), cgraph_node::get(), symtab_node::get(), lookup_attribute(), NULL, resolution_local_p(), resolution_to_local_definition_p(), targetm, TREE_CODE, TREE_PUBLIC, VISIBILITY_DEFAULT, and VISIBILITY_PROTECTED.

Referenced by default_binds_local_p(), default_binds_local_p_1(), and default_binds_local_p_2().

◆ default_clone_table_section()

section * default_clone_table_section ( void )
extern
Provide a default for the tm_clone_table section.   

References get_named_section(), and NULL.

◆ default_coff_asm_named_section()

void default_coff_asm_named_section ( const char * name,
unsigned int flags,
tree decl )
extern

◆ default_ctor_section_asm_out_constructor()

void default_ctor_section_asm_out_constructor ( rtx ,
int  )
extern

◆ default_dtor_section_asm_out_destructor()

void default_dtor_section_asm_out_destructor ( rtx ,
int  )
extern

◆ default_elf_asm_named_section()

◆ default_elf_asm_output_ascii()

void default_elf_asm_output_ascii ( FILE * ,
const char * ,
unsigned int  )
extern

◆ default_elf_asm_output_external()

void default_elf_asm_output_external ( FILE * file,
tree decl,
const char * name )
extern
Emit text to declare externally defined symbols. It is needed to
properly support non-default visibility.   

References DECL_ASSEMBLER_NAME, DECL_VISIBILITY_SPECIFIED, maybe_assemble_visibility(), targetm, and TREE_SYMBOL_REFERENCED.

◆ default_elf_asm_output_limited_string()

void default_elf_asm_output_limited_string ( FILE * ,
const char *  )
extern

◆ default_elf_fini_array_asm_out_destructor()

void default_elf_fini_array_asm_out_destructor ( rtx symbol,
int priority )
extern
Use .fini_array section for destructors.  

References assemble_addr_to_section(), and get_elf_initfini_array_priority_section().

◆ default_elf_init_array_asm_out_constructor()

void default_elf_init_array_asm_out_constructor ( rtx symbol,
int priority )
extern
Use .init_array section for constructors.  

References assemble_addr_to_section(), and get_elf_initfini_array_priority_section().

◆ default_elf_internal_label()

void default_elf_internal_label ( FILE * ,
const char * ,
unsigned long  )
extern

◆ default_elf_select_rtx_section()

◆ default_elf_select_section()

◆ default_emit_except_table_label()

void default_emit_except_table_label ( FILE * stream)
extern
Default function to output a label to divide up the exception table.
The default is to do nothing.  A target that needs/wants to divide
up the table must provide it's own function to do this.   

◆ default_emit_unwind_label()

void default_emit_unwind_label ( FILE * stream,
tree decl,
int for_eh,
int empty )
extern
Default function to output a label for unwind information.  The
default is to do nothing.  A target that needs nonlocal labels for
unwind information must provide its own function to do this.   

◆ default_encode_section_info()

void default_encode_section_info ( tree decl,
rtx rtl,
int first )
extern

◆ default_file_start()

void default_file_start ( void )
extern
This is the default behavior at the beginning of a file.  It's
controlled by two other target-hook toggles.   

References asm_out_file, output_file_directive(), and targetm.

◆ default_function_pro_epilogue()

void default_function_pro_epilogue ( FILE * )
extern
Default target function prologue and epilogue assembler output.   
Default target function prologue and epilogue assembler output.

If not overridden for epilogue code, then the function body itself
contains return instructions wherever needed.   

Referenced by final_start_function_1().

◆ default_function_rodata_section()

section * default_function_rodata_section ( tree decl,
bool relocatable )
extern
Return the read-only or relocated read-only data section
associated with function DECL.   

References alloca, DECL_COMDAT_GROUP, DECL_SECTION_NAME, get_section(), symtab_node::name(), readonly_data_section, SECTION_LINKONCE, SECTION_RELRO, SECTION_WRITE, and startswith().

◆ default_function_switched_text_sections()

void default_function_switched_text_sections ( FILE * file,
tree decl,
bool new_is_cold )
extern
Default target function switched text sections.   

◆ default_generate_internal_label()

void default_generate_internal_label ( char * buf,
const char * prefix,
unsigned long labelno )
extern
This is how to output an internal numbered label where PREFIX is
the class of label and LABELNO is the number within the class.   

◆ default_globalize_decl_name()

void default_globalize_decl_name ( FILE * stream,
tree decl )
extern
Default function to output code that will globalize a label.  A
target must define GLOBAL_ASM_OP or provide its own function to
globalize a label.   
Default function to output code that will globalize a declaration.   

References DECL_RTL, targetm, XEXP, and XSTR.

◆ default_globalize_label()

void default_globalize_label ( FILE * ,
const char *  )
extern

◆ default_internal_label()

void default_internal_label ( FILE * stream,
const char * prefix,
unsigned long labelno )
extern
This is how to output an internal numbered label where PREFIX is
the class of label and LABELNO is the number within the class.   

References alloca, and ASM_OUTPUT_INTERNAL_LABEL.

◆ default_named_section_asm_out_constructor()

void default_named_section_asm_out_constructor ( rtx symbol,
int priority )
extern

◆ default_named_section_asm_out_destructor()

void default_named_section_asm_out_destructor ( rtx symbol,
int priority )
extern

◆ default_no_function_rodata_section()

section * default_no_function_rodata_section ( tree ,
bool  )
extern
Return the read-only data section associated with function DECL
for targets where that section should be always the single
readonly data section.   

References readonly_data_section.

◆ default_no_named_section()

void default_no_named_section ( const char * name,
unsigned int flags,
tree decl )
extern
Output assembly to switch to section NAME with attribute FLAGS.
Four variants for common object file formats.   

References gcc_unreachable.

◆ default_pe_asm_named_section()

void default_pe_asm_named_section ( const char * name,
unsigned int flags,
tree decl )
extern

◆ default_section_type_flags()

unsigned int default_section_type_flags ( tree decl,
const char * name,
int reloc )
extern
Select a set of attributes for section NAME based on the properties
of DECL and whether or not RELOC indicates that DECL's initializer
might contain runtime relocations.

We make the section read-only and executable for a function decl,
read-only for a const data decl, and writable for a non-const data decl.   

References categorize_decl_for_section(), DECL_COMDAT_GROUP, DECL_P, decl_readonly_section_1(), DECL_THREAD_LOCAL_P, SECCAT_DATA_REL_RO, SECCAT_DATA_REL_RO_LOCAL, SECTION_BSS, SECTION_CODE, SECTION_ENTSIZE, SECTION_LINKONCE, SECTION_NOTYPE, SECTION_RELRO, SECTION_TLS, SECTION_WRITE, startswith(), TREE_CODE, and VAR_P.

◆ default_select_rtx_section()

section * default_select_rtx_section ( machine_mode mode,
rtx x,
unsigned HOST_WIDE_INT )
extern

◆ default_select_section()

section * default_select_section ( tree decl,
int reloc,
unsigned HOST_WIDE_INT align )
extern
The lame default section selector.   

References data_section, DECL_P, decl_readonly_section(), readonly_data_section, TREE_CODE, TREE_CONSTANT, and TREE_READONLY.

◆ default_strip_name_encoding()

const char * default_strip_name_encoding ( const char * str)
extern
By default, we do nothing for encode_section_info, so we need not
do anything but discard the '*' marker.   

◆ default_unique_section()

◆ default_use_anchors_for_symbol_p()

bool default_use_anchors_for_symbol_p ( const_rtx symbol)
extern

◆ do_assemble_alias()

◆ do_assemble_symver()

void do_assemble_symver ( tree decl,
tree target )
extern

◆ file_end_indicate_exec_stack()

void file_end_indicate_exec_stack ( void )
extern

◆ file_end_indicate_split_stack()

void file_end_indicate_split_stack ( void )
extern
Emit a special section directive to indicate that this object file
was compiled with -fsplit-stack.  This is used to let the linker
detect calls between split-stack code and non-split-stack code, so
that it can modify the split-stack code to allocate a sufficiently
large stack.  We emit another special section if there are any
functions in this file which have the no_split_stack attribute, to
prevent the linker from warning about being unable to convert the
functions if they call non-split-stack code.   

References get_section(), NULL, saw_no_split_stack, SECTION_DEBUG, and switch_to_section().

◆ final()

void final ( rtx_insn * first,
FILE * file,
int optimize_p )
extern
Output assembler code for some insns: all or part of a function.   
This is an exported final_1, callable without SEEN.   

References final_1(), in_initial_view_p(), and NEXT_INSN().

◆ final_end_function()

void final_end_function ( void )
extern
Output assembler code for the end of a function.
For clarity, args are same as those of `final_start_function'
even though not all of them are needed.   

References app_disable(), asm_out_file, current_function_decl, debug_hooks, DECL_IGNORED_P, dwarf2_debug_info_emitted_p(), dwarf2out_do_frame(), dwarf2out_end_epilogue(), gcc_debug_hooks::end_epilogue, gcc_debug_hooks::end_function, high_function_linenum, last_filename, last_linenum, some_local_dynamic_name, and targetm.

Referenced by rest_of_handle_final().

◆ final_forward_branch_p()

bool final_forward_branch_p ( rtx_insn * insn)
extern
Return true if branch is a forward branch.
Uses insn_shuid array, so it works only in the final pass.  May be used by
output templates to add branch prediction hints, for example.   
Return true if branch is a forward branch.
 Uses insn_shuid array, so it works only in the final pass.  May be used by
 output templates to customary add branch prediction hints.

References gcc_assert, INSN_SHUID, JUMP_LABEL, and uid_shuid.

◆ final_scan_insn()

rtx_insn * final_scan_insn ( rtx_insn * insn,
FILE * file,
int optimize_p,
int nopeepholes,
int * seen )
extern
The final scan for one insn, INSN.  Args are same as in `final', except
that INSN is the insn being scanned.  Value returned is the next insn to
be scanned.   
This is a wrapper around final_scan_insn_1 that allows ports to
call it recursively without a known value for SEEN.  The value is
saved at the outermost call, and recovered for recursive calls.
Recursive calls MUST pass NULL, or the same pointer if they can
otherwise get to it.   

References final_scan_insn_1(), gcc_assert, and NULL.

Referenced by final_1(), final_scan_insn_1(), and final_start_function_1().

◆ final_start_function()

void final_start_function ( rtx_insn * first,
FILE * file,
int optimize_p )
extern
Output assembler code for the start of a function,
and initialize some of the variables in this file
for the new function.  The label for the function and associated
assembler pseudo-ops have already been output in
`assemble_start_function'.   
This is an exported final_start_function_1, callable without SEEN.   

References final_start_function_1(), and gcc_assert.

◆ finish_tm_clone_pairs()

void finish_tm_clone_pairs ( void )
extern

◆ fprint_ul()

void fprint_ul ( FILE * f,
unsigned long value )
extern
Write an unsigned long as decimal to a file, fast.  

References i, and sprint_ul_rev().

◆ fprint_whex()

void fprint_whex ( FILE * f,
unsigned HOST_WIDE_INT value )
extern
Write a HOST_WIDE_INT number in hex form 0x1234, fast.  

References CHAR_BIT.

Referenced by dw2_asm_output_data(), dw2_asm_output_data_uleb128(), and dw2_assemble_integer().

◆ function_section()

section * function_section ( tree decl)
extern
Return the section for function DECL.

If DECL is NULL_TREE, return the text section.  We can be passed
NULL_TREE under some circumstances by dbxout.cc at least.   

References first_function_block_is_cold, and function_section_1().

Referenced by assemble_end_function(), assemble_start_function(), dwarf2out_begin_prologue(), find_empty_loc_ranges_at_text_label(), and output_fde().

◆ get_attr_length()

int get_attr_length ( rtx_insn * insn)
extern
Obtain the current length of an insn.  If branch shortening has been done,
get its actual length.  Otherwise, get its maximum length.   

References get_attr_length_1().

Referenced by output_asm_name().

◆ get_attr_min_length()

int get_attr_min_length ( rtx_insn * insn)
extern
Obtain the current length of an insn.  If branch shortening has been done,
get its actual length.  Otherwise, get its minimum length.   

References get_attr_length_1().

Referenced by can_dup_for_shrink_wrapping(), copy_bb_p(), get_uncond_jump_length(), maybe_duplicate_computed_goto(), and maybe_reset_location_view().

◆ get_cdtor_priority_section()

section * get_cdtor_priority_section ( int priority,
bool constructor_p )
extern
Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if
not) section for PRIORITY.   

References get_section(), MAX_INIT_PRIORITY, NULL, and SECTION_WRITE.

Referenced by default_named_section_asm_out_constructor(), and default_named_section_asm_out_destructor().

◆ get_fnname_from_decl()

const char * get_fnname_from_decl ( tree decl)
extern
Get the function's name from a decl, as described by its RTL.   
Get the function's name, as described by its RTL.  This may be
different from the DECL_NAME name used in the source file.   

References DECL_RTL, gcc_assert, GET_CODE, MEM_P, XEXP, and XSTR.

Referenced by output_function_exception_table(), and rest_of_handle_final().

◆ get_insn_template()

◆ get_named_section()

section * get_named_section ( tree decl,
const char * name,
int reloc )
extern
Return a section with a particular name and with whatever SECTION_*
flags section_type_flags deems appropriate.  The name of the section
is taken from NAME if nonnull, otherwise it is taken from DECL's
DECL_SECTION_NAME.  DECL is the decl associated with the section
(see the section comment for details) and RELOC is as for
section_type_flags.   

References DECL_P, DECL_SECTION_NAME, gcc_assert, get_section(), NULL, and targetm.

Referenced by default_clone_table_section(), default_elf_select_rtx_section(), default_elf_select_section(), function_section_1(), get_named_text_section(), get_variable_section(), and hot_function_section().

◆ get_named_text_section()

section * get_named_text_section ( tree decl,
const char * text_section_name,
const char * named_section_suffix )
extern
Return section for TEXT_SECITON_NAME if DECL or DECL_SECTION_NAME (DECL)
is NULL.   
Return section for TEXT_SECTION_NAME if DECL or DECL_SECTION_NAME (DECL)
is NULL.

When DECL_SECTION_NAME is non-NULL and it is implicit section and
NAMED_SECTION_SUFFIX is non-NULL, then produce section called
concatenate the name with NAMED_SECTION_SUFFIX.
Otherwise produce "TEXT_SECTION_NAME.IMPLICIT_NAME".   

References alloca, DECL_ASSEMBLER_NAME, DECL_COMDAT_GROUP, DECL_SECTION_NAME, symtab_node::get(), get_named_section(), IDENTIFIER_POINTER, NULL, and targetm.

Referenced by default_function_section().

◆ get_section()

section * get_section ( const char * name,
unsigned int flags,
tree decl,
bool not_existing )
extern
Return the named section structure associated with NAME.  Create
a new section with the given fields if no such structure exists.
When NOT_EXISTING, then fail if the section already exists.  Return
the existing section if the SECTION_RETAIN bit doesn't match.  Set
the SECTION_WRITE | SECTION_RELRO bits on the existing section
if one of the section flags is SECTION_WRITE | SECTION_RELRO and the
other has none of these flags in named sections and either the section
hasn't been declared yet or has been declared as writable.   

References named_section::common, section::common, named_section::decl, DECL_ATTRIBUTES, DECL_P, DECL_SOURCE_LOCATION, error(), section_common::flags, ggc_alloc(), ggc_strdup, inform(), internal_error(), lookup_attribute(), named_section::name, section::named, NULL, SECTION_BSS, SECTION_CODE, SECTION_DECLARED, SECTION_ENTSIZE, section_htab, SECTION_LINKONCE, SECTION_NAMED, SECTION_NOTYPE, SECTION_OVERRIDE, SECTION_RELRO, SECTION_RETAIN, SECTION_TLS, and SECTION_WRITE.

Referenced by build_gcov_info_var_registration(), default_elf_select_rtx_section(), default_function_rodata_section(), default_named_section_asm_out_constructor(), default_named_section_asm_out_destructor(), default_print_patchable_function_entry(), elf_record_gcc_switches(), file_end_indicate_exec_stack(), file_end_indicate_split_stack(), get_cdtor_priority_section(), get_elf_initfini_array_priority_section(), get_named_section(), init_btf_sections(), init_ctf_sections(), lhd_begin_section(), mergeable_constant_section(), mergeable_string_section(), output_comdat_type_unit(), output_comp_unit(), switch_to_eh_frame_section(), switch_to_exception_section(), and switch_to_frame_table_section().

◆ get_section_anchor()

rtx get_section_anchor ( struct object_block * block,
HOST_WIDE_INT offset,
enum tls_model model )
extern
Return the anchor that should be used to address byte offset OFFSET
from the first object in BLOCK.  MODEL is the TLS model used
to access it.   

References anchor_labelno, object_block::anchors, begin(), create_block_symbol(), end(), GET_MODE_BITSIZE(), ggc_strdup, HOST_WIDE_INT_1U, offset, ptr_mode, SYMBOL_FLAG_ANCHOR, SYMBOL_FLAG_LOCAL, SYMBOL_FLAG_TLS_SHIFT, SYMBOL_REF_BLOCK_OFFSET, SYMBOL_REF_FLAGS, SYMBOL_REF_TLS_MODEL, targetm, vec_safe_insert(), and vec_safe_length().

Referenced by use_anchored_address().

◆ get_some_local_dynamic_name()

const char * get_some_local_dynamic_name ( )
Locate some local-dynamic symbol still in use by this function
so that we can print its name in local-dynamic base patterns.
Return null if there are no local-dynamic references.   

References ALL, CONSTANT_POOL_ADDRESS_P, FOR_EACH_SUBRTX, GET_CODE, get_insns(), get_pool_constant(), NEXT_INSN(), NONDEBUG_INSN_P, PATTERN(), some_local_dynamic_name, SYMBOL_REF_TLS_MODEL, TLS_MODEL_LOCAL_DYNAMIC, and XSTR.

◆ get_tm_clone_pair()

tree get_tm_clone_pair ( tree o)
extern

References NULL_TREE, and tm_clone_hash.

Referenced by ipa_tm_insert_gettmclone_call().

◆ get_unnamed_section()

section * get_unnamed_section ( unsigned int flags,
void(* callback )(const char *),
const char * data )
extern

◆ get_variable_section()

◆ have_global_bss_p()

bool have_global_bss_p ( void )
extern
Return true if the target supports some form of global BSS,
either through bss_noswitch_section, or by selecting a BSS
section in TARGET_ASM_SELECT_SECTION.   

References bss_noswitch_section, and targetm.

◆ init_final()

void init_final ( const char * filename)
extern
Declarations for insn-output.cc and other code to write to asm_out_file.
   These functions are defined in final.cc, and varasm.cc.
   Copyright (C) 1987-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/>.   
Initialize data in final at the beginning of a compilation.   
Initialize data in final at the beginning of a compilation.   

References app_on, and final_sequence.

Referenced by do_compile().

◆ init_insn_lengths()

void init_insn_lengths ( void )
extern
Indicate that branch shortening hasn't yet been done.   

References free(), INSN_ADDRESSES_FREE, insn_lengths, insn_lengths_max_uid, uid_align, and uid_shuid.

Referenced by expand_thunk(), and rest_of_clean_state().

◆ insn_current_reference_address()

int insn_current_reference_address ( rtx_insn * branch)
extern
Compute a worst-case reference address of a branch so that it
can be safely used in the presence of aligned labels.
Defined in final.cc.   
Compute a worst-case reference address of a branch so that it
can be safely used in the presence of aligned labels.  Since the
size of the branch itself is unknown, the size of the branch is
not included in the range.  I.e. for a forward branch, the reference
address is the end address of the branch as known from the previous
branch shortening pass, minus a value to account for possible size
increase due to alignment.  For a backward branch, it is the start
address of the branch as known from the current pass, plus a value
to account for possible size increase due to alignment.
NB.: Therefore, the maximum offset allowed for backward branches needs
to exclude the branch size.   

References align_fuzz(), INSN_ADDRESSES_SET_P, insn_current_address, insn_last_address, insn_lengths, INSN_SHUID, INSN_UID(), JUMP_LABEL, jump_to_label_p(), length_unit_log, NEXT_INSN(), and PREV_INSN().

◆ integer_asm_op()

const char * integer_asm_op ( int size,
int aligned_p )
extern
Return the assembler directive for creating a given kind of integer
object.  SIZE is the number of bytes in the object and ALIGNED_P
indicates whether it is known to be aligned.  Return NULL if the
assembly dialect has no such directive.

The returned string should be printed at the start of a new line and
be followed immediately by the object's initial value.   

References asm_int_op::di, asm_int_op::hi, NULL, asm_int_op::pdi, asm_int_op::psi, asm_int_op::pti, asm_int_op::si, targetm, and asm_int_op::ti.

Referenced by default_assemble_integer(), default_print_patchable_function_entry(), dw2_asm_output_data(), and dw2_assemble_integer().

◆ label_to_alignment()

align_flags label_to_alignment ( rtx label)
extern
Find the alignment associated with a CODE_LABEL.
Defined in final.cc.   
For the benefit of port specific code do this also as a function.   

References CODE_LABEL_NUMBER, LABEL_TO_ALIGNMENT, and max_labelno.

◆ leaf_function_p()

void bool leaf_function_p ( void )
extern

◆ leaf_renumber_regs_insn()

void leaf_renumber_regs_insn ( rtx )
extern
Scan IN_RTX and its subexpressions, and renumber all regs into those
available in leaf functions.   

◆ mark_symbol_refs_as_used()

void mark_symbol_refs_as_used ( rtx x)
extern
Marks SYMBOL_REFs in x as referenced through use of assemble_external.   

References ALL, assemble_external(), FOR_EACH_SUBRTX, GET_CODE, and SYMBOL_REF_DECL.

Referenced by output_operand().

◆ maybe_assemble_visibility()

bool maybe_assemble_visibility ( tree decl)
extern
A helper function to call assemble_visibility when needed for a decl.   

References DECL_VISIBILITY, targetm, and VISIBILITY_DEFAULT.

Referenced by assemble_start_function(), assemble_variable(), default_elf_asm_output_external(), and do_assemble_alias().

◆ mergeable_constant_section()

section * mergeable_constant_section ( machine_mode mode,
unsigned HOST_WIDE_INT align,
unsigned int flags )
extern

◆ no_asm_to_stream()

void no_asm_to_stream ( FILE * file)
extern
Default target hook that outputs nothing to a stream.   

◆ only_leaf_regs_used()

bool only_leaf_regs_used ( void )
extern
Return true if this function uses only the registers that can be
safely renumbered.   

Referenced by rest_of_handle_check_leaf_regs().

◆ output_addr_const()

◆ output_address()

void output_address ( machine_mode mode,
rtx x )
extern
Print a memory reference operand for address X with access mode MODE
using machine-dependent assembler syntax.   
Print a memory reference operand for address X using
machine-dependent assembler syntax.   

References asm_out_file, changed, targetm, and walk_alter_subreg().

Referenced by output_asm_insn().

◆ output_asm_insn()

void output_asm_insn ( const char * templ,
rtx * operands )
extern
Output a string of assembler code, substituting insn operands.
Defined in final.cc.   
Output text from TEMPLATE to the assembler output file,
obeying %-directions to substitute operands taken from
the vector OPERANDS.

%N (for N a digit) means print operand N in usual manner.
%lN means require operand N to be a CODE_LABEL or LABEL_REF
   and print the label name with no punctuation.
%cN means require operand N to be a constant
   and print the constant expression with no punctuation.
%aN means expect operand N to be a memory address
   (not a memory reference!) and print a reference
   to that address.
%nN means expect operand N to be a constant
   and print a constant expression for minus the value
   of the operand, with no other punctuation.   

References asm_out_file, CONST_INT_P, CONSTANT_ADDRESS_P, HOST_WIDE_INT_PRINT_DEC, insn_counter, insn_noperands, INTVAL, NULL_RTX, output_addr_const(), output_address(), output_asm_label(), output_asm_name(), output_asm_operand_names(), output_operand(), output_operand_lossage(), targetm, and this_is_asm_operands.

Referenced by default_print_patchable_function_entry(), and final_scan_insn_1().

◆ output_asm_label()

void output_asm_label ( rtx x)
extern
Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol.   

References asm_out_file, assemble_name(), CODE_LABEL_NUMBER, GET_CODE, LABEL_P, label_ref_label(), NOTE_KIND, NOTE_P, and output_operand_lossage().

Referenced by output_asm_insn().

◆ output_file_directive()

void output_file_directive ( FILE * asm_file,
const char * input_name )
extern
Output a file name in the form wanted by System V.   

References NULL, remap_debug_filename(), and targetm.

Referenced by default_file_start().

◆ output_object_blocks()

void output_object_blocks ( void )
extern
Output the definitions of all object_blocks.   

References FOR_EACH_HASH_TABLE_ELEMENT, FOR_EACH_VEC_ELT, i, object_block_htab, output_object_block(), and output_object_block_compare().

Referenced by compile_file().

◆ output_operand()

void output_operand ( rtx x,
int code )
extern
Print an operand using machine-dependent assembler syntax.   
Print operand X using machine-dependent assembler syntax.
CODE is a non-digit that preceded the operand-number in the % spec,
such as 'z' if the spec was `%z3'.  CODE is 0 if there was no char
between the % and the digits.
When CODE is a non-letter, X is 0.

The meanings of the letters are machine-dependent and controlled
by TARGET_PRINT_OPERAND.   

References alter_subreg(), asm_out_file, gcc_assert, GET_CODE, mark_symbol_refs_as_used(), NULL_RTX, REG_P, REGNO, and targetm.

Referenced by output_asm_insn().

◆ output_operand_lossage()

void output_operand_lossage ( const char * cmsgid,
... )
extern
Report inconsistency between the assembler template and the operands.
In an `asm', it's the user's fault; otherwise, the compiler's fault.   

References _, ap, error_for_asm(), free(), internal_error(), and this_is_asm_operands.

Referenced by crash_signal(), output_addr_const(), output_asm_insn(), and output_asm_label().

◆ output_quoted_string()

void output_quoted_string ( FILE * asm_file,
const char * string )
extern
Output a quoted string.   

Referenced by default_asm_output_source_filename(), and generic_type_p().

◆ output_section_asm_op()

void output_section_asm_op ( const char * directive)
extern
Output DIRECTIVE (a C string) followed by a newline.  This is used as
a get_unnamed_section callback.   

References asm_out_file.

Referenced by init_varasm_once().

◆ output_shared_constant_pool()

void output_shared_constant_pool ( void )
extern
Write the contents of the shared constant pool.   

References optimize_constant_pool(), output_constant_pool_contents(), shared_constant_pool, and TARGET_SUPPORTS_ALIASES.

Referenced by compile_file().

◆ output_stack_usage()

void output_stack_usage ( void )
extern
Stack usage.   
Output stack usage and callgraph info, as requested.   

References callgraph_info_file, dump_final_node_vcg(), NULL, and output_stack_usage_1().

Referenced by rest_of_handle_thread_prologue_and_epilogue().

◆ peephole()

rtx_insn * peephole ( rtx_insn * )
extern

Referenced by final_scan_insn_1().

◆ place_block_symbol()

◆ record_tm_clone_pair()

◆ shorten_branches()

void shorten_branches ( rtx_insn * first)
extern
Make a pass over all insns and compute their actual lengths by shortening
any branches of variable length if possible.   
Make a pass over all insns and compute their actual lengths by shortening
any branches of variable length if possible.   
shorten_branches might be called multiple times:  for example, the SH
port splits out-of-range conditional branches in MACHINE_DEPENDENT_REORG.
In order to do this, it needs proper length information, which it obtains
by calling shorten_branches.  This cannot be collapsed with
shorten_branches itself into a single pass unless we also want to integrate
reorg.cc, since the branch splitting exposes new instructions with delay
slots.   

References ADDR_DIFF_VEC_FLAGS, ADDR_VEC_ALIGN, align_fuzz(), as_a(), asm_insn_count(), asm_noperands(), BARRIER_P, addr_diff_vec_flags::base_after_vec, crtl, DEBUG_INSN_P, rtx_insn::deleted(), dyn_cast(), fatal_insn, free(), gcc_assert, gcc_checking_assert, GET_CODE, get_insns(), get_last_insn(), get_max_uid(), GET_MODE_SIZE(), grow_label_align(), i, rtx_sequence::insn(), INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, insn_current_address, insn_current_align, insn_last_address, INSN_LENGTH_ALIGNMENT, insn_lengths, insn_lengths_max_uid, INSN_P, INSN_SHUID, INSN_UID(), JUMP_TABLE_DATA_P, jump_table_for_label(), JUMP_TABLES_IN_TEXT_SECTION, LABEL_ALIGN, LABEL_ALIGN_AFTER_BARRIER, LABEL_P, LABEL_TO_ALIGNMENT, rtx_sequence::len(), log(), align_flags::max(), addr_diff_vec_flags::max_after_base, addr_diff_vec_flags::max_after_vec, MAX_CODE_ALIGN, max_label_num(), max_labelno, max_uid, addr_diff_vec_flags::min_after_base, addr_diff_vec_flags::min_after_vec, addr_diff_vec_flags::min_align, min_align(), NEXT_INSN(), NONJUMP_INSN_P, NOTE_P, NULL_RTX, PATTERN(), PREV_INSN(), PUT_MODE(), readonly_data_section, safe_as_a(), table, text_section, uid_align, uid_shuid, XEXP, XVECEXP, and XVECLEN.

Referenced by rest_of_handle_shorten_branches().

◆ sprint_ul()

int sprint_ul ( char * s,
unsigned long value )
extern
Write an unsigned long as decimal to a string, fast.
s must be wide enough to not overflow, at least 21 chars.
Returns the length of the string (without terminating '\0').  

References sprint_ul_rev().

◆ switch_to_other_text_partition()

void switch_to_other_text_partition ( void )
extern
Switch to the other function partition (if inside of hot section
into cold section, otherwise into the hot section).   

References current_function_section(), in_cold_section_p, and switch_to_section().

◆ switch_to_section()

void switch_to_section ( section * new_section,
tree decl )
extern
Emit assembly code to switch to section NEW_SECTION.  Do nothing if
the current section is NEW_SECTION.   

References unnamed_section::callback, named_section::common, section::common, unnamed_section::data, named_section::decl, DECL_ATTRIBUTES, DECL_P, DECL_SOURCE_LOCATION, section_common::flags, gcc_unreachable, in_section, inform(), lookup_attribute(), named_section::name, section::named, SECTION_DECLARED, SECTION_NAMED, SECTION_NOSWITCH, SECTION_RETAIN, SECTION_STYLE, SECTION_UNNAMED, targetm, section::unnamed, and warning().

Referenced by assemble_addr_to_section(), assemble_end_function(), assemble_start_function(), assemble_trampoline_template(), assemble_variable(), symbol_table::compile(), default_print_patchable_function_entry(), dump_tm_clone_pairs(), dwarf2out_begin_prologue(), dwarf2out_switch_text_section(), elf_record_gcc_switches(), dwarf_file_hasher::equal(), file_end_indicate_exec_stack(), file_end_indicate_split_stack(), final_scan_insn_1(), find_empty_loc_ranges_at_text_label(), lhd_begin_section(), lhd_end_section(), output_btf_header(), output_comdat_type_unit(), output_comp_unit(), output_constant_def_contents(), output_constant_pool_contents(), output_ctf_header(), output_fde(), output_function_exception_table(), output_object_block(), output_pubtables(), output_ranges(), output_rnglists(), output_skeleton_debug_sections(), profile_function(), run_rtl_passes(), switch_to_comdat_section(), switch_to_eh_frame_section(), switch_to_exception_section(), switch_to_frame_table_section(), and switch_to_other_text_partition().

◆ unlikely_text_section()

section * unlikely_text_section ( void )
extern
Tell assembler to switch to unlikely-to-be-executed text section.   

References current_function_decl, and function_section_1().

Referenced by assemble_end_function(), assemble_start_function(), and find_empty_loc_ranges_at_text_label().

◆ unlikely_text_section_p()

bool unlikely_text_section_p ( section * sect)
extern
When called within a function context, return true if the function
has been assigned a cold text section and if SECT is that section.
When called outside a function context, return true if SECT is the
default cold section.   

References current_function_decl, and function_section_1().

◆ weak_finish()

Variable Documentation

◆ bss_noswitch_section

section* bss_noswitch_section
extern
A SECTION_NOSWITCH section used for declaring global BSS variables.
May be null.   

Referenced by get_variable_section(), have_global_bss_p(), and init_varasm_once().

◆ bss_section

section* bss_section
extern

◆ comm_section

section* comm_section
extern

◆ ctors_section

section* ctors_section
extern

Referenced by init_varasm_once().

◆ current_insn_predicate

rtx current_insn_predicate
extern
Nonnull if the insn currently being emitted was a COND_EXEC pattern.   

Referenced by final_scan_insn_1().

◆ current_output_insn

rtx_insn* current_output_insn
extern
Last insn processed by final_scan_insn.   

Referenced by final_scan_insn_1().

◆ data_section

◆ dtors_section

section* dtors_section
extern

Referenced by init_varasm_once().

◆ eh_frame_section

section* eh_frame_section
extern
The section that holds the DWARF2 frame unwind information, when known.
The section is set either by the target's init_sections hook or by the
first call to switch_to_eh_frame_section.   

Referenced by switch_to_eh_frame_section().

◆ exception_section

section* exception_section
extern
The section that holds the main exception table, when known.  The section
is set either by the target's init_sections hook or by the first call to
switch_to_exception_section.   

Referenced by switch_to_exception_section().

◆ final_sequence

rtx_sequence* final_sequence
extern
When outputting delayed branch sequences, this rtx holds the
sequence being output.  It is null when no delayed branch
sequence is being output, so it can be used as a test in the
insn output code.

This variable is defined  in final.cc.   
If we are outputting an insn sequence, this contains the sequence rtx.
Zero otherwise.   

Referenced by dbr_sequence_length(), final_scan_insn_1(), and init_final().

◆ first_function_block_is_cold

bool first_function_block_is_cold
extern
The following global variable indicates if the first basic block
in a function belongs to the cold partition or not.   

Referenced by assemble_end_function(), assemble_function_label_final(), assemble_start_function(), decide_function_section(), dw2_output_call_site_table(), dw_loc_list(), and function_section().

◆ first_global_object_name

const char * first_global_object_name
extern
File in which assembler code is being written.   
The first global object in the file.   
Output variables, constants and external declarations, for GNU compiler.
   Copyright (C) 1987-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/>.   
This file handles generation of all the assembler code
*except* the instructions of a function.
This includes declarations of variables and their initial values.

We also output the assembler code for constants stored in memory
and are responsible for combining constants with the same value.   
The (assembler) name of the first globally-visible object output.   

Referenced by coverage_compute_profile_id(), get_file_function_name(), and notice_global_symbol().

◆ in_cold_section_p

bool in_cold_section_p
extern

◆ in_section

section* in_section
extern
asm_out_file's current section.  This is NULL if no section has yet
been selected or if we lose track of what the current section is.   

Referenced by assemble_end_function(), assemble_zeros(), default_print_patchable_function_entry(), lhd_begin_section(), output_constant_pool_1(), switch_to_comdat_section(), and switch_to_section().

◆ last_assemble_variable_decl

tree last_assemble_variable_decl
extern
The last decl for which assemble_variable was called,
if it did ASM_DECLARE_OBJECT_NAME.
If the last call to assemble_variable didn't do that,
this holds 0.   

Referenced by assemble_variable(), assemble_variable_contents(), and rest_of_decl_compilation().

◆ lcomm_section

section* lcomm_section
extern

◆ readonly_data_section

◆ sbss_section

section* sbss_section
extern

Referenced by init_varasm_once().

◆ sdata_section

section* sdata_section
extern

Referenced by init_varasm_once().

◆ size_directive_output

int size_directive_output
extern
Carry information from ASM_DECLARE_OBJECT_NAME
to ASM_FINISH_DECLARE_OBJECT.   

◆ text_section

◆ this_is_asm_operands

const rtx_insn* this_is_asm_operands
extern
Nonzero while outputting an `asm' with operands.
This means that inconsistencies are the user's fault, so don't die.
The precise value is the insn being output, to pass to error_for_asm.   

Referenced by crash_signal(), final_scan_insn_1(), final_start_function_1(), output_asm_insn(), and output_operand_lossage().

◆ tls_comm_section

section* tls_comm_section
extern
Various forms of common section.  All are guaranteed to be nonnull.   

Referenced by get_variable_section(), and init_varasm_once().

◆ user_label_prefix

const char* user_label_prefix
extern
User label prefix in effect for this compilation.   
The user symbol prefix after having resolved same.   

Referenced by asm_fprintf(), symbol_table::assembler_names_equal_p(), symbol_table::decl_assembler_name_hash(), default_mangle_assembler_name(), and process_options().

◆ weak_global_object_name

const char * weak_global_object_name
extern
The first weak object in the file.   

Referenced by get_file_function_name(), and notice_global_symbol().