]> gcc.gnu.org Git - gcc.git/blame - gcc/output.h
final.c (no_asm_to_stream): New.
[gcc.git] / gcc / output.h
CommitLineData
0c2768fc
RS
1/* Declarations for insn-output.c. These functions are defined in recog.c,
2 final.c, and varasm.c.
af841dbd
JL
3 Copyright (C) 1987, 1991, 1994, 1997, 1998,
4 1999, 2000 Free Software Foundation, Inc.
0c2768fc
RS
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING. If not, write to
e99215a3
RK
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA. */
0c2768fc 22
9b1d8cd6 23/* Initialize data in final at the beginning of a compilation. */
13536812 24extern void init_final PARAMS ((const char *));
9b1d8cd6
RK
25
26/* Called at end of source file,
27 to output the block-profiling table for this entire compilation. */
13536812 28extern void end_final PARAMS ((const char *));
9b1d8cd6
RK
29
30/* Enable APP processing of subsequent output.
31 Used before the output from an `asm' statement. */
13536812 32extern void app_enable PARAMS ((void));
9b1d8cd6
RK
33
34/* Disable APP processing of subsequent output.
35 Called from varasm.c before most kinds of output. */
13536812 36extern void app_disable PARAMS ((void));
9b1d8cd6
RK
37
38/* Return the number of slots filled in the current
39 delayed branch sequence (we don't count the insn needing the
40 delay slot). Zero if not in a delayed branch sequence. */
13536812 41extern int dbr_sequence_length PARAMS ((void));
9b1d8cd6
RK
42
43/* Indicate that branch shortening hasn't yet been done. */
13536812 44extern void init_insn_lengths PARAMS ((void));
9b1d8cd6 45
ed068cf5 46#ifdef RTX_CODE
9b1d8cd6
RK
47/* Obtain the current length of an insn. If branch shortening has been done,
48 get its actual length. Otherwise, get its maximum length. */
13536812 49extern int get_attr_length PARAMS ((rtx));
9b1d8cd6
RK
50
51/* Make a pass over all insns and compute their actual lengths by shortening
52 any branches of variable length if possible. */
13536812 53extern void shorten_branches PARAMS ((rtx));
9b1d8cd6
RK
54
55/* Output assembler code for the start of a function,
56 and initialize some of the variables in this file
57 for the new function. The label for the function and associated
58 assembler pseudo-ops have already been output in
59 `assemble_start_function'. */
13536812 60extern void final_start_function PARAMS ((rtx, FILE *, int));
9b1d8cd6
RK
61
62/* Output assembler code for the end of a function.
63 For clarity, args are same as those of `final_start_function'
64 even though not all of them are needed. */
13536812 65extern void final_end_function PARAMS ((rtx, FILE *, int));
9b1d8cd6
RK
66
67/* Output assembler code for some insns: all or part of a function. */
13536812 68extern void final PARAMS ((rtx, FILE *, int, int));
9b1d8cd6
RK
69
70/* The final scan for one insn, INSN. Args are same as in `final', except
71 that INSN is the insn being scanned. Value returned is the next insn to
72 be scanned. */
13536812 73extern rtx final_scan_insn PARAMS ((rtx, FILE *, int, int, int));
9b1d8cd6
RK
74
75/* Replace a SUBREG with a REG or a MEM, based on the thing it is a
76 subreg of. */
13536812 77extern rtx alter_subreg PARAMS ((rtx));
9b1d8cd6
RK
78
79/* Report inconsistency between the assembler template and the operands.
80 In an `asm', it's the user's fault; otherwise, the compiler's fault. */
13536812 81extern void output_operand_lossage PARAMS ((const char *));
cf1c49cb 82
0c2768fc
RS
83/* Output a string of assembler code, substituting insn operands.
84 Defined in final.c. */
13536812 85extern void output_asm_insn PARAMS ((const char *, rtx *));
0c2768fc 86
487a6e06
KG
87/* Compute a worst-case reference address of a branch so that it
88 can be safely used in the presence of aligned labels.
89 Defined in final.c. */
13536812 90extern int insn_current_reference_address PARAMS ((rtx));
487a6e06 91
3873d24b
RH
92/* Find the alignment associated with a CODE_LABEL.
93 Defined in final.c. */
13536812 94extern int label_to_alignment PARAMS ((rtx));
3873d24b 95
9b1d8cd6 96/* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */
13536812 97extern void output_asm_label PARAMS ((rtx));
9b1d8cd6
RK
98
99/* Print a memory reference operand for address X
100 using machine-dependent assembler syntax. */
13536812 101extern void output_address PARAMS ((rtx));
1428a6b3 102
aaff8ce0
CH
103/* Print an integer constant expression in assembler syntax.
104 Addition and subtraction are the only arithmetic
105 that may appear in these expressions. */
13536812 106extern void output_addr_const PARAMS ((FILE *, rtx));
aaff8ce0 107
9b1d8cd6
RK
108/* Output a string of assembler code, substituting numbers, strings
109 and fixed syntactic prefixes. */
13536812 110extern void asm_fprintf PARAMS ((FILE *file, const char *p, ...));
9b1d8cd6
RK
111
112/* Split up a CONST_DOUBLE or integer constant rtx into two rtx's for single
113 words. */
13536812 114extern void split_double PARAMS ((rtx, rtx *, rtx *));
9b1d8cd6
RK
115
116/* Return nonzero if this function has no function calls. */
13536812 117extern int leaf_function_p PARAMS ((void));
9b1d8cd6
RK
118
119/* Return 1 if this function uses only the registers that can be
120 safely renumbered. */
13536812 121extern int only_leaf_regs_used PARAMS ((void));
9b1d8cd6
RK
122
123/* Scan IN_RTX and its subexpressions, and renumber all regs into those
124 available in leaf functions. */
13536812 125extern void leaf_renumber_regs_insn PARAMS ((rtx));
a1493f9f 126
4bbf910e 127/* Locate the proper template for the given insn-code. */
13536812 128extern const char *get_insn_template PARAMS ((int, rtx));
4bbf910e 129
a1493f9f 130/* Functions in flow.c */
13536812
KG
131extern void allocate_for_life_analysis PARAMS ((void));
132extern int regno_uninitialized PARAMS ((int));
133extern int regno_clobbered_at_setjmp PARAMS ((int));
19d3c25c 134extern void find_basic_blocks PARAMS ((rtx, int, FILE *));
2f2ee4bb 135extern void cleanup_cfg PARAMS ((void));
b313a0fe 136extern void check_function_return_warnings PARAMS ((void));
ed068cf5
RK
137#endif
138
139/* Functions in varasm.c. */
140
141/* Tell assembler to switch to text section. */
13536812 142extern void text_section PARAMS ((void));
ed068cf5
RK
143
144/* Tell assembler to switch to data section. */
13536812 145extern void data_section PARAMS ((void));
ed068cf5 146
3167de5b 147/* Tell assembler to make sure its in the data section. */
13536812 148extern void force_data_section PARAMS ((void));
3167de5b 149
ed068cf5
RK
150/* Tell assembler to switch to read-only data section. This is normally
151 the text section. */
13536812 152extern void readonly_data_section PARAMS ((void));
ed068cf5
RK
153
154/* Determine if we're in the text section. */
13536812 155extern int in_text_section PARAMS ((void));
ed068cf5 156
487a6e06 157#ifdef EH_FRAME_SECTION_ASM_OP
13536812 158extern void eh_frame_section PARAMS ((void));
487a6e06
KG
159#endif
160
7751947b
KG
161#ifdef CTORS_SECTION_ASM_OP
162extern void ctors_section PARAMS ((void));
163#endif
164
165#ifdef DTORS_SECTION_ASM_OP
166extern void dtors_section PARAMS ((void));
167#endif
168
169#ifdef BSS_SECTION_ASM_OP
170extern void bss_section PARAMS ((void));
171#endif
172
4dc94be7
KG
173#ifdef CONST_SECTION_ASM_OP
174extern void const_section PARAMS ((void));
175#endif
176
177#ifdef INIT_SECTION_ASM_OP
178extern void init_section PARAMS ((void));
179#endif
180
181#ifdef FINI_SECTION_ASM_OP
182extern void fini_section PARAMS ((void));
183#endif
7751947b 184
d0af450d
KG
185#ifdef TDESC_SECTION_ASM_OP
186extern void tdesc_section PARAMS ((void));
187#endif
188
ed068cf5
RK
189#ifdef TREE_CODE
190/* Tell assembler to change to section NAME for DECL.
191 If DECL is NULL, just switch to section NAME.
ad4ff310
JM
192 If NAME is NULL, get the name from DECL.
193 If RELOC is 1, the initializer for DECL contains relocs. */
13536812 194extern void named_section PARAMS ((tree, const char *, int));
ed068cf5 195
4d1065ed 196/* Tell assembler to switch to the section for function DECL. */
13536812 197extern void function_section PARAMS ((tree));
4d1065ed 198
6adb4e3a 199/* Tell assembler to switch to the section for the exception table. */
13536812 200extern void exception_section PARAMS ((void));
6adb4e3a 201
d6f4ec51 202/* Declare DECL to be a weak symbol. */
13536812 203extern void declare_weak PARAMS ((tree));
d6f4ec51
KG
204#endif /* TREE_CODE */
205
50b2596f 206/* Emit any pending weak declarations. */
13536812 207extern void weak_finish PARAMS ((void));
50b2596f 208
ed068cf5
RK
209/* Decode an `asm' spec for a declaration as a register name.
210 Return the register number, or -1 if nothing specified,
211 or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
212 or -3 if ASMSPEC is `cc' and is not recognized,
213 or -4 if ASMSPEC is `memory' and is not recognized.
214 Accept an exact spelling or a decimal number.
215 Prefixes such as % are optional. */
13536812 216extern int decode_reg_name PARAMS ((const char *));
ed068cf5 217
d6f4ec51 218#ifdef TREE_CODE
ed068cf5
RK
219/* Make the rtl for variable VAR be volatile.
220 Use this only for static variables. */
13536812 221extern void make_var_volatile PARAMS ((tree));
ed068cf5
RK
222
223/* Output alignment directive to align for constant expression EXP. */
13536812 224extern void assemble_constant_align PARAMS ((tree));
ed068cf5 225
13536812 226extern void assemble_alias PARAMS ((tree, tree));
d6f4ec51 227
ed068cf5
RK
228/* Output a string of literal assembler code
229 for an `asm' keyword used between functions. */
13536812 230extern void assemble_asm PARAMS ((tree));
ed068cf5 231
ed068cf5
RK
232/* Output assembler code for the constant pool of a function and associated
233 with defining the name of the function. DECL describes the function.
234 NAME is the function's name. For the constant pool, we use the current
235 constant pool data. */
3cce094d 236extern void assemble_start_function PARAMS ((tree, const char *));
ed068cf5
RK
237
238/* Output assembler code associated with defining the size of the
239 function. DECL describes the function. NAME is the function's name. */
13536812 240extern void assemble_end_function PARAMS ((tree, const char *));
ed068cf5 241
ed068cf5
RK
242/* Assemble everything that is needed for a variable or function declaration.
243 Not used for automatic variables, and not used for function definitions.
244 Should not be called for variables of incomplete structure type.
245
246 TOP_LEVEL is nonzero if this variable has file scope.
247 AT_END is nonzero if this is the special handling, at end of compilation,
248 to define things that have had only tentative definitions.
249 DONT_OUTPUT_DATA if nonzero means don't actually output the
250 initial value (that will be done by the caller). */
13536812 251extern void assemble_variable PARAMS ((tree, int, int, int));
ed068cf5 252
ed068cf5
RK
253/* Output something to declare an external symbol to the assembler.
254 (Most assemblers don't need this, so we normally output nothing.)
255 Do nothing if DECL is not external. */
13536812 256extern void assemble_external PARAMS ((tree));
d6f4ec51 257#endif /* TREE_CODE */
ed068cf5 258
d8d79d15
RE
259/* Record an element in the table of global destructors.
260 How this is done depends on what sort of assembler and linker
261 are in use.
262
263 NAME should be the name of a global function to be called
264 at exit time. This name is output using assemble_name. */
13536812 265extern void assemble_destructor PARAMS ((const char *));
d8d79d15
RE
266
267/* Likewise for global constructors. */
13536812 268extern void assemble_constructor PARAMS ((const char *));
d8d79d15
RE
269
270/* Likewise for entries we want to record for garbage collection.
271 Garbage collection is still under development. */
13536812 272extern void assemble_gc_entry PARAMS ((const char *));
d8d79d15
RE
273
274/* Assemble code to leave SIZE bytes of zeros. */
13536812 275extern void assemble_zeros PARAMS ((int));
d8d79d15
RE
276
277/* Assemble an alignment pseudo op for an ALIGN-bit boundary. */
13536812 278extern void assemble_align PARAMS ((int));
ce152ef8 279extern void assemble_eh_align PARAMS ((int));
d8d79d15
RE
280
281/* Assemble a string constant with the specified C string as contents. */
13536812 282extern void assemble_string PARAMS ((const char *, int));
d8d79d15 283
ed068cf5
RK
284#ifdef RTX_CODE
285/* Similar, for calling a library function FUN. */
13536812 286extern void assemble_external_libcall PARAMS ((rtx));
ed068cf5 287#endif
9b1d8cd6 288
ed068cf5 289/* Declare the label NAME global. */
13536812 290extern void assemble_global PARAMS ((const char *));
ed068cf5
RK
291
292/* Assemble a label named NAME. */
13536812 293extern void assemble_label PARAMS ((const char *));
ce152ef8 294extern void assemble_eh_label PARAMS ((const char *));
ed068cf5
RK
295
296/* Output to FILE a reference to the assembler name of a C-level name NAME.
297 If NAME starts with a *, the rest of NAME is output verbatim.
298 Otherwise NAME is transformed in an implementation-defined way
299 (usually by the addition of an underscore).
300 Many macros in the tm file are defined to call this function. */
13536812 301extern void assemble_name PARAMS ((FILE *, const char *));
ed068cf5
RK
302
303#ifdef RTX_CODE
304/* Assemble the integer constant X into an object of SIZE bytes.
305 X must be either a CONST_INT or CONST_DOUBLE.
306
307 Return 1 if we were able to output the constant, otherwise 0. If FORCE is
308 non-zero, abort if we can't output the constant. */
13536812 309extern int assemble_integer PARAMS ((rtx, int, int));
ce152ef8 310extern int assemble_eh_integer PARAMS ((rtx, int, int));
ed068cf5 311
68896bf9 312#ifdef REAL_VALUE_TYPE
ed068cf5 313/* Assemble the floating-point constant D into an object of size MODE. */
13536812 314extern void assemble_real PARAMS ((REAL_VALUE_TYPE,
ed068cf5
RK
315 enum machine_mode));
316#endif
317#endif
318
319/* At the end of a function, forget the memory-constants
320 previously made for CONST_DOUBLEs. Mark them as not on real_constant_chain.
321 Also clear out real_constant_chain and clear out all the chain-pointers. */
13536812 322extern void clear_const_double_mem PARAMS ((void));
ed068cf5
RK
323
324/* Start deferring output of subconstants. */
13536812 325extern void defer_addressed_constants PARAMS ((void));
ed068cf5
RK
326
327/* Stop deferring output of subconstants,
328 and output now all those that have been deferred. */
13536812 329extern void output_deferred_addressed_constants PARAMS ((void));
ed068cf5 330
ed068cf5 331/* Return the size of the constant pool. */
13536812 332extern int get_pool_size PARAMS ((void));
ed068cf5 333
36f0e0a6 334#ifdef HAVE_peephole
13536812 335extern rtx peephole PARAMS ((rtx));
36f0e0a6
KG
336#endif
337
ed068cf5
RK
338#ifdef TREE_CODE
339/* Write all the constants in the constant pool. */
13536812 340extern void output_constant_pool PARAMS ((const char *, tree));
ed068cf5 341
14a774a9
RK
342/* Return nonzero if VALUE is a valid constant-valued expression
343 for use in initializing a static variable; one that can be an
344 element of a "constant" initializer.
345
346 Return null_pointer_node if the value is absolute;
347 if it is relocatable, return the variable that determines the relocation.
348 We assume that VALUE has been folded as much as possible;
349 therefore, we do not need to check for such things as
350 arithmetic-combinations of integers. */
13536812 351extern tree initializer_constant_valid_p PARAMS ((tree, tree));
14a774a9 352
ed068cf5
RK
353/* Output assembler code for constant EXP to FILE, with no label.
354 This includes the pseudo-op such as ".int" or ".byte", and a newline.
355 Assumes output_addressed_constants has been done on EXP already.
356
357 Generate exactly SIZE bytes of assembler data, padding at the end
358 with zeros if necessary. SIZE must always be specified. */
13536812 359extern void output_constant PARAMS ((tree, int));
ed068cf5 360#endif
aaff8ce0 361
ed068cf5 362#ifdef RTX_CODE
0c2768fc
RS
363/* When outputting delayed branch sequences, this rtx holds the
364 sequence being output. It is null when no delayed branch
365 sequence is being output, so it can be used as a test in the
366 insn output code.
367
368 This variable is defined in final.c. */
369extern rtx final_sequence;
ed068cf5 370#endif
0c2768fc 371
49ad7cfa
BS
372/* The line number of the beginning of the current function.
373 sdbout.c needs this so that it can output relative linenumbers. */
0c2768fc 374
49ad7cfa
BS
375#ifdef SDB_DEBUGGING_INFO /* Avoid undef sym in certain broken linkers. */
376extern int sdb_begin_function_line;
377#endif
0c2768fc 378
49ad7cfa 379/* File in which assembler code is being written. */
0c2768fc 380
49ad7cfa
BS
381#ifdef BUFSIZ
382extern FILE *asm_out_file;
383#endif
3b304f5b
ZW
384
385/* The first global object in the file. */
386extern const char *first_global_object_name;
387
388/* The first weak object in the file. */
389extern const char *weak_global_object_name;
390
54ff41b7
JW
391/* Nonzero if function being compiled doesn't contain any calls
392 (ignoring the prologue and epilogue). This is set prior to
393 local register allocation and is valid for the remaining
394 compiler passes. */
395
396extern int current_function_is_leaf;
397
fb13d4d0
JM
398/* Nonzero if function being compiled doesn't contain any instructions
399 that can throw an exception. This is set prior to final. */
400
401extern int current_function_nothrow;
402
fdb8a883
JW
403/* Nonzero if function being compiled doesn't modify the stack pointer
404 (ignoring the prologue and epilogue). This is only valid after
405 life_analysis has run. */
406
407extern int current_function_sp_is_unchanging;
408
54ff41b7
JW
409/* Nonzero if the function being compiled is a leaf function which only
410 uses leaf registers. This is valid after reload (specifically after
411 sched2) and is useful only if the port defines LEAF_REGISTERS. */
412
413extern int current_function_uses_only_leaf_regs;
414
a86d864c
RH
415/* Default file in which to dump debug output. */
416
417#ifdef BUFSIZ
418extern FILE *rtl_dump_file;
419#endif
420
afe48e06 421/* Nonnull if the insn currently being emitted was a COND_EXEC pattern. */
afe48e06
RH
422extern struct rtx_def *current_insn_predicate;
423
b1a9f6a0
RH
424/* Last insn processed by final_scan_insn. */
425extern struct rtx_def *current_output_insn;
426
ad4ff310
JM
427/* Decide whether DECL needs to be in a writable section. RELOC is the same
428 as for SELECT_SECTION. */
429
430#define DECL_READONLY_SECTION(DECL,RELOC) \
431 (TREE_READONLY (DECL) \
432 && ! TREE_THIS_VOLATILE (DECL) \
433 && DECL_INITIAL (DECL) \
434 && (DECL_INITIAL (DECL) == error_mark_node \
435 || TREE_CONSTANT (DECL_INITIAL (DECL))) \
436 && ! (RELOC && (flag_pic || DECL_ONE_ONLY (DECL))))
19283265
RH
437
438/* User label prefix in effect for this compilation. */
87e11268 439extern const char *user_label_prefix;
98577d03 440
dd559f4e
JL
441/* This macro gets just the user-specified name
442 out of the string in a SYMBOL_REF. On most machines,
443 we discard the * if any and that's all. */
98577d03 444#ifndef STRIP_NAME_ENCODING
dd559f4e
JL
445#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
446 (VAR) = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*'))
98577d03 447#endif
411707f4
CC
448/* Assign unique numbers to labels generated for profiling. */
449
8480e480 450extern int profile_label_no;
08c148a8
NB
451
452/* Default target function prologue and epilogue assembler output. */
453extern void default_function_pro_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
b4c25db2
NB
454
455/* Default target hook that outputs nothing to a stream. */
456extern void no_asm_to_stream PARAMS ((FILE *));
This page took 1.448624 seconds and 5 git commands to generate.