/* 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-2015 Free Software Foundation, Inc.
+ Copyright (C) 1987-2022 Free Software Foundation, Inc.
This file is part of GCC.
/* Find the alignment associated with a CODE_LABEL.
Defined in final.c. */
-extern int label_to_alignment (rtx);
-
-/* Find the alignment maximum skip associated with a CODE_LABEL.
- Defined in final.c. */
-extern int label_to_max_skip (rtx);
+extern align_flags label_to_alignment (rtx);
/* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */
extern void output_asm_label (rtx);
/* Marks SYMBOL_REFs in x as referenced through use of assemble_external. */
extern void mark_symbol_refs_as_used (rtx);
-/* Print a memory reference operand for address X
+/* Print a memory reference operand for address X with access mode MODE
using machine-dependent assembler syntax. */
-extern void output_address (rtx);
+extern void output_address (machine_mode, rtx);
/* Print an integer constant expression in assembler syntax.
Addition and subtraction are the only arithmetic
extern void leaf_renumber_regs_insn (rtx);
/* Locate the proper template for the given insn-code. */
-extern const char *get_insn_template (int, rtx);
+extern const char *get_insn_template (int, rtx_insn *);
/* Functions in varasm.c. */
extern int decode_reg_name_and_count (const char *, int *);
extern void do_assemble_alias (tree, tree);
+extern void do_assemble_symver (tree, tree);
extern void default_assemble_visibility (tree, int);
extern void assemble_zeros (unsigned HOST_WIDE_INT);
/* Assemble an alignment pseudo op for an ALIGN-bit boundary. */
-extern void assemble_align (int);
+extern void assemble_align (unsigned int);
/* Assemble a string constant with the specified C string as contents. */
extern void assemble_string (const char *, int);
addition of an underscore). */
extern void assemble_name_raw (FILE *, const char *);
+/* 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. */
+extern const char *assemble_name_resolve (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
#define assemble_aligned_integer(SIZE, VALUE) \
assemble_integer (VALUE, SIZE, (SIZE) * BITS_PER_UNIT, 1)
-#ifdef REAL_VALUE_TYPE_SIZE
-/* Assemble the floating-point constant D into an object of size MODE. */
-extern void assemble_real (REAL_VALUE_TYPE, machine_mode, unsigned);
-#endif
+/* 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. */
+extern void assemble_real (REAL_VALUE_TYPE, scalar_float_mode, unsigned,
+ bool = false);
/* Write the address of the entity given by SYMBOL to SEC. */
extern void assemble_addr_to_section (rtx, section *);
-/* Return the size of the constant pool. */
-extern int get_pool_size (void);
+/* 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. */
+extern bool constant_pool_empty_p (void);
-#ifdef HAVE_peephole
extern rtx_insn *peephole (rtx_insn *);
-#endif
extern void output_shared_constant_pool (void);
This variable is defined in final.c. */
extern rtx_sequence *final_sequence;
-/* The line number of the beginning of the current function. Various
- md code needs this so that it can output relative linenumbers. */
-
-#ifdef SDB_DEBUGGING_INFO /* Avoid undef sym in certain broken linkers. */
-extern int sdb_begin_function_line;
-#endif
-
/* File in which assembler code is being written. */
#ifdef BUFSIZ
given a constant expression. */
extern int compute_reloc_for_constant (tree);
+/* This can be used to compute RELOC for get_variable_section. */
+extern int compute_reloc_for_var (tree);
+
/* User label prefix in effect for this compilation. */
extern const char *user_label_prefix;
/* Default target function prologue and epilogue assembler output. */
-extern void default_function_pro_epilogue (FILE *, HOST_WIDE_INT);
+extern void default_function_pro_epilogue (FILE *);
/* Default target function switched text sections. */
extern void default_function_switched_text_sections (FILE *, tree, bool);
extern void no_asm_to_stream (FILE *);
/* Flags controlling properties of a section. */
-#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 0x10000 /* contains zero terminated strings without
- embedded zeros */
-#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 */
-
-/* This SECTION_STYLE is used for unnamed sections that we can switch
- to using a special assembler directive. */
-#define SECTION_UNNAMED 0x000000
-
-/* This SECTION_STYLE is used for named sections that we can switch
- to using a general section directive. */
-#define SECTION_NAMED 0x200000
-
-/* 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. */
-#define SECTION_NOSWITCH 0x400000
+enum section_flag
+{
+ /* This SECTION_STYLE is used for unnamed sections that we can switch
+ to using a special assembler directive. */
+ SECTION_UNNAMED = 0,
+
+ SECTION_ENTSIZE = (1UL << 8) - 1, /* entity size in section */
+ SECTION_CODE = 1UL << 8, /* contains code */
+ SECTION_WRITE = 1UL << 9, /* data is writable */
+
+ SECTION_DEBUG = 1UL << 10, /* contains debug data */
+ SECTION_LINKONCE = 1UL << 11, /* is linkonce */
+ SECTION_SMALL = 1UL << 12, /* contains "small data" */
+ SECTION_BSS = 1UL << 13, /* contains zeros only */
+ SECTION_MERGE = 1UL << 14, /* contains mergeable data */
+ SECTION_STRINGS = 1UL << 15, /* contains zero terminated strings
+ without embedded zeros */
+ SECTION_OVERRIDE = 1UL << 16, /* allow override of default flags */
+ SECTION_TLS = 1UL << 17, /* contains thread-local storage */
+ SECTION_NOTYPE = 1UL << 18, /* don't output @progbits */
+ SECTION_DECLARED = 1UL << 19, /* section has been used */
+
+ /* This SECTION_STYLE is used for named sections that we can switch
+ to using a general section directive. */
+ SECTION_NAMED = 1UL << 20,
+
+ /* 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. */
+ SECTION_NOSWITCH = 1UL << 21,
+
+ /* bits used for SECTION_STYLE */
+ SECTION_STYLE_MASK = SECTION_NAMED | SECTION_NOSWITCH,
+
+ SECTION_COMMON = 1UL << 22, /* contains common data */
+ SECTION_RELRO = 1UL << 23, /* data is readonly after
+ relocation processing */
+ SECTION_EXCLUDE = 1UL << 24, /* discarded by the linker */
+ SECTION_RETAIN = 1UL << 25, /* retained by the linker. */
+ SECTION_LINK_ORDER = 1UL << 26, /* section needs link-order. */
+
+ /* NB: The maximum SECTION_MACH_DEP is (1UL << 28) since AVR needs 4 bits
+ in SECTION_MACH_DEP. */
+ SECTION_MACH_DEP = 1UL << 27,
+
+ /* subsequent bits reserved for target */
+};
/* A helper function for default_elf_select_section and
default_elf_unique_section. Categorizes the DECL. */
/* A callback that writes the assembly code for switching to an unnamed
section. The argument provides callback-specific data. */
-typedef void (*unnamed_section_callback) (const void *);
+typedef void (*unnamed_section_callback) (const char *);
/* Information about a SECTION_UNNAMED section. */
struct GTY(()) unnamed_section {
/* The callback used to switch to the section, and the data that
should be passed to the callback. */
- unnamed_section_callback GTY ((skip)) callback;
- const void *GTY ((skip)) data;
+ unnamed_section_callback GTY ((callback)) callback;
+ const char *data;
/* The next entry in the chain of unnamed sections. */
section *next;
struct section_common common;
/* The callback used to assemble decls in this section. */
- noswitch_section_callback GTY ((skip)) callback;
+ noswitch_section_callback GTY ((callback)) callback;
};
/* Information about a section, which may be named or unnamed. */
extern GTY(()) section *in_section;
extern GTY(()) bool in_cold_section_p;
-extern section *get_unnamed_section (unsigned int, void (*) (const void *),
- const void *);
-extern section *get_section (const char *, unsigned int, tree);
+extern section *get_unnamed_section (unsigned int, void (*) (const char *),
+ const char *);
+extern section *get_section (const char *, unsigned int, tree,
+ bool not_existing = false);
extern section *get_named_section (tree, const char *, int);
extern section *get_variable_section (tree, bool);
extern void place_block_symbol (rtx);
extern section *function_section (tree);
extern section *unlikely_text_section (void);
extern section *current_function_section (void);
+extern void switch_to_other_text_partition (void);
/* Return the numbered .ctors.N (if CONSTRUCTOR_P) or .dtors.N (if
not) section for PRIORITY. */
extern section *get_cdtor_priority_section (int, bool);
extern bool unlikely_text_section_p (section *);
-extern void switch_to_section (section *);
-extern void output_section_asm_op (const void *);
+extern void switch_to_section (section *, tree = nullptr);
+extern void output_section_asm_op (const char *);
extern void record_tm_clone_pair (tree, tree);
extern void finish_tm_clone_pairs (void);
extern unsigned int default_section_type_flags (tree, const char *, int);
extern bool have_global_bss_p (void);
-extern bool bss_initializer_p (const_tree);
+extern bool bss_initializer_p (const_tree, bool = false);
extern void default_no_named_section (const char *, unsigned int, tree);
extern void default_elf_asm_named_section (const char *, unsigned int, tree);
extern section *default_select_section (tree, int, unsigned HOST_WIDE_INT);
extern section *default_elf_select_section (tree, int, unsigned HOST_WIDE_INT);
extern void default_unique_section (tree, int);
-extern section *default_function_rodata_section (tree);
-extern section *default_no_function_rodata_section (tree);
+extern section *default_function_rodata_section (tree, bool);
+extern section *default_no_function_rodata_section (tree, bool);
extern section *default_clone_table_section (void);
extern section *default_select_rtx_section (machine_mode, rtx,
unsigned HOST_WIDE_INT);
extern int default_address_cost (rtx, machine_mode, addr_space_t, bool);
-/* Output stack usage information. */
+/* Stack usage. */
extern void output_stack_usage (void);
#endif /* ! GCC_OUTPUT_H */