source: trunk/third/gcc/output.h @ 11288

Revision 11288, 16.4 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r11287, which included commits to RCS files with non-trunk default branches.
Line 
1/* Declarations for insn-output.c.  These functions are defined in recog.c,
2   final.c, and varasm.c.
3   Copyright (C) 1987, 1991, 1994, 1997 Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING.  If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA.  */
21
22/* Initialize data in final at the beginning of a compilation.  */
23extern void init_final          PROTO((char *));
24
25/* Called at end of source file,
26   to output the block-profiling table for this entire compilation.  */
27extern void end_final           PROTO((char *));
28
29/* Enable APP processing of subsequent output.
30   Used before the output from an `asm' statement.  */
31extern void app_enable          PROTO((void));
32
33/* Disable APP processing of subsequent output.
34   Called from varasm.c before most kinds of output.  */
35extern void app_disable         PROTO((void));
36
37/* Return the number of slots filled in the current
38   delayed branch sequence (we don't count the insn needing the
39   delay slot).   Zero if not in a delayed branch sequence.  */
40extern int dbr_sequence_length  PROTO((void));
41
42/* Indicate that branch shortening hasn't yet been done.  */
43extern void init_insn_lengths   PROTO((void));
44
45#ifdef RTX_CODE
46/* Obtain the current length of an insn.  If branch shortening has been done,
47   get its actual length.  Otherwise, get its maximum length.  */
48extern int get_attr_length      PROTO((rtx));
49
50/* Make a pass over all insns and compute their actual lengths by shortening
51   any branches of variable length if possible.  */
52extern void shorten_branches    PROTO((rtx));
53
54/* Output assembler code for the start of a function,
55   and initialize some of the variables in this file
56   for the new function.  The label for the function and associated
57   assembler pseudo-ops have already been output in
58   `assemble_start_function'.  */
59extern void final_start_function  PROTO((rtx, FILE *, int));
60
61/* Output assembler code for the end of a function.
62   For clarity, args are same as those of `final_start_function'
63   even though not all of them are needed.  */
64extern void final_end_function  PROTO((rtx, FILE *, int));
65
66/* Output assembler code for some insns: all or part of a function.  */
67extern void final               PROTO((rtx, FILE *, int, int));
68
69/* The final scan for one insn, INSN.  Args are same as in `final', except
70   that INSN is the insn being scanned.  Value returned is the next insn to
71   be scanned.  */
72extern rtx final_scan_insn      PROTO((rtx, FILE *, int, int, int));
73
74/* Replace a SUBREG with a REG or a MEM, based on the thing it is a
75   subreg of.  */
76extern rtx alter_subreg PROTO((rtx));
77
78/* Report inconsistency between the assembler template and the operands.
79   In an `asm', it's the user's fault; otherwise, the compiler's fault.  */
80extern void output_operand_lossage  PROTO((char *));
81
82/* Output a string of assembler code, substituting insn operands.
83   Defined in final.c.  */
84extern void output_asm_insn     PROTO((char *, rtx *));
85
86/* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol.  */
87extern void output_asm_label    PROTO((rtx));
88
89/* Print a memory reference operand for address X
90   using machine-dependent assembler syntax.  */
91extern void output_address      PROTO((rtx));
92
93/* Print an integer constant expression in assembler syntax.
94   Addition and subtraction are the only arithmetic
95   that may appear in these expressions.  */
96extern void output_addr_const PROTO((FILE *, rtx));
97
98/* Output a string of assembler code, substituting numbers, strings
99   and fixed syntactic prefixes.  */
100extern void asm_fprintf         PROTO(PVPROTO((FILE *file, char *p, ...)));
101
102/* Split up a CONST_DOUBLE or integer constant rtx into two rtx's for single
103   words.  */
104extern void split_double        PROTO((rtx, rtx *, rtx *));
105
106/* Return nonzero if this function has no function calls.  */
107extern int leaf_function_p      PROTO((void));
108
109/* Return 1 if this function uses only the registers that can be
110   safely renumbered.  */
111extern int only_leaf_regs_used  PROTO((void));
112
113/* Scan IN_RTX and its subexpressions, and renumber all regs into those
114   available in leaf functions.  */
115extern void leaf_renumber_regs_insn PROTO((rtx));
116
117/* Functions in flow.c */
118extern void allocate_for_life_analysis  PROTO((void));
119extern int regno_uninitialized          PROTO((int));
120extern int regno_clobbered_at_setjmp    PROTO((int));
121extern void dump_flow_info              PROTO((FILE *));
122extern void flow_analysis               PROTO((rtx, int, FILE *));
123#endif
124
125/* Functions in varasm.c.  */
126
127/* Tell assembler to switch to text section.  */
128extern void text_section                PROTO((void));
129
130/* Tell assembler to switch to data section.  */
131extern void data_section                PROTO((void));
132
133/* Tell assembler to switch to read-only data section.  This is normally
134   the text section.  */
135extern void readonly_data_section       PROTO((void));
136
137/* Determine if we're in the text section. */
138extern int in_text_section              PROTO((void));
139
140#ifdef TREE_CODE
141/* Tell assembler to change to section NAME for DECL.
142   If DECL is NULL, just switch to section NAME.
143   If NAME is NULL, get the name from DECL.
144   If RELOC is 1, the initializer for DECL contains relocs.  */
145extern void named_section               PROTO((tree, char *, int));
146
147/* Tell assembler to switch to the section for function DECL.  */
148extern void function_section            PROTO((tree));
149
150/* Tell assembler to switch to the section for the exception table.  */
151extern void exception_section           PROTO((void));
152
153/* Create the rtl to represent a function, for a function definition.
154   DECL is a FUNCTION_DECL node which describes which function.
155   The rtl is stored into DECL.  */
156extern void make_function_rtl           PROTO((tree));
157
158/* Decode an `asm' spec for a declaration as a register name.
159   Return the register number, or -1 if nothing specified,
160   or -2 if the ASMSPEC is not `cc' or `memory' and is not recognized,
161   or -3 if ASMSPEC is `cc' and is not recognized,
162   or -4 if ASMSPEC is `memory' and is not recognized.
163   Accept an exact spelling or a decimal number.
164   Prefixes such as % are optional.  */
165extern int decode_reg_name              PROTO((char *));
166
167/* Create the DECL_RTL for a declaration for a static or external variable
168   or static or external function.
169   ASMSPEC, if not 0, is the string which the user specified
170   as the assembler symbol name.
171   TOP_LEVEL is nonzero if this is a file-scope variable.
172
173   This is never called for PARM_DECL nodes.  */
174extern void make_decl_rtl               PROTO((tree, char *, int));
175
176/* Make the rtl for variable VAR be volatile.
177   Use this only for static variables.  */
178extern void make_var_volatile           PROTO((tree));
179
180/* Output alignment directive to align for constant expression EXP.  */
181extern void assemble_constant_align     PROTO((tree));
182
183/* Output a string of literal assembler code
184   for an `asm' keyword used between functions.  */
185extern void assemble_asm                PROTO((tree));
186
187/* Record an element in the table of global destructors.
188   How this is done depends on what sort of assembler and linker
189   are in use.
190
191   NAME should be the name of a global function to be called
192   at exit time.  This name is output using assemble_name.  */
193extern void assemble_destructor         PROTO((char *));
194
195/* Likewise for global constructors.  */
196extern void assemble_constructor        PROTO((char *));
197
198/* Likewise for entries we want to record for garbage collection.
199   Garbage collection is still under development.  */
200extern void assemble_gc_entry           PROTO((char *));
201
202/* Output assembler code for the constant pool of a function and associated
203   with defining the name of the function.  DECL describes the function.
204   NAME is the function's name.  For the constant pool, we use the current
205   constant pool data.  */
206extern void assemble_start_function     PROTO((tree, char *));
207
208/* Output assembler code associated with defining the size of the
209   function.  DECL describes the function.  NAME is the function's name.  */
210extern void assemble_end_function       PROTO((tree, char *));
211
212/* Assemble code to leave SIZE bytes of zeros.  */
213extern void assemble_zeros              PROTO((int));
214
215/* Assemble an alignment pseudo op for an ALIGN-bit boundary.  */
216extern void assemble_align              PROTO((int));
217
218/* Assemble a string constant with the specified C string as contents.  */
219extern void assemble_string             PROTO((char *, int));
220/* Assemble everything that is needed for a variable or function declaration.
221   Not used for automatic variables, and not used for function definitions.
222   Should not be called for variables of incomplete structure type.
223
224   TOP_LEVEL is nonzero if this variable has file scope.
225   AT_END is nonzero if this is the special handling, at end of compilation,
226   to define things that have had only tentative definitions.
227   DONT_OUTPUT_DATA if nonzero means don't actually output the
228   initial value (that will be done by the caller).  */
229extern void assemble_variable           PROTO((tree, int, int, int));
230
231/* Output text storage for constructor CONSTR. */
232extern void bc_output_constructor       PROTO((tree, int));
233
234/* Create storage for constructor CONSTR. */
235extern void bc_output_data_constructor  PROTO((tree));
236
237/* Output something to declare an external symbol to the assembler.
238   (Most assemblers don't need this, so we normally output nothing.)
239   Do nothing if DECL is not external.  */
240extern void assemble_external           PROTO((tree));
241#endif
242
243#ifdef RTX_CODE
244/* Similar, for calling a library function FUN.  */
245extern void assemble_external_libcall   PROTO((rtx));
246#endif
247
248/* Declare the label NAME global.  */
249extern void assemble_global             PROTO((char *));
250
251/* Assemble a label named NAME.  */
252extern void assemble_label              PROTO((char *));
253
254/* Output to FILE a reference to the assembler name of a C-level name NAME.
255   If NAME starts with a *, the rest of NAME is output verbatim.
256   Otherwise NAME is transformed in an implementation-defined way
257   (usually by the addition of an underscore).
258   Many macros in the tm file are defined to call this function.  */
259extern void assemble_name               PROTO((FILE *, char *));
260
261#ifdef RTX_CODE
262/* Assemble the integer constant X into an object of SIZE bytes.
263   X must be either a CONST_INT or CONST_DOUBLE.
264
265   Return 1 if we were able to output the constant, otherwise 0.  If FORCE is
266   non-zero, abort if we can't output the constant.  */
267extern int assemble_integer             PROTO((rtx, int, int));
268
269#ifdef EMUSHORT
270/* Assemble the floating-point constant D into an object of size MODE.  */
271extern void assemble_real               PROTO((REAL_VALUE_TYPE,
272                                               enum machine_mode));
273#endif
274#endif
275
276/* At the end of a function, forget the memory-constants
277   previously made for CONST_DOUBLEs.  Mark them as not on real_constant_chain.
278   Also clear out real_constant_chain and clear out all the chain-pointers.  */
279extern void clear_const_double_mem      PROTO((void));
280
281/* Start deferring output of subconstants.  */
282extern void defer_addressed_constants   PROTO((void));
283
284/* Stop deferring output of subconstants,
285   and output now all those that have been deferred.  */
286extern void output_deferred_addressed_constants PROTO((void));
287
288/* Initialize constant pool hashing for next function.  */
289extern void init_const_rtx_hash_table   PROTO((void));
290
291/* Return the size of the constant pool.  */
292extern int get_pool_size                PROTO((void));
293
294#ifdef TREE_CODE
295/* Write all the constants in the constant pool.  */
296extern void output_constant_pool        PROTO((char *, tree));
297
298/* Output assembler code for constant EXP to FILE, with no label.
299   This includes the pseudo-op such as ".int" or ".byte", and a newline.
300   Assumes output_addressed_constants has been done on EXP already.
301
302   Generate exactly SIZE bytes of assembler data, padding at the end
303   with zeros if necessary.  SIZE must always be specified.  */
304extern void output_constant             PROTO((tree, int));
305#endif
306
307/* When outputting assembler code, indicates which alternative
308   of the constraints was actually satisfied.  */
309extern int which_alternative;
310
311#ifdef RTX_CODE
312/* When outputting delayed branch sequences, this rtx holds the
313   sequence being output.  It is null when no delayed branch
314   sequence is being output, so it can be used as a test in the
315   insn output code.
316
317   This variable is defined  in final.c.  */
318extern rtx final_sequence;
319#endif
320
321/* Number of bytes of args popped by function being compiled on its return.
322   Zero if no bytes are to be popped.
323   May affect compilation of return insn or of function epilogue.  */
324
325extern int current_function_pops_args;
326
327/* Nonzero if function being compiled needs to be given an address
328   where the value should be stored.  */
329
330extern int current_function_returns_struct;
331
332/* Nonzero if function being compiled needs to
333   return the address of where it has put a structure value.  */
334
335extern int current_function_returns_pcc_struct;
336
337/* Nonzero if function being compiled needs to be passed a static chain.  */
338
339extern int current_function_needs_context;
340
341/* Nonzero if function being compiled can call setjmp.  */
342
343extern int current_function_calls_setjmp;
344
345/* Nonzero if function being compiled can call longjmp.  */
346
347extern int current_function_calls_longjmp;
348
349/* Nonzero if function being compiled can call alloca,
350   either as a subroutine or builtin.  */
351
352extern int current_function_calls_alloca;
353
354/* Nonzero if function being compiled receives nonlocal gotos
355   from nested functions.  */
356
357extern int current_function_has_nonlocal_label;
358
359/* Nonzero if function being compiled contains nested functions.  */
360
361extern int current_function_contains_functions;
362
363/* Nonzero if the current function returns a pointer type */
364
365extern int current_function_returns_pointer;
366
367/* If function's args have a fixed size, this is that size, in bytes.
368   Otherwise, it is -1.
369   May affect compilation of return insn or of function epilogue.  */
370
371extern int current_function_args_size;
372
373/* # bytes the prologue should push and pretend that the caller pushed them.
374   The prologue must do this, but only if parms can be passed in registers.  */
375
376extern int current_function_pretend_args_size;
377
378/* # of bytes of outgoing arguments required to be pushed by the prologue.
379   If this is non-zero, it means that ACCUMULATE_OUTGOING_ARGS was defined
380   and no stack adjusts will be done on function calls.  */
381
382extern int current_function_outgoing_args_size;
383
384/* Nonzero if current function uses varargs.h or equivalent.
385   Zero for functions that use stdarg.h.  */
386
387extern int current_function_varargs;
388
389/* Nonzero if current function uses stdarg.h or equivalent.
390   Zero for functions that use varargs.h.  */
391
392extern int current_function_stdarg;
393
394/* Quantities of various kinds of registers
395   used for the current function's args.  */
396
397extern CUMULATIVE_ARGS current_function_args_info;
398
399/* Name of function now being compiled.  */
400
401extern char *current_function_name;
402
403#ifdef RTX_CODE
404/* If non-zero, an RTL expression for that location at which the current
405   function returns its result.  Usually equal to
406   DECL_RTL (DECL_RESULT (current_function_decl)).  */
407
408extern rtx current_function_return_rtx;
409
410/* If some insns can be deferred to the delay slots of the epilogue, the
411   delay list for them is recorded here.  */
412
413extern rtx current_function_epilogue_delay_list;
414#endif
415
416/* Nonzero means generate position-independent code.
417   This is not fully implemented yet.  */
418
419extern int flag_pic;
420
421/* This is nonzero if the current function uses pic_offset_table_rtx.  */
422extern int current_function_uses_pic_offset_table;
423
424/* This is nonzero if the current function uses the constant pool.  */
425extern int current_function_uses_const_pool;
426
427/* The line number of the beginning of the current function.
428   sdbout.c needs this so that it can output relative linenumbers.  */
429
430#ifdef SDB_DEBUGGING_INFO /* Avoid undef sym in certain broken linkers.  */
431extern int sdb_begin_function_line;
432#endif
433
434/* File in which assembler code is being written.  */
435
436#ifdef BUFSIZ
437extern FILE *asm_out_file;
438#endif
439
440/* Decide whether DECL needs to be in a writable section.  RELOC is the same
441   as for SELECT_SECTION.  */
442
443#define DECL_READONLY_SECTION(DECL,RELOC)               \
444  (TREE_READONLY (DECL)                                 \
445   && ! TREE_THIS_VOLATILE (DECL)                       \
446   && DECL_INITIAL (DECL)                               \
447   && (DECL_INITIAL (DECL) == error_mark_node           \
448       || TREE_CONSTANT (DECL_INITIAL (DECL)))          \
449   && ! (RELOC && (flag_pic || DECL_ONE_ONLY (DECL))))
Note: See TracBrowser for help on using the repository browser.