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