Mercurial > hg > CbC > CbC_gcc
comparison gcc/function.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* Structure for saving state for a nested function. | 1 /* Structure for saving state for a nested function. |
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | 2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
3 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | 3 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
8 GCC is free software; you can redistribute it and/or modify it under | 8 GCC is free software; you can redistribute it and/or modify it under |
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 "vecprim.h" | 27 #include "vecprim.h" |
28 #include "tm.h" /* For CUMULATIVE_ARGS. */ | |
29 #include "hard-reg-set.h" | |
28 | 30 |
29 /* Stack of pending (incomplete) sequences saved by `start_sequence'. | 31 /* Stack of pending (incomplete) sequences saved by `start_sequence'. |
30 Each element describes one pending sequence. | 32 Each element describes one pending sequence. |
31 The main insn-chain is saved in the last element of the chain, | 33 The main insn-chain is saved in the last element of the chain, |
32 unless the chain is empty. */ | 34 unless the chain is empty. */ |
222 | 224 |
223 const char *hot_section_label; | 225 const char *hot_section_label; |
224 const char *cold_section_label; | 226 const char *cold_section_label; |
225 const char *hot_section_end_label; | 227 const char *hot_section_end_label; |
226 const char *cold_section_end_label; | 228 const char *cold_section_end_label; |
227 | |
228 /* String to be used for name of cold text sections, via | |
229 targetm.asm_out.named_section. */ | |
230 | |
231 const char *unlikely_text_section_name; | |
232 }; | 229 }; |
233 | 230 |
234 /* Describe an empty area of space in the stack frame. These can be chained | 231 /* Describe an empty area of space in the stack frame. These can be chained |
235 into a list; this is used to keep track of space wasted for alignment | 232 into a list; this is used to keep track of space wasted for alignment |
236 reasons. */ | 233 reasons. */ |
434 | 431 |
435 /* True if current function can not throw. Unlike | 432 /* True if current function can not throw. Unlike |
436 TREE_NOTHROW (current_function_decl) it is set even for overwritable | 433 TREE_NOTHROW (current_function_decl) it is set even for overwritable |
437 function where currently compiled version of it is nothrow. */ | 434 function where currently compiled version of it is nothrow. */ |
438 bool nothrow; | 435 bool nothrow; |
436 | |
437 /* Like regs_ever_live, but 1 if a reg is set or clobbered from an | |
438 asm. Unlike regs_ever_live, elements of this array corresponding | |
439 to eliminable regs (like the frame pointer) are set if an asm | |
440 sets them. */ | |
441 HARD_REG_SET asm_clobbers; | |
439 }; | 442 }; |
440 | 443 |
441 #define return_label (crtl->x_return_label) | 444 #define return_label (crtl->x_return_label) |
442 #define naked_return_label (crtl->x_naked_return_label) | 445 #define naked_return_label (crtl->x_naked_return_label) |
443 #define stack_slot_list (crtl->x_stack_slot_list) | 446 #define stack_slot_list (crtl->x_stack_slot_list) |
458 /* Accessor to RTL datastructures. We keep them statically allocated now since | 461 /* Accessor to RTL datastructures. We keep them statically allocated now since |
459 we never keep multiple functions. For threaded compiler we might however | 462 we never keep multiple functions. For threaded compiler we might however |
460 want to do differently. */ | 463 want to do differently. */ |
461 #define crtl (&x_rtl) | 464 #define crtl (&x_rtl) |
462 | 465 |
466 struct GTY(()) stack_usage | |
467 { | |
468 /* # of bytes of static stack space allocated by the function. */ | |
469 HOST_WIDE_INT static_stack_size; | |
470 | |
471 /* # of bytes of dynamic stack space allocated by the function. This is | |
472 meaningful only if has_unbounded_dynamic_stack_size is zero. */ | |
473 HOST_WIDE_INT dynamic_stack_size; | |
474 | |
475 /* # of bytes of space pushed onto the stack after the prologue. If | |
476 !ACCUMULATE_OUTGOING_ARGS, it contains the outgoing arguments. */ | |
477 int pushed_stack_size; | |
478 | |
479 /* # of dynamic allocations in the function. */ | |
480 unsigned int dynamic_alloc_count : 31; | |
481 | |
482 /* Nonzero if the amount of stack space allocated dynamically cannot | |
483 be bounded at compile-time. */ | |
484 unsigned int has_unbounded_dynamic_stack_size : 1; | |
485 }; | |
486 | |
487 #define current_function_static_stack_size (cfun->su->static_stack_size) | |
488 #define current_function_dynamic_stack_size (cfun->su->dynamic_stack_size) | |
489 #define current_function_pushed_stack_size (cfun->su->pushed_stack_size) | |
490 #define current_function_dynamic_alloc_count (cfun->su->dynamic_alloc_count) | |
491 #define current_function_has_unbounded_dynamic_stack_size \ | |
492 (cfun->su->has_unbounded_dynamic_stack_size) | |
493 #define current_function_allocates_dynamic_stack_space \ | |
494 (current_function_dynamic_stack_size != 0 \ | |
495 || current_function_has_unbounded_dynamic_stack_size) | |
496 | |
463 /* This structure can save all the important global and static variables | 497 /* This structure can save all the important global and static variables |
464 describing the status of the current function. */ | 498 describing the status of the current function. */ |
465 | 499 |
466 struct GTY(()) function { | 500 struct GTY(()) function { |
467 struct eh_status *eh; | 501 struct eh_status *eh; |
475 /* SSA and dataflow information. */ | 509 /* SSA and dataflow information. */ |
476 struct gimple_df *gimple_df; | 510 struct gimple_df *gimple_df; |
477 | 511 |
478 /* The loops in this function. */ | 512 /* The loops in this function. */ |
479 struct loops *x_current_loops; | 513 struct loops *x_current_loops; |
514 | |
515 /* The stack usage of this function. */ | |
516 struct stack_usage *su; | |
480 | 517 |
481 /* Value histograms attached to particular statements. */ | 518 /* Value histograms attached to particular statements. */ |
482 htab_t GTY((skip)) value_histograms; | 519 htab_t GTY((skip)) value_histograms; |
483 | 520 |
484 /* For function.c. */ | 521 /* For function.c. */ |
493 /* An expression that contains the non-local goto save area. The first | 530 /* An expression that contains the non-local goto save area. The first |
494 word is the saved frame pointer and the second is the saved stack | 531 word is the saved frame pointer and the second is the saved stack |
495 pointer. */ | 532 pointer. */ |
496 tree nonlocal_goto_save_area; | 533 tree nonlocal_goto_save_area; |
497 | 534 |
498 /* List of function local variables, functions, types and constants. */ | 535 /* Vector of function local variables, functions, types and constants. */ |
499 tree local_decls; | 536 VEC(tree,gc) *local_decls; |
500 | 537 |
501 /* For md files. */ | 538 /* For md files. */ |
502 | 539 |
503 /* tm.h can use this to store whatever it likes. */ | 540 /* tm.h can use this to store whatever it likes. */ |
504 struct machine_function * GTY ((maybe_undef)) machine; | 541 struct machine_function * GTY ((maybe_undef)) machine; |
570 unsigned int dont_save_pending_sizes_p : 1; | 607 unsigned int dont_save_pending_sizes_p : 1; |
571 | 608 |
572 unsigned int after_inlining : 1; | 609 unsigned int after_inlining : 1; |
573 unsigned int always_inline_functions_inlined : 1; | 610 unsigned int always_inline_functions_inlined : 1; |
574 | 611 |
612 /* Nonzero if function being compiled can throw synchronous non-call | |
613 exceptions. */ | |
614 unsigned int can_throw_non_call_exceptions : 1; | |
615 | |
575 /* Fields below this point are not set for abstract functions; see | 616 /* Fields below this point are not set for abstract functions; see |
576 allocate_struct_function. */ | 617 allocate_struct_function. */ |
577 | 618 |
578 /* Nonzero if function being compiled needs to be given an address | 619 /* Nonzero if function being compiled needs to be given an address |
579 where the value should be stored. */ | 620 where the value should be stored. */ |
594 function implemented by the output_mi_thunk hook) that just | 635 function implemented by the output_mi_thunk hook) that just |
595 adjusts one of its arguments and forwards to another | 636 adjusts one of its arguments and forwards to another |
596 function. */ | 637 function. */ |
597 unsigned int is_thunk : 1; | 638 unsigned int is_thunk : 1; |
598 }; | 639 }; |
640 | |
641 /* Add the decl D to the local_decls list of FUN. */ | |
642 | |
643 static inline void | |
644 add_local_decl (struct function *fun, tree d) | |
645 { | |
646 VEC_safe_push (tree, gc, fun->local_decls, d); | |
647 } | |
648 | |
649 #define FOR_EACH_LOCAL_DECL(FUN, I, D) \ | |
650 FOR_EACH_VEC_ELT_REVERSE (tree, (FUN)->local_decls, I, D) | |
599 | 651 |
600 /* If va_list_[gf]pr_size is set to this, it means we don't know how | 652 /* If va_list_[gf]pr_size is set to this, it means we don't know how |
601 many units need to be saved. */ | 653 many units need to be saved. */ |
602 #define VA_LIST_MAX_GPR_SIZE 255 | 654 #define VA_LIST_MAX_GPR_SIZE 255 |
603 #define VA_LIST_MAX_FPR_SIZE 255 | 655 #define VA_LIST_MAX_FPR_SIZE 255 |
631 | 683 |
632 hashval_t types_used_by_vars_do_hash (const void*); | 684 hashval_t types_used_by_vars_do_hash (const void*); |
633 int types_used_by_vars_eq (const void *, const void *); | 685 int types_used_by_vars_eq (const void *, const void *); |
634 void types_used_by_var_decl_insert (tree type, tree var_decl); | 686 void types_used_by_var_decl_insert (tree type, tree var_decl); |
635 | 687 |
636 /* During parsing of a global variable, this linked list points to | 688 /* During parsing of a global variable, this vector contains the types |
637 the list of types referenced by the global variable. */ | 689 referenced by the global variable. */ |
638 extern GTY(()) tree types_used_by_cur_var_decl; | 690 extern GTY(()) VEC(tree,gc) *types_used_by_cur_var_decl; |
639 | 691 |
640 | 692 |
641 /* cfun shouldn't be set directly; use one of these functions instead. */ | 693 /* cfun shouldn't be set directly; use one of these functions instead. */ |
642 extern void set_cfun (struct function *new_cfun); | 694 extern void set_cfun (struct function *new_cfun); |
643 extern void push_cfun (struct function *new_cfun); | 695 extern void push_cfun (struct function *new_cfun); |
700 tree, bool); | 752 tree, bool); |
701 | 753 |
702 extern void used_types_insert (tree); | 754 extern void used_types_insert (tree); |
703 | 755 |
704 extern int get_next_funcdef_no (void); | 756 extern int get_next_funcdef_no (void); |
757 | |
758 /* In predict.c */ | |
759 extern bool optimize_function_for_size_p (struct function *); | |
760 extern bool optimize_function_for_speed_p (struct function *); | |
761 | |
705 #endif /* GCC_FUNCTION_H */ | 762 #endif /* GCC_FUNCTION_H */ |