comparison gcc/function.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents 855418dad1a3
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
22 #ifndef GCC_FUNCTION_H 22 #ifndef GCC_FUNCTION_H
23 #define GCC_FUNCTION_H 23 #define GCC_FUNCTION_H
24 24
25 #include "tree.h" 25 #include "tree.h"
26 #include "hashtab.h" 26 #include "hashtab.h"
27 #include "varray.h" 27 #include "vecprim.h"
28 28
29 /* Stack of pending (incomplete) sequences saved by `start_sequence'. 29 /* Stack of pending (incomplete) sequences saved by `start_sequence'.
30 Each element describes one pending sequence. 30 Each element describes one pending sequence.
31 The main insn-chain is saved in the last element of the chain, 31 The main insn-chain is saved in the last element of the chain,
32 unless the chain is empty. */ 32 unless the chain is empty. */
33 33
34 struct sequence_stack GTY(()) 34 struct GTY(()) sequence_stack {
35 {
36 /* First and last insns in the chain of the saved sequence. */ 35 /* First and last insns in the chain of the saved sequence. */
37 rtx first; 36 rtx first;
38 rtx last; 37 rtx last;
39 struct sequence_stack *next; 38 struct sequence_stack *next;
40 }; 39 };
41 40
42 struct emit_status GTY(()) 41 struct GTY(()) emit_status {
43 {
44 /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function. 42 /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
45 After rtl generation, it is 1 plus the largest register number used. */ 43 After rtl generation, it is 1 plus the largest register number used. */
46 int x_reg_rtx_no; 44 int x_reg_rtx_no;
47 45
48 /* Lowest label number in current function. */ 46 /* Lowest label number in current function. */
64 62
65 /* INSN_UID for next insn emitted. 63 /* INSN_UID for next insn emitted.
66 Reset to 1 for each function compiled. */ 64 Reset to 1 for each function compiled. */
67 int x_cur_insn_uid; 65 int x_cur_insn_uid;
68 66
67 /* INSN_UID for next debug insn emitted. Only used if
68 --param min-nondebug-insn-uid=<value> is given with nonzero value. */
69 int x_cur_debug_insn_uid;
70
69 /* Location the last line-number NOTE emitted. 71 /* Location the last line-number NOTE emitted.
70 This is used to avoid generating duplicates. */ 72 This is used to avoid generating duplicates. */
71 location_t x_last_location; 73 location_t x_last_location;
72 74
73 /* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx 75 /* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
82 unsigned char * GTY((skip)) regno_pointer_align; 84 unsigned char * GTY((skip)) regno_pointer_align;
83 }; 85 };
84 86
85 87
86 /* Indexed by pseudo register number, gives the rtx for that pseudo. 88 /* Indexed by pseudo register number, gives the rtx for that pseudo.
87 Allocated in parallel with regno_pointer_align. 89 Allocated in parallel with regno_pointer_align.
88 FIXME: We could put it into emit_status struct, but gengtype is not able to deal 90 FIXME: We could put it into emit_status struct, but gengtype is not able to deal
89 with length attribute nested in top level structures. */ 91 with length attribute nested in top level structures. */
90 92
91 extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx; 93 extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx;
92 94
94 #define reg_rtx_no (crtl->emit.x_reg_rtx_no) 96 #define reg_rtx_no (crtl->emit.x_reg_rtx_no)
95 #define seq_stack (crtl->emit.sequence_stack) 97 #define seq_stack (crtl->emit.sequence_stack)
96 98
97 #define REGNO_POINTER_ALIGN(REGNO) (crtl->emit.regno_pointer_align[REGNO]) 99 #define REGNO_POINTER_ALIGN(REGNO) (crtl->emit.regno_pointer_align[REGNO])
98 100
99 struct expr_status GTY(()) 101 struct GTY(()) expr_status {
100 {
101 /* Number of units that we should eventually pop off the stack. 102 /* Number of units that we should eventually pop off the stack.
102 These are the arguments to function calls that have already returned. */ 103 These are the arguments to function calls that have already returned. */
103 int x_pending_stack_adjust; 104 int x_pending_stack_adjust;
104 105
105 /* Under some ABIs, it is the caller's responsibility to pop arguments 106 /* Under some ABIs, it is the caller's responsibility to pop arguments
135 136
136 /* List of labels that must never be deleted. */ 137 /* List of labels that must never be deleted. */
137 rtx x_forced_labels; 138 rtx x_forced_labels;
138 }; 139 };
139 140
140 typedef struct call_site_record *call_site_record; 141 typedef struct call_site_record_d *call_site_record;
141 DEF_VEC_P(call_site_record); 142 DEF_VEC_P(call_site_record);
142 DEF_VEC_ALLOC_P(call_site_record, gc); 143 DEF_VEC_ALLOC_P(call_site_record, gc);
143 144
144 /* RTL representation of exception handling. */ 145 /* RTL representation of exception handling. */
145 struct rtl_eh GTY(()) 146 struct GTY(()) rtl_eh {
146 {
147 rtx filter;
148 rtx exc_ptr;
149
150 int built_landing_pads;
151
152 rtx ehr_stackadj; 147 rtx ehr_stackadj;
153 rtx ehr_handler; 148 rtx ehr_handler;
154 rtx ehr_label; 149 rtx ehr_label;
155 150
156 rtx sjlj_fc; 151 rtx sjlj_fc;
157 rtx sjlj_exit_after; 152 rtx sjlj_exit_after;
158 153
159 htab_t GTY ((param_is (struct ehl_map_entry))) exception_handler_label_map; 154 VEC(uchar,gc) *action_record_data;
160 155
161 VEC(tree,gc) *ttype_data; 156 VEC(call_site_record,gc) *call_site_record[2];
162 varray_type ehspec_data;
163 varray_type action_record_data;
164
165 VEC(call_site_record,gc) *call_site_record;
166 }; 157 };
167 158
168 #define pending_stack_adjust (crtl->expr.x_pending_stack_adjust) 159 #define pending_stack_adjust (crtl->expr.x_pending_stack_adjust)
169 #define inhibit_defer_pop (crtl->expr.x_inhibit_defer_pop) 160 #define inhibit_defer_pop (crtl->expr.x_inhibit_defer_pop)
170 #define saveregs_value (crtl->expr.x_saveregs_value) 161 #define saveregs_value (crtl->expr.x_saveregs_value)
173 #define stack_pointer_delta (crtl->expr.x_stack_pointer_delta) 164 #define stack_pointer_delta (crtl->expr.x_stack_pointer_delta)
174 165
175 struct gimple_df; 166 struct gimple_df;
176 struct temp_slot; 167 struct temp_slot;
177 typedef struct temp_slot *temp_slot_p; 168 typedef struct temp_slot *temp_slot_p;
178 struct call_site_record; 169 struct call_site_record_d;
179 170
180 DEF_VEC_P(temp_slot_p); 171 DEF_VEC_P(temp_slot_p);
181 DEF_VEC_ALLOC_P(temp_slot_p,gc); 172 DEF_VEC_ALLOC_P(temp_slot_p,gc);
182 struct ipa_opt_pass; 173 struct ipa_opt_pass_d;
183 typedef struct ipa_opt_pass *ipa_opt_pass; 174 typedef struct ipa_opt_pass_d *ipa_opt_pass;
184 175
185 DEF_VEC_P(ipa_opt_pass); 176 DEF_VEC_P(ipa_opt_pass);
186 DEF_VEC_ALLOC_P(ipa_opt_pass,heap); 177 DEF_VEC_ALLOC_P(ipa_opt_pass,heap);
187 178
188 enum function_frequency { 179 enum function_frequency {
194 /* Optimize this function hard 185 /* Optimize this function hard
195 (set only when profile feedback is available or via function attribute). */ 186 (set only when profile feedback is available or via function attribute). */
196 FUNCTION_FREQUENCY_HOT 187 FUNCTION_FREQUENCY_HOT
197 }; 188 };
198 189
199 struct varasm_status GTY(()) 190 struct GTY(()) varasm_status {
200 {
201 /* If we're using a per-function constant pool, this is it. */ 191 /* If we're using a per-function constant pool, this is it. */
202 struct rtx_constant_pool *pool; 192 struct rtx_constant_pool *pool;
203 193
204 /* Number of tree-constants deferred during the expansion of this 194 /* Number of tree-constants deferred during the expansion of this
205 function. */ 195 function. */
206 unsigned int deferred_constants; 196 unsigned int deferred_constants;
207 }; 197 };
208 198
209 /* Information mainlined about RTL representation of incoming arguments. */ 199 /* Information mainlined about RTL representation of incoming arguments. */
210 struct incoming_args GTY(()) 200 struct GTY(()) incoming_args {
211 {
212 /* Number of bytes of args popped by function being compiled on its return. 201 /* Number of bytes of args popped by function being compiled on its return.
213 Zero if no bytes are to be popped. 202 Zero if no bytes are to be popped.
214 May affect compilation of return insn or of function epilogue. */ 203 May affect compilation of return insn or of function epilogue. */
215 int pops_args; 204 int pops_args;
216 205
235 /* The arg pointer hard register, or the pseudo into which it was copied. */ 224 /* The arg pointer hard register, or the pseudo into which it was copied. */
236 rtx internal_arg_pointer; 225 rtx internal_arg_pointer;
237 }; 226 };
238 227
239 /* Data for function partitioning. */ 228 /* Data for function partitioning. */
240 struct function_subsections GTY(()) 229 struct GTY(()) function_subsections {
241 {
242 /* Assembly labels for the hot and cold text sections, to 230 /* Assembly labels for the hot and cold text sections, to
243 be used by debugger functions for determining the size of text 231 be used by debugger functions for determining the size of text
244 sections. */ 232 sections. */
245 233
246 const char *hot_section_label; 234 const char *hot_section_label;
253 241
254 const char *unlikely_text_section_name; 242 const char *unlikely_text_section_name;
255 }; 243 };
256 244
257 /* Datastructures maintained for currently processed function in RTL form. */ 245 /* Datastructures maintained for currently processed function in RTL form. */
258 struct rtl_data GTY(()) 246 struct GTY(()) rtl_data {
259 {
260 struct expr_status expr; 247 struct expr_status expr;
261 struct emit_status emit; 248 struct emit_status emit;
262 struct varasm_status varasm; 249 struct varasm_status varasm;
263 struct incoming_args args; 250 struct incoming_args args;
264 struct function_subsections subsections; 251 struct function_subsections subsections;
346 unsigned int max_used_stack_slot_alignment; 333 unsigned int max_used_stack_slot_alignment;
347 334
348 /* The stack alignment estimated before reload, with consideration of 335 /* The stack alignment estimated before reload, with consideration of
349 following factors: 336 following factors:
350 1. Alignment of local stack variables (max_used_stack_slot_alignment) 337 1. Alignment of local stack variables (max_used_stack_slot_alignment)
351 2. Alignment requirement to call other functions 338 2. Alignment requirement to call other functions
352 (preferred_stack_boundary) 339 (preferred_stack_boundary)
353 3. Alignment of non-local stack variables but might be spilled in 340 3. Alignment of non-local stack variables but might be spilled in
354 local stack. */ 341 local stack. */
355 unsigned int stack_alignment_estimated; 342 unsigned int stack_alignment_estimated;
356 343
372 bool saves_all_registers; 359 bool saves_all_registers;
373 360
374 /* Nonzero if function being compiled has nonlocal gotos to parent 361 /* Nonzero if function being compiled has nonlocal gotos to parent
375 function. */ 362 function. */
376 bool has_nonlocal_goto; 363 bool has_nonlocal_goto;
377 364
378 /* Nonzero if function being compiled has an asm statement. */ 365 /* Nonzero if function being compiled has an asm statement. */
379 bool has_asm_statement; 366 bool has_asm_statement;
380 367
381 /* This bit is used by the exception handling logic. It is set if all 368 /* This bit is used by the exception handling logic. It is set if all
382 calls (if any) are sibling calls. Such functions do not have to 369 calls (if any) are sibling calls. Such functions do not have to
439 stack_realign_needed flag has been set and finalized after reload. */ 426 stack_realign_needed flag has been set and finalized after reload. */
440 bool stack_realign_finalized; 427 bool stack_realign_finalized;
441 428
442 /* True if dbr_schedule has already been called for this function. */ 429 /* True if dbr_schedule has already been called for this function. */
443 bool dbr_scheduled_p; 430 bool dbr_scheduled_p;
431
432 /* True if current function can not throw. Unlike
433 TREE_NOTHROW (current_function_decl) it is set even for overwritable
434 function where currently compiled version of it is nothrow. */
435 bool nothrow;
444 }; 436 };
445 437
446 #define return_label (crtl->x_return_label) 438 #define return_label (crtl->x_return_label)
447 #define naked_return_label (crtl->x_naked_return_label) 439 #define naked_return_label (crtl->x_naked_return_label)
448 #define stack_slot_list (crtl->x_stack_slot_list) 440 #define stack_slot_list (crtl->x_stack_slot_list)
466 #define crtl (&x_rtl) 458 #define crtl (&x_rtl)
467 459
468 /* This structure can save all the important global and static variables 460 /* This structure can save all the important global and static variables
469 describing the status of the current function. */ 461 describing the status of the current function. */
470 462
471 struct function GTY(()) 463 struct GTY(()) function {
472 {
473 struct eh_status *eh; 464 struct eh_status *eh;
474 465
475 /* The control flow graph for this function. */ 466 /* The control flow graph for this function. */
476 struct control_flow_graph *cfg; 467 struct control_flow_graph *cfg;
477 468
495 /* A PARM_DECL that should contain the static chain for this function. 486 /* A PARM_DECL that should contain the static chain for this function.
496 It will be initialized at the beginning of the function. */ 487 It will be initialized at the beginning of the function. */
497 tree static_chain_decl; 488 tree static_chain_decl;
498 489
499 /* An expression that contains the non-local goto save area. The first 490 /* An expression that contains the non-local goto save area. The first
500 word is the saved frame pointer and the second is the saved stack 491 word is the saved frame pointer and the second is the saved stack
501 pointer. */ 492 pointer. */
502 tree nonlocal_goto_save_area; 493 tree nonlocal_goto_save_area;
503 494
504 /* List of function local variables, functions, types and constants. */ 495 /* List of function local variables, functions, types and constants. */
505 tree local_decls; 496 tree local_decls;
528 location_t function_end_locus; 519 location_t function_end_locus;
529 520
530 /* Properties used by the pass manager. */ 521 /* Properties used by the pass manager. */
531 unsigned int curr_properties; 522 unsigned int curr_properties;
532 unsigned int last_verified; 523 unsigned int last_verified;
533 /* Interprocedural passes scheduled to have their transform functions 524
534 applied next time we execute local pass on them. We maintain it 525 /* Non-null if the function does something that would prevent it from
535 per-function in order to allow IPA passes to introduce new functions. */ 526 being copied; this applies to both versioning and inlining. Set to
536 VEC(ipa_opt_pass,heap) * GTY((skip)) ipa_transforms_to_apply; 527 a string describing the reason for failure. */
528 const char * GTY((skip)) cannot_be_copied_reason;
537 529
538 /* Collected bit flags. */ 530 /* Collected bit flags. */
539 531
540 /* Number of units of general registers that need saving in stdarg 532 /* Number of units of general registers that need saving in stdarg
541 function. What unit is depends on the backend, either it is number 533 function. What unit is depends on the backend, either it is number
544 536
545 /* Number of units of floating point registers that need saving in stdarg 537 /* Number of units of floating point registers that need saving in stdarg
546 function. */ 538 function. */
547 unsigned int va_list_fpr_size : 8; 539 unsigned int va_list_fpr_size : 8;
548 540
549
550 /* How commonly executed the function is. Initialized during branch 541 /* How commonly executed the function is. Initialized during branch
551 probabilities pass. */ 542 probabilities pass. */
552 ENUM_BITFIELD (function_frequency) function_frequency : 2; 543 ENUM_BITFIELD (function_frequency) function_frequency : 2;
553 544
554 /* Nonzero if function being compiled can call setjmp. */ 545 /* Nonzero if function being compiled can call setjmp. */
559 unsigned int calls_alloca : 1; 550 unsigned int calls_alloca : 1;
560 551
561 /* Nonzero if function being compiled receives nonlocal gotos 552 /* Nonzero if function being compiled receives nonlocal gotos
562 from nested functions. */ 553 from nested functions. */
563 unsigned int has_nonlocal_label : 1; 554 unsigned int has_nonlocal_label : 1;
555
556 /* Nonzero if we've set cannot_be_copied_reason. I.e. if
557 (cannot_be_copied_set && !cannot_be_copied_reason), the function
558 can in fact be copied. */
559 unsigned int cannot_be_copied_set : 1;
564 560
565 /* Nonzero if current function uses stdarg.h or equivalent. */ 561 /* Nonzero if current function uses stdarg.h or equivalent. */
566 unsigned int stdarg : 1; 562 unsigned int stdarg : 1;
567 563
568 /* Nonzero if the back-end should not keep track of expressions that 564 /* Nonzero if the back-end should not keep track of expressions that
619 extern int virtuals_instantiated; 615 extern int virtuals_instantiated;
620 616
621 /* Nonzero if at least one trampoline has been created. */ 617 /* Nonzero if at least one trampoline has been created. */
622 extern int trampolines_created; 618 extern int trampolines_created;
623 619
624 struct types_used_by_vars_entry GTY(()) { 620 struct GTY(()) types_used_by_vars_entry {
625 tree type; 621 tree type;
626 tree var_decl; 622 tree var_decl;
627 }; 623 };
628 624
629 /* Hash table making the relationship between a global variable 625 /* Hash table making the relationship between a global variable
694 690
695 extern rtx get_arg_pointer_save_area (void); 691 extern rtx get_arg_pointer_save_area (void);
696 692
697 /* Returns the name of the current function. */ 693 /* Returns the name of the current function. */
698 extern const char *current_function_name (void); 694 extern const char *current_function_name (void);
699 /* Returns the assembler name (raw, mangled) of the current function. */
700 extern const char *current_function_assembler_name (void);
701 695
702 extern void do_warn_unused_parameter (tree); 696 extern void do_warn_unused_parameter (tree);
703 697
704 extern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, 698 extern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
705 tree, bool); 699 tree, bool);