GCC Middle and Back End API Reference
|
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) ATTRIBUTE_NONNULL(m) |
#define | assemble_aligned_integer(SIZE, VALUE) assemble_integer (VALUE, SIZE, (SIZE) * BITS_PER_UNIT, 1) |
#define | SECTION_ENTSIZE 0x000ff /* entity size in section */ |
#define | SECTION_CODE 0x00100 /* contains code */ |
#define | SECTION_WRITE 0x00200 /* data is writable */ |
#define | SECTION_DEBUG 0x00400 /* contains debug data */ |
#define | SECTION_LINKONCE 0x00800 /* is linkonce */ |
#define | SECTION_SMALL 0x01000 /* contains "small data" */ |
#define | SECTION_BSS 0x02000 /* contains zeros only */ |
#define | SECTION_FORGET 0x04000 /* forget that we've entered the section */ |
#define | SECTION_MERGE 0x08000 /* contains mergeable data */ |
#define | SECTION_STRINGS |
#define | SECTION_OVERRIDE 0x20000 /* allow override of default flags */ |
#define | SECTION_TLS 0x40000 /* contains thread-local storage */ |
#define | SECTION_NOTYPE 0x80000 /* don't output @progbits */ |
#define | SECTION_DECLARED 0x100000 /* section has been used */ |
#define | SECTION_STYLE_MASK 0x600000 /* bits used for SECTION_STYLE */ |
#define | SECTION_COMMON 0x800000 /* contains common data */ |
#define | SECTION_RELRO 0x1000000 /* data is readonly after relocation processing */ |
#define | SECTION_EXCLUDE 0x2000000 /* discarded by the linker */ |
#define | SECTION_MACH_DEP 0x4000000 /* subsequent bits reserved for target */ |
#define | SECTION_UNNAMED 0x000000 |
#define | SECTION_NAMED 0x200000 |
#define | SECTION_NOSWITCH 0x400000 |
#define | SECTION_STYLE(SECT) ((SECT)->common.flags & SECTION_STYLE_MASK) |
Typedefs | |
typedef void(* | unnamed_section_callback )(const void *) |
typedef bool(* | noswitch_section_callback )(tree decl, const char *name, unsigned HOST_WIDE_INT size, unsigned HOST_WIDE_INT rounded) |
#define assemble_aligned_integer | ( | SIZE, | |
VALUE | |||
) | assemble_integer (VALUE, SIZE, (SIZE) * BITS_PER_UNIT, 1) |
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.
#define ATTRIBUTE_ASM_FPRINTF | ( | m, | |
n | |||
) | ATTRIBUTE_NONNULL(m) |
Output a string of assembler code, substituting numbers, strings and fixed syntactic prefixes.
#define SECTION_BSS 0x02000 /* contains zeros only */ |
#define SECTION_CODE 0x00100 /* contains code */ |
#define SECTION_COMMON 0x800000 /* contains common data */ |
#define SECTION_DEBUG 0x00400 /* contains debug data */ |
Referenced by output_die().
#define SECTION_DECLARED 0x100000 /* section has been used */ |
#define SECTION_ENTSIZE 0x000ff /* entity size in section */ |
Flags controlling properties of a section.
#define SECTION_EXCLUDE 0x2000000 /* discarded by the linker */ |
#define SECTION_FORGET 0x04000 /* forget that we've entered the section */ |
#define SECTION_LINKONCE 0x00800 /* is linkonce */ |
Referenced by dw2_size_of_call_site_table(), and output_die().
#define SECTION_MACH_DEP 0x4000000 /* subsequent bits reserved for target */ |
#define SECTION_MERGE 0x08000 /* contains mergeable data */ |
Referenced by dwarf2out_decl(), and mergeable_string_section().
#define SECTION_NAMED 0x200000 |
This SECTION_STYLE is used for named sections that we can switch to using a general section directive.
#define SECTION_NOSWITCH 0x400000 |
This SECTION_STYLE is used for sections that we cannot switch to at all. The choice of section is implied by the directive that we use to declare the object.
Referenced by object_block_entry_hash().
#define SECTION_NOTYPE 0x80000 /* don't output @progbits */ |
#define SECTION_OVERRIDE 0x20000 /* allow override of default flags */ |
#define SECTION_RELRO 0x1000000 /* data is readonly after relocation processing */ |
Referenced by get_section().
#define SECTION_SMALL 0x01000 /* contains "small data" */ |
#define SECTION_STRINGS |
#define SECTION_STYLE | ( | SECT | ) | ((SECT)->common.flags & SECTION_STYLE_MASK) |
Return the style of section SECT.
#define SECTION_STYLE_MASK 0x600000 /* bits used for SECTION_STYLE */ |
#define SECTION_TLS 0x40000 /* contains thread-local storage */ |
#define SECTION_UNNAMED 0x000000 |
This SECTION_STYLE is used for unnamed sections that we can switch to using a special assembler directive.
Referenced by hash_section().
#define SECTION_WRITE 0x00200 /* data is writable */ |
Referenced by get_section(), and push_sleb128().
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.
typedef void(* unnamed_section_callback)(const void *) |
A callback that writes the assembly code for switching to an unnamed section. The argument provides callback-specific data.
enum section_category |
A helper function for default_elf_select_section and default_elf_unique_section. Categorizes the DECL.
Compute the alignment of variable specified by DECL. DONT_OUTPUT_DATA is from assemble_variable.
Referenced by cgraph_variable_initializer_availability().
Replace a SUBREG with a REG or a MEM, based on the thing it is a subreg of.
void app_disable | ( | void | ) |
Disable APP processing of subsequent output. Called from varasm.c before most kinds of output.
References label_alignment::alignment, and label_alignment::max_skip.
void app_enable | ( | void | ) |
Enable APP processing of subsequent output. Used before the output from an `asm' statement.
void asm_fprintf | ( | FILE * | file, |
const char * | p, | ||
... | |||
) |
Write the address of the entity given by SYMBOL to SEC.
void assemble_align | ( | int | ) |
Assemble an alignment pseudo op for an ALIGN-bit boundary.
Referenced by weak_finish_1().
void assemble_asm | ( | tree | ) |
Output a string of literal assembler code for an `asm' keyword used between functions.
Referenced by expand_all_functions().
void assemble_end_function | ( | tree | , |
const char * | |||
) |
Output assembler code associated with defining the size of the function. DECL describes the function. NAME is the function's name.
void assemble_external | ( | tree | ) |
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.
void assemble_external_libcall | ( | rtx | ) |
Similar, for calling a library function FUN.
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 assemble_static_space(), dw2_asm_output_data_sleb128(), final_start_function(), initializer_constant_valid_p_1(), output_constant(), and output_constructor_regular_field().
void assemble_integer_with_op | ( | const char * | , |
rtx | |||
) |
Use directive OP to assemble an integer object X. Print OP at the start of the line, followed immediately by the value of X.
Referenced by ultimate_transparent_alias_target().
void assemble_label | ( | FILE * | , |
const char * | |||
) |
Assemble a label named NAME.
void assemble_name | ( | FILE * | , |
const char * | |||
) |
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.
void assemble_name_raw | ( | FILE * | , |
const char * | |||
) |
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).
void assemble_start_function | ( | tree | , |
const char * | |||
) |
Output assembler code for the constant pool of a function and associated with defining the name of the function. DECL describes the function. NAME is the function's name. For the constant pool, we use the current constant pool data.
void assemble_string | ( | const char * | , |
int | |||
) |
Assemble a string constant with the specified C string as contents.
Referenced by initializer_constant_valid_p_1(), and lhd_builtin_function().
void assemble_variable | ( | tree | decl, |
int | top_level, | ||
int | at_end, | ||
int | dont_output_data | ||
) |
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).
This function is supposed to handle VARIABLES. Ensure we have one.
Emulated TLS had better not get this far.
Normally no need to say anything here for external references, since assemble_external is called by the language-specific code when a declaration is first seen.
Do nothing for global register variables.
If type was incomplete when the variable was declared, see if it is complete now.
Still incomplete => don't allocate it; treat the tentative defn (which is what it must have been) as an `extern' reference.
The first declaration of a variable that comes through this function decides whether it is global (in C, has external linkage) or local (in C, has internal linkage). So do nothing more if this function has already run.
Make sure targetm.encode_section_info is invoked before we set ASM_WRITTEN.
Do no output if -fsyntax-only.
If this symbol belongs to the tree constant pool, output the constant if it hasn't already been written.
Compute the alignment of this data.
First make the assembler name(s) global if appropriate.
Output any data that we will need to use the address of.
dbxout.c needs to know this.
If the decl is part of an object_block, make sure that the decl has been positioned within its block, but do not write out its definition yet. output_object_blocks will do that later.
The following bit of code ensures that vtable_map variables are not only in the comdat section, but that each variable has its own unique comdat name. If this code is removed, the variables end up in the same section with a single comdat name. 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)".
void assemble_vtv_preinit_initializer | ( | tree | ) |
Put the vtable verification constructor initialization function into the preinit array.
void assemble_zeros | ( | unsigned | HOST_WIDE_INT | ) |
Assemble code to leave SIZE bytes of zeros.
Referenced by assemble_string(), default_binds_local_p(), initializer_constant_valid_p_1(), output_constant(), and output_constructor_regular_field().
bool bss_initializer_p | ( | const_tree | ) |
enum section_category categorize_decl_for_section | ( | const_tree | , |
int | |||
) |
Referenced by make_decl_one_only().
int compute_reloc_for_constant | ( | tree | ) |
This can be used to compute RELOC for the function above, when given a constant expression.
Referenced by compare_constant().
section* current_function_section | ( | void | ) |
Return the section for the current function, take IN_COLD_SECTION_P into account.
int dbr_sequence_length | ( | void | ) |
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.
bool decl_readonly_section | ( | const_tree | , |
int | |||
) |
Decide whether DECL needs to be in a writable section. RELOC is the same as for SELECT_SECTION.
int decode_reg_name | ( | const char * | ) |
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.
int decode_reg_name_and_count | ( | const char * | , |
int * | |||
) |
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.
int default_address_cost | ( | rtx | , |
enum | machine_mode, | ||
addr_space_t | , | ||
bool | |||
) |
void default_asm_declare_constant_name | ( | FILE * | file, |
const char * | name, | ||
const_tree | exp, | ||
HOST_WIDE_INT | size | ||
) |
The default implementation of ASM_DECLARE_CONSTANT_NAME.
void default_asm_output_anchor | ( | rtx | ) |
void default_asm_output_source_filename | ( | FILE * | , |
const char * | |||
) |
The default implementation of the asm_out.integer target hook.
Avoid GAS bugs for large values. Specifically negative values whose absolute value fits in a bfd_vma, but not in a bfd_signed_vma.
References const_hash_1(), fixed_hash(), real_hash(), TREE_FIXED_CST_PTR, TREE_IMAGPART, TREE_INT_CST, TREE_REAL_CST_PTR, TREE_REALPART, TREE_STRING_LENGTH, and TREE_STRING_POINTER.
void default_assemble_visibility | ( | tree | decl, |
int | vis | ||
) |
Emit an assembler directive to set symbol for DECL visibility to the visibility type VIS, which must not be VISIBILITY_DEFAULT.
bool default_binds_local_p | ( | const_tree | ) |
bool default_binds_local_p_1 | ( | const_tree | , |
int | |||
) |
section* default_clone_table_section | ( | void | ) |
Provide a default for the tm_clone_table section.
void default_coff_asm_named_section | ( | const char * | , |
unsigned | int, | ||
tree | |||
) |
void default_ctor_section_asm_out_constructor | ( | rtx | , |
int | |||
) |
void default_dtor_section_asm_out_destructor | ( | rtx | , |
int | |||
) |
void default_elf_asm_named_section | ( | const char * | , |
unsigned | int, | ||
tree | |||
) |
If we have already declared this section, we can use an abbreviated form to switch back to it – unless this section is part of a COMDAT groups, in which case GAS requires the full declaration every time.
On platforms that use "@" as the assembly comment character, use "%" instead.
void default_elf_asm_output_ascii | ( | FILE * | , |
const char * | , | ||
unsigned | int | ||
) |
void default_elf_asm_output_external | ( | FILE * | file, |
tree | decl, | ||
const char * | name | ||
) |
Emit text to declare externally defined symbols. It is needed to properly support non-default visibility.
We output the name if and only if TREE_SYMBOL_REFERENCED is set in order to avoid putting out names that are never really used.
void default_elf_asm_output_limited_string | ( | FILE * | , |
const char * | |||
) |
void default_elf_fini_array_asm_out_destructor | ( | rtx | , |
int | |||
) |
void default_elf_init_array_asm_out_constructor | ( | rtx | , |
int | |||
) |
void default_elf_internal_label | ( | FILE * | , |
const char * | , | ||
unsigned | long | ||
) |
??? Handle small data here somehow.
References constant_descriptor_rtx::align, GET_MODE_SIZE, constant_descriptor_rtx::mode, and SYMBOL_REF_CONSTANT.
section* default_elf_select_section | ( | tree | decl, |
int | reloc, | ||
unsigned HOST_WIDE_INT | align | ||
) |
Select a section based on the above categorization.
We're not supposed to be called on FUNCTION_DECLs.
References decl_binds_to_current_def_p(), DECL_COMDAT, DECL_P, gcc_assert, and TREE_PUBLIC.
void default_emit_except_table_label | ( | FILE * | ) |
void default_emit_unwind_label | ( | FILE * | stream, |
tree | decl, | ||
int | for_eh, | ||
int | empty | ||
) |
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.
void default_file_start | ( | void | ) |
This is the default behavior at the beginning of a file. It's controlled by two other target-hook toggles.
void default_function_pro_epilogue | ( | FILE * | file, |
HOST_WIDE_INT | size | ||
) |
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 reemit_insn_block_notes().
Default target function switched text sections.
References app_on.
void default_generate_internal_label | ( | char * | buf, |
const char * | prefix, | ||
unsigned long | labelno | ||
) |
This is how to output an internal numbered label where PREFIX is the class of label and LABELNO is the number within the class.
void default_globalize_decl_name | ( | FILE * | , |
tree | |||
) |
void default_globalize_label | ( | FILE * | , |
const char * | |||
) |
void default_internal_label | ( | FILE * | stream, |
const char * | prefix, | ||
unsigned long | labelno | ||
) |
void default_named_section_asm_out_constructor | ( | rtx | , |
int | |||
) |
void default_named_section_asm_out_destructor | ( | rtx | , |
int | |||
) |
void default_no_named_section | ( | const char * | name, |
unsigned int | flags, | ||
tree | decl | ||
) |
Output assembly to switch to section NAME with attribute FLAGS. Four variants for common object file formats.
Some object formats don't support named sections at all. The front-end should already have flagged this as an error.
References targetm.
void default_pe_asm_named_section | ( | const char * | , |
unsigned | int, | ||
tree | |||
) |
Functions may have been compiled at various levels of optimization so we can't use `same_size' here. Instead, have the linker pick one.
unsigned int default_section_type_flags | ( | tree | , |
const char * | , | ||
int | |||
) |
References gcc_assert, offset, and SYMBOL_REF_BLOCK.
section* default_select_section | ( | tree | decl, |
int | reloc, | ||
unsigned HOST_WIDE_INT | align | ||
) |
The lame default section selector.
References resolution_local_p(), resolution_to_local_definition_p(), and varpool_get_node().
const char* default_strip_name_encoding | ( | const char * | ) |
void default_unique_section | ( | tree | , |
int | |||
) |
void file_end_indicate_exec_stack | ( | void | ) |
void file_end_indicate_split_stack | ( | void | ) |
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.
void final | ( | rtx | , |
FILE * | , | ||
int | |||
) |
Output assembler code for some insns: all or part of a function.
void final_end_function | ( | void | ) |
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.
Finally, output the function epilogue: code to restore the stack frame and return to the caller.
And debug output.
int final_forward_branch_p | ( | rtx | ) |
Return 1 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.
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.
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.
NOPEEPHOLES is the flag to disallow peephole processing (currently used for within delayed branch sequence output).
SEEN is used to track the end of the prologue, for emitting debug information. We force the emission of a line note after both NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG, or at the beginning of the second basic block, whichever comes first.
Ignore deleted insns. These can occur when we split insns (due to a template of "#") while not optimizing.
Output debugging info about the symbol-block beginning.
Mark this block as output.
End of a symbol-block.
Emit the label. We may have deleted the CODE_LABEL because the label could be proved to be unreachable, though still referenced (in the form of having its address taken.
Similarly, but need to use different namespace for it.
The target port might emit labels in the output function for some insn, e.g. sh.c output_branchy_insn.
If this label is followed by a jump-table, make sure we put the label in the read-only section. Also possibly write the label and jump table together.
Reset this early so it is correct for ASM statements.
An INSN, JUMP_INSN or CALL_INSN. First check for special kinds that recog doesn't recognize.
Detect insns that are really jump-tables and output them as such.
Output this line note if it is the first or the last line note in a row.
There's no telling what that did to the condition codes.
Detect `asm' construct with operands.
There's no telling what that did to the condition codes.
Get out the operand values.
Inhibit dying on what would otherwise be compiler bugs.
Output the insn using them.
A delayed-branch sequence
The first insn in this SEQUENCE might be a JUMP_INSN that will force the restoration of a comparison that was previously thought unnecessary. If that happens, cancel this sequence and cause that insn to be restored.
We loop in case any instruction in a delay slot gets split.
If the insn requiring the delay slot was a CALL_INSN, the insns in the delay slot are actually executed before the called function. Hence we don't preserve any CC-setting actions in these insns and the CC must be marked as being clobbered by the function.
We have a real machine instruction as rtl.
Try to recognize the instruction. If successful, verify that the operands satisfy the constraints for the instruction. Crash if they don't, since `reload' should have changed them so that they do.
Dump the insn in the assembly for debugging (-dAP). If the final dump is requested as slim RTL, dump slim RTL to the assembly file also.
Some target machines need to prescan each insn before it is output.
Find the proper template for this insn.
If the C code returns 0, it means that it is a jump insn which follows a deleted test insn, and that test insn needs to be reinserted.
We have already processed the notes between the setter and the user. Make sure we don't process them again, this is particularly important if one of the notes is a block scope note or an EH note.
If the template is the string "#", it means that this insn must be split.
If we didn't split the insn, go away.
If we have a length attribute, this instruction should have been split in shorten_branches, to ensure that we would have valid length info for the splitees.
??? This will put the directives in the wrong place if get_insn_template outputs assembly directly. However calling it before get_insn_template breaks if the insns is split.
Output assembler code from the template.
Some target machines need to postscan each insn after it is output.
References debug_hooks.
void final_start_function | ( | rtx | first, |
FILE * | file, | ||
int | optimize_p | ||
) |
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'.
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'.
FIRST is the first insn of the rtl for the function being compiled. FILE is the file to write assembler code to. OPTIMIZE_P is nonzero if we should eliminate redundant test and compare insns.
The Sun386i and perhaps other machines don't work right if the profiling code comes after the prologue.
If debugging, assign block numbers to all of the blocks in this function.
We never actually put out begin/end notes for the top-level block in the function. But, conceptually, that block is always needed.
Issue a warning
First output the function prologue: code to set up the stack frame.
If the machine represents the prologue as RTL, the profiling code must be emitted when NOTE_INSN_PROLOGUE_END is scanned.
References assemble_integer(), BITS_PER_UNIT, const0_rtx, current_function_funcdef_no, data_section, floor_log2(), LONG_TYPE_SIZE, MIN, switch_to_section(), and targetm.
void finish_tm_clone_pairs | ( | void | ) |
We need a determenistic order for the .tm_clone_table, otherwise we will get bootstrap comparison failures, so dump the hash table to a vector, sort it, and dump the vector.
Dump the hashtable to a vector.
Sort it.
Dump it.
Referenced by emit_debug_global_declarations().
void fprint_ul | ( | FILE * | , |
unsigned | long | ||
) |
void fprint_whex | ( | FILE * | , |
unsigned | HOST_WIDE_INT | ||
) |
int get_attr_length | ( | rtx | ) |
Obtain the current length of an insn. If branch shortening has been done, get its actual length. Otherwise, get its maximum length.
int get_attr_min_length | ( | rtx | ) |
Obtain the current length of an insn. If branch shortening has been done, get its actual length. Otherwise, get its minimum length.
Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if not) section for PRIORITY.
const char* get_insn_template | ( | int | , |
rtx | |||
) |
Locate the proper template for the given insn-code.
Referenced by default_function_section(), hot_function_section(), and resolve_unique_section().
section* get_named_text_section | ( | tree | decl, |
const char * | text_section_name, | ||
const char * | named_section_suffix | ||
) |
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".
Do not try to split gnu_linkonce functions. This gets somewhat slipperly.
References DECL_HAS_IMPLICIT_SECTION_NAME_P, DECL_SECTION_NAME, get_named_text_section(), NODE_FREQUENCY_HOT, NODE_FREQUENCY_UNLIKELY_EXECUTED, and NULL.
Referenced by get_named_text_section().
int get_pool_size | ( | void | ) |
Return the size of the constant pool.
Referenced by dw2_size_of_call_site_table(), mergeable_string_section(), and unlikely_text_section().
rtx get_section_anchor | ( | struct object_block * | block, |
HOST_WIDE_INT | offset, | ||
enum tls_model | model | ||
) |
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.
Work out the anchor's offset. Use an offset of 0 for the first anchor so that we don't pessimize the case where we take the address of a variable at the beginning of the block. This is particularly useful when a block has only one variable assigned to it. We try to place anchors RANGE bytes apart, so there can then be anchors at +/-RANGE, +/-2 * RANGE, and so on, up to the limits of a ptr_mode offset. With some target settings, the lowest such anchor might be out of range for the lowest ptr_mode offset; likewise the highest anchor for the highest offset. Use anchors at the extreme ends of the ptr_mode range in such cases. All arithmetic uses unsigned integers in order to avoid signed overflow.
Do a binary search to see if there's already an anchor we can use. Set BEGIN to the new anchor's index if not.
Create a new anchor with a unique label.
Insert it at index BEGIN.
section* get_unnamed_section | ( | unsigned int | flags, |
void(*)(const void *) | callback, | ||
const void * | data | ||
) |
Return a new unnamed section with the given fields.
bool have_global_bss_p | ( | void | ) |
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 MEM_P.
void init_final | ( | const char * | ) |
Declarations for insn-output.c and other code to write to asm_out_file. These functions are defined in final.c, and varasm.c. 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/. Initialize data in final at the beginning of a compilation.
void init_insn_lengths | ( | void | ) |
Indicate that branch shortening hasn't yet been done.
int insn_current_reference_address | ( | rtx | ) |
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.c.
const char* integer_asm_op | ( | int | , |
int | |||
) |
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.
Referenced by ultimate_transparent_alias_target().
int label_to_max_skip | ( | rtx | ) |
Find the alignment maximum skip associated with a CODE_LABEL. Defined in final.c.
void int leaf_function_p | ( | void | ) |
Return nonzero if this function has no function calls.
Referenced by split_live_ranges_for_shrink_wrap().
void leaf_renumber_regs_insn | ( | rtx | ) |
Scan IN_RTX and its subexpressions, and renumber all regs into those available in leaf functions.
Referenced by sprint_ul().
void mark_symbol_refs_as_used | ( | rtx | ) |
Marks SYMBOL_REFs in x as referenced through use of assemble_external.
int maybe_assemble_visibility | ( | tree | ) |
Referenced by decide_function_section().
section* mergeable_constant_section | ( | enum machine_mode | mode, |
unsigned HOST_WIDE_INT | align, | ||
unsigned int | flags | ||
) |
Return the section to use for constant merging.
References reg_names, and strip_reg_name().
void no_asm_to_stream | ( | FILE * | ) |
Default target hook that outputs nothing to a stream.
int only_leaf_regs_used | ( | void | ) |
Return 1 if this function uses only the registers that can be safely renumbered.
void output_addr_const | ( | FILE * | , |
rtx | |||
) |
Print an integer constant expression in assembler syntax. Addition and subtraction are the only arithmetic that may appear in these expressions.
void output_address | ( | rtx | ) |
Print a memory reference operand for address X using machine-dependent assembler syntax.
void output_asm_insn | ( | const char * | , |
rtx * | |||
) |
Output a string of assembler code, substituting insn operands. Defined in final.c.
void output_asm_label | ( | rtx | ) |
Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol.
void output_constant | ( | tree | , |
unsigned | HOST_WIDE_INT, | ||
unsigned | int | ||
) |
Output assembler code for constant EXP to FILE, with no label. This includes the pseudo-op such as ".int" or ".byte", and a newline. Assumes output_addressed_constants has been done on EXP already.
Generate exactly SIZE bytes of assembler data, padding at the end with zeros if necessary. SIZE must always be specified.
ALIGN is the alignment in bits that may be assumed for the data.
Referenced by assemble_string(), and initializer_constant_valid_p_1().
void output_file_directive | ( | FILE * | , |
const char * | |||
) |
void output_object_blocks | ( | void | ) |
Output the definitions of all object_blocks.
Referenced by emit_debug_global_declarations().
void output_operand | ( | rtx | , |
int | |||
) |
Print an operand using machine-dependent assembler syntax.
void output_operand_lossage | ( | const char * | , |
... | |||
) |
Report inconsistency between the assembler template and the operands. In an `asm', it's the user's fault; otherwise, the compiler's fault.
void output_quoted_string | ( | FILE * | , |
const char * | |||
) |
void output_section_asm_op | ( | const void * | ) |
void output_shared_constant_pool | ( | void | ) |
Write the contents of the shared constant pool.
Referenced by emit_debug_global_declarations().
void output_stack_usage | ( | void | ) |
Output stack usage information.
Add the maximum amount of space pushed onto the stack.
Now on to the tricky part: dynamic stack allocation.
Add the size even in the unbounded case, this can't hurt.
We don't want to print the full qualified name because it can be long, so we strip the scope prefix, but we may need to deal with the suffix created by the compiler.
void place_block_symbol | ( | rtx | ) |
void shorten_branches | ( | rtx | ) |
Make a pass over all insns and compute their actual lengths by shortening any branches of variable length if possible.
int sprint_ul | ( | char * | , |
unsigned | long | ||
) |
void switch_to_section | ( | section * | ) |
Referenced by add_builtin_type(), final_start_function(), get_named_section(), and weak_finish_1().
section* unlikely_text_section | ( | void | ) |
Tell assembler to switch to unlikely-to-be-executed text section.
References alloca, and get_section().
void weak_finish | ( | void | ) |
Functions in varasm.c. Emit any pending weak declarations.
Emit any pending weak declarations.
Remove alias_decl from the weak list, but leave entries for the target alone.
Use ASM_WEAKEN_LABEL only if ASM_WEAKEN_DECL is not defined, otherwise we and weak_finish_1 would use different macros.
Remove the alias and the target from the pending weak list so that we do not emit any .weak directives for the former, nor multiple .weak directives for the latter.
Remove other weakrefs to the same target, to speed things up.
Referenced by emit_debug_global_declarations().
section* bss_noswitch_section |
A SECTION_NOSWITCH section used for declaring global BSS variables. May be null.
section* bss_section |
section* comm_section |
section* ctors_section |
rtx current_insn_predicate |
Nonnull if the insn currently being emitted was a COND_EXEC pattern.
rtx current_output_insn |
Last insn processed by final_scan_insn.
section* data_section |
Referenced by final_start_function().
section* dtors_section |
section* eh_frame_section |
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.
section* exception_section |
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.
rtx final_sequence |
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.c.
If we are outputting an insn sequence, this contains the sequence rtx. Zero otherwise.
bool first_function_block_is_cold |
The following global variable indicates if the first basic block in a function belongs to the cold partition or not.
const char * first_global_object_name |
The line number of the beginning of the current function. Various md code needs this so that it can output relative linenumbers. File in which assembler code is being written. The first global object in the file.
Referenced by make_decl_rtl_for_debug().
bool in_cold_section_p |
True if code for the current function is currently being directed at the cold section.
section* in_section |
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.
tree last_assemble_variable_decl |
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.
section* lcomm_section |
section* readonly_data_section |
Referenced by mergeable_string_section().
section* sbss_section |
section* sdata_section |
int size_directive_output |
Carry information from ASM_DECLARE_OBJECT_NAME to ASM_FINISH_DECLARE_OBJECT.
section* text_section |
Special well-known sections.
Well-known sections, each one associated with some sort of *_ASM_OP.
Referenced by resolve_unique_section().
rtx this_is_asm_operands |
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.
section* tls_comm_section |
Various forms of common section. All are guaranteed to be nonnull.
const char* user_label_prefix |
User label prefix in effect for this compilation.
Referenced by crash_signal(), and decl_assembler_name().
const char * weak_global_object_name |
The first weak object in the file.
Referenced by make_decl_rtl_for_debug().