diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2014-10-16 16:37:19 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2014-10-16 16:37:19 +0000 |
commit | 83685514938c33cb0be83aa47cb15ecd6058272e (patch) | |
tree | 16f08b07a88339a4442c9c25ec594a8f928181c3 /gcc/function.h | |
parent | 0c4ec427e072c10777f4b26a6d05e0916df69fac (diff) | |
download | gcc-83685514938c33cb0be83aa47cb15ecd6058272e.zip gcc-83685514938c33cb0be83aa47cb15ecd6058272e.tar.gz gcc-83685514938c33cb0be83aa47cb15ecd6058272e.tar.bz2 |
function.h: Flatten file.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* function.h: Flatten file. Remove includes, adjust prototypes to
reflect only what is in function.h.
(enum direction, struct args_size, struct locate_and_pad_arg_data,
ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Relocate
from expr.h.
(ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD): Relocate from rtl.h.
(optimize_function_for_size_p, optimize_function_for_speed_p): Move
prototypes to predict.h.
(init_varasm_status): Move prototype to varasm.h.
* expr.h: Adjust include files.
(enum direction, struct args_size, struct locate_and_pad_arg_data,
ADD_PARM_SIZE, SUB_PARM_SIZE, ARGS_SIZE_TREE, ARGS_SIZE_RTX): Move
to function.h.
(locate_and_pad_parm): Move prototype to function.h.
* rtl.h: (assign_stack_local, ASLK_REDUCE_ALIGN, ASLK_RECORD_PAD,
assign_stack_local_1, assign_stack_temp, assign_stack_temp_for_type,
assign_temp, reposition_prologue_and_epilogue_notes,
prologue_epilogue_contains, sibcall_epilogue_contains,
update_temp_slot_address, maybe_copy_prologue_epilogue_insn,
set_return_jump_label): Move prototypes to function.h.
* predict.h (optimize_function_for_size_p,
optimize_function_for_speed_p): Relocate prototypes from function.h.
* shrink-wrap.h (emit_return_into_block, active_insn_between,
convert_jumps_to_returns, emit_return_for_exit): Move prototypes to
function.h.
* varasm.h (init_varasm_status): Relocate prototype from function.h.
* genattrtab.c (write_header): Add predict.h to include list.
* genconditions.c (write_header): Add predict.h to include list.
* genemit.c (main): Adjust header file includes.
* gengtype.c (ifiles): Add flattened function.h header files.
* genoutput.c (output_prologue): Add predict.h to include list.
* genpreds.c (write_insn_preds_c): Adjust header file includes.
* genrecog.c (write_header): Add flattened function.h header files.
* alias.c: Adjust include files.
* auto-inc-dec.c: Likewise.
* basic-block.h: Likewise.
* bb-reorder.c: Likewise.
* bt-load.c: Likewise.
* builtins.c: Likewise.
* caller-save.c: Likewise.
* calls.c: Likewise.
* cfgbuild.c: Likewise.
* cfgcleanup.c: Likewise.
* cfgexpand.c: Likewise.
* cfgloop.c: Likewise.
* cfgloop.h: Likewise.
* cfgrtl.c: Likewise.
* cgraph.h: Likewise.
* cgraphclones.c: Likewise.
* cgraphunit.c: Likewise.
* combine-stack-adj.c: Likewise.
* combine.c: Likewise.
* coverage.c: Likewise.
* cprop.c: Likewise.
* cse.c: Likewise.
* cselib.c: Likewise.
* dbxout.c: Likewise.
* ddg.c: Likewise.
* df-core.c: Likewise.
* df-problems.c: Likewise.
* df-scan.c: Likewise.
* dojump.c: Likewise.
* dwarf2cfi.c: Likewise.
* dwarf2out.c: Likewise.
* emit-rtl.c: Likewise.
* except.c: Likewise.
* explow.c: Likewise.
* expr.c: Likewise.
* final.c: Likewise.
* function.c: Likewise.
* gcse.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-low.c: Likewise.
* gimple-streamer.h: Likewise.
* haifa-sched.c: Likewise.
* ifcvt.c: Likewise.
* ira.c: Likewise.
* jump.c: Likewise.
* lcm.c: Likewise.
* loop-invariant.c: Likewise.
* lra-assigns.c: Likewise.
* lra-coalesce.c: Likewise.
* lra-constraints.c: Likewise.
* lra-eliminations.c: Likewise.
* lra-lives.c: Likewise.
* lra-spills.c: Likewise.
* lra.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-section-in.c: Likewise.
* lto-section-out.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* mode-switching.c: Likewise.
* modulo-sched.c: Likewise.
* omp-low.c: Likewise.
* optabs.c: Likewise.
* passes.c: Likewise.
* postreload-gcse.c: Likewise.
* postreload.c: Likewise.
* predict.c: Likewise.
* profile.c: Likewise.
* recog.c: Likewise.
* ree.c: Likewise.
* reg-stack.c: Likewise.
* regcprop.c: Likewise.
* reginfo.c: Likewise.
* regrename.c: Likewise.
* reload.c: Likewise.
* reload1.c: Likewise.
* reorg.c: Likewise.
* resource.c: Likewise.
* rtlanal.c: Likewise.
* sched-deps.c: Likewise.
* sched-ebb.c: Likewise.
* sched-rgn.c: Likewise.
* sel-sched-dump.c: Likewise.
* sel-sched-ir.c: Likewise.
* sel-sched.c: Likewise.
* shrink-wrap.c: Likewise.
* simplify-rtx.c: Likewise.
* statistics.c: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* store-motion.c: Likewise.
* symtab.c: Likewise.
* targhooks.c: Likewise.
* toplev.c: Likewise.
* trans-mem.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-dfa.c: Likewise.
* tree-eh.c: Likewise.
* tree-inline.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-nested.c: Likewise.
* tree-nrv.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-alias.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-copy.c: Likewise.
* tree-ssa-copyrename.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-operands.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa-uncprop.c: Likewise.
* tree-ssa-uninit.c: Likewise.
* tree-ssa.c: Likewise.
* tree-stdarg.c: Likewise.
* tree-tailcall.c: Likewise.
* tree.c: Likewise.
* tsan.c: Likewise.
* valtrack.c: Likewise.
* varasm.c: Likewise.
* vmsdbgout.c: Likewise.
* web.c: Likewise.
* testsuite/g++.dg/plugin/pragma_plugin.c: Adjust include files.
* config/aarch64/aarch64.c: Add flattened includes from function.h.
* config/alpha/alpha.c: Likewise.
* config/arc/arc.c: Likewise.
* config/arm/arm.c: Likewise.
* config/avr/avr-log.c: Likewise.
* config/avr/avr.c: Likewise.
* config/bfin/bfin.c: Likewise.
* config/c6x/c6x.c: Likewise.
* config/cr16/cr16.c: Likewise.
* config/cris/cris.c: Likewise.
* config/darwin.c: Likewise.
* config/epiphany/epiphany.c: Likewise.
* config/epiphany/mode-switch-use.c: Likewise.
* config/epiphany/resolve-sw-modes.c: Likewise.
* config/fr30/fr30.c: Likewise.
* config/frv/frv.c: Likewise.
* config/h8300/h8300.c: Likewise.
* config/i386/i386.c: Likewise.
* config/ia64/ia64.c: Likewise.
* config/iq2000/iq2000.c: Likewise.
* config/lm32/lm32.c: Likewise.
* config/m32c/m32c.c: Likewise.
* config/m32r/m32r.c: Likewise.
* config/m68k/m68k.c: Likewise.
* config/mcore/mcore.c: Likewise.
* config/mep/mep-pragma.c: Likewise.
* config/mep/mep.c: Likewise.
* config/microblaze/microblaze.c: Likewise.
* config/mips/mips.c: Likewise.
* config/mmix/mmix.c: Likewise.
* config/mn10300/mn10300.c: Likewise.
* config/moxie/moxie.c: Likewise.
* config/msp430/msp430.c: Likewise.
* config/nds32/nds32-cost.c: Likewise.
* config/nds32/nds32-fp-as-gp.c: Likewise.
* config/nds32/nds32-intrinsic.c: Likewise.
* config/nds32/nds32-isr.c: Likewise.
* config/nds32/nds32-md-auxiliary.c: Likewise.
* config/nds32/nds32-memory-manipulation.c: Likewise.
* config/nds32/nds32-pipelines-auxiliary.c: Likewise.
* config/nds32/nds32-predicates.c: Likewise.
* config/nds32/nds32.c: Likewise.
* config/nios2/nios2.c: Likewise.
* config/pa/pa.c: Likewise.
* config/pdp11/pdp11.c: Likewise.
* config/rl78/rl78.c: Likewise.
* config/rs6000/rs6000.c: Likewise.
* config/rx/rx.c: Likewise.
* config/s390/s390.c: Likewise.
* config/score/score.c: Likewise.
* config/sh/sh.c: Likewise.
* config/sparc/sparc.c: Likewise.
* config/spu/spu.c: Likewise.
* config/stormy16/stormy16.c: Likewise.
* config/tilegx/tilegx.c: Likewise.
* config/tilepro/tilepro.c: Likewise.
* config/v850/v850.c: Likewise.
* config/vax/vax.c: Likewise.
* config/xtensa/xtensa.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* ada/gcc-interface/misc.c: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c/c-decl.c: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c-family/c-pragma.c: Adjust include files.
* c-family/c-semantics.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* cp/cp-tree.h: Adjust include files.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* fortran/f95-lang.c: Adjust include files.
* fortran/trans-decl.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* java/class.c: Adjust include files.
* java/resource.c: Likewise.
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* objc/objc-act.c: Adjust include files.
From-SVN: r216337
Diffstat (limited to 'gcc/function.h')
-rw-r--r-- | gcc/function.h | 223 |
1 files changed, 153 insertions, 70 deletions
diff --git a/gcc/function.h b/gcc/function.h index a8d9f6a..66384e5 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -20,13 +20,6 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_FUNCTION_H #define GCC_FUNCTION_H -#include "hashtab.h" -#include "hash-set.h" -#include "vec.h" -#include "machmode.h" -#include "tm.h" /* For CUMULATIVE_ARGS. */ -#include "hard-reg-set.h" /* For HARD_REG_SET in struct rtl_data. */ -#include "input.h" /* For location_t. */ /* Stack of pending (incomplete) sequences saved by `start_sequence'. Each element describes one pending sequence. @@ -727,11 +720,6 @@ void types_used_by_var_decl_insert (tree type, tree var_decl); referenced by the global variable. */ extern GTY(()) vec<tree, va_gc> *types_used_by_cur_var_decl; -/* cfun shouldn't be set directly; use one of these functions instead. */ -extern void set_cfun (struct function *new_cfun); -extern void push_cfun (struct function *new_cfun); -extern void pop_cfun (void); -extern void instantiate_decl_rtl (rtx x); /* Return the loop tree of FN. */ @@ -758,16 +746,95 @@ set_loops_for_fn (struct function *fn, struct loops *loops) #define n_bbs_in_dom_tree (cfun->cfg->x_n_bbs_in_dom_tree) #define VALUE_HISTOGRAMS(fun) (fun)->value_histograms -/* Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END}, - and create duplicate blocks. */ -extern void reorder_blocks (void); +/* A pointer to a function to create target specific, per-function + data structures. */ +extern struct machine_function * (*init_machine_status) (void); -/* Set BLOCK_NUMBER for all the blocks in FN. */ -extern void number_blocks (tree); +enum direction {none, upward, downward}; -extern void clear_block_marks (tree); -extern tree blocks_nreverse (tree); -extern tree block_chainon (tree, tree); +/* Structure to record the size of a sequence of arguments + as the sum of a tree-expression and a constant. This structure is + also used to store offsets from the stack, which might be negative, + so the variable part must be ssizetype, not sizetype. */ + +struct args_size +{ + HOST_WIDE_INT constant; + tree var; +}; + +/* Package up various arg related fields of struct args for + locate_and_pad_parm. */ +struct locate_and_pad_arg_data +{ + /* Size of this argument on the stack, rounded up for any padding it + gets. If REG_PARM_STACK_SPACE is defined, then register parms are + counted here, otherwise they aren't. */ + struct args_size size; + /* Offset of this argument from beginning of stack-args. */ + struct args_size offset; + /* Offset to the start of the stack slot. Different from OFFSET + if this arg pads downward. */ + struct args_size slot_offset; + /* The amount that the stack pointer needs to be adjusted to + force alignment for the next argument. */ + struct args_size alignment_pad; + /* Which way we should pad this arg. */ + enum direction where_pad; + /* slot_offset is at least this aligned. */ + unsigned int boundary; +}; + +/* Add the value of the tree INC to the `struct args_size' TO. */ + +#define ADD_PARM_SIZE(TO, INC) \ +do { \ + tree inc = (INC); \ + if (tree_fits_shwi_p (inc)) \ + (TO).constant += tree_to_shwi (inc); \ + else if ((TO).var == 0) \ + (TO).var = fold_convert (ssizetype, inc); \ + else \ + (TO).var = size_binop (PLUS_EXPR, (TO).var, \ + fold_convert (ssizetype, inc)); \ +} while (0) + +#define SUB_PARM_SIZE(TO, DEC) \ +do { \ + tree dec = (DEC); \ + if (tree_fits_shwi_p (dec)) \ + (TO).constant -= tree_to_shwi (dec); \ + else if ((TO).var == 0) \ + (TO).var = size_binop (MINUS_EXPR, ssize_int (0), \ + fold_convert (ssizetype, dec)); \ + else \ + (TO).var = size_binop (MINUS_EXPR, (TO).var, \ + fold_convert (ssizetype, dec)); \ +} while (0) + +/* Convert the implicit sum in a `struct args_size' into a tree + of type ssizetype. */ +#define ARGS_SIZE_TREE(SIZE) \ +((SIZE).var == 0 ? ssize_int ((SIZE).constant) \ + : size_binop (PLUS_EXPR, fold_convert (ssizetype, (SIZE).var), \ + ssize_int ((SIZE).constant))) + +/* Convert the implicit sum in a `struct args_size' into an rtx. */ +#define ARGS_SIZE_RTX(SIZE) \ +((SIZE).var == 0 ? GEN_INT ((SIZE).constant) \ + : expand_normal (ARGS_SIZE_TREE (SIZE))) + +#define ASLK_REDUCE_ALIGN 1 +#define ASLK_RECORD_PAD 2 + + + +extern void push_function_context (void); +extern void pop_function_context (void); + +/* Save and restore status information for a nested function. */ +extern void free_after_parsing (struct function *); +extern void free_after_compilation (struct function *); /* Return size needed for stack frame based on slots so far allocated. This size counts from zero. It is not rounded to STACK_BOUNDARY; @@ -779,71 +846,87 @@ extern HOST_WIDE_INT get_frame_size (void); return FALSE. */ extern bool frame_offset_overflow (HOST_WIDE_INT, tree); -/* A pointer to a function to create target specific, per-function - data structures. */ -extern struct machine_function * (*init_machine_status) (void); +extern rtx assign_stack_local_1 (enum machine_mode, HOST_WIDE_INT, int, int); +extern rtx assign_stack_local (enum machine_mode, HOST_WIDE_INT, int); +extern rtx assign_stack_temp_for_type (enum machine_mode, HOST_WIDE_INT, tree); +extern rtx assign_stack_temp (enum machine_mode, HOST_WIDE_INT); +extern rtx assign_temp (tree, int, int); +extern void update_temp_slot_address (rtx, rtx); +extern void preserve_temp_slots (rtx); +extern void free_temp_slots (void); +extern void push_temp_slots (void); +extern void pop_temp_slots (void); +extern void init_temp_slots (void); +extern rtx get_hard_reg_initial_reg (rtx); +extern rtx get_hard_reg_initial_val (enum machine_mode, unsigned int); +extern rtx has_hard_reg_initial_val (enum machine_mode, unsigned int); -/* Save and restore status information for a nested function. */ -extern void free_after_parsing (struct function *); -extern void free_after_compilation (struct function *); +/* Called from gimple_expand_cfg. */ +extern unsigned int emit_initial_value_sets (void); + +extern bool initial_value_entry (int i, rtx *, rtx *); +extern void instantiate_decl_rtl (rtx x); +extern int aggregate_value_p (const_tree, const_tree); +extern bool use_register_for_decl (const_tree); +extern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); +extern bool reference_callee_copied (CUMULATIVE_ARGS *, enum machine_mode, + tree, bool); +extern gimple_seq gimplify_parameters (void); +extern void locate_and_pad_parm (enum machine_mode, tree, int, int, int, + tree, struct args_size *, + struct locate_and_pad_arg_data *); +extern void generate_setjmp_warnings (void); + +/* Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END}, + and create duplicate blocks. */ +extern void reorder_blocks (void); +extern void clear_block_marks (tree); +extern tree blocks_nreverse (tree); +extern tree block_chainon (tree, tree); -extern void init_varasm_status (void); +/* Set BLOCK_NUMBER for all the blocks in FN. */ +extern void number_blocks (tree); + +/* cfun shouldn't be set directly; use one of these functions instead. */ +extern void set_cfun (struct function *new_cfun); +extern void push_cfun (struct function *new_cfun); +extern void pop_cfun (void); + +extern int get_next_funcdef_no (void); +extern int get_last_funcdef_no (void); +extern void allocate_struct_function (tree, bool); +extern void push_struct_function (tree fndecl); +extern void init_dummy_function_start (void); +extern void init_function_start (tree); +extern void stack_protect_epilogue (void); +extern void expand_function_start (tree); +extern void expand_dummy_function_end (void); #ifdef RTX_CODE extern void diddle_return_value (void (*)(rtx, void*), void*); extern void clobber_return_register (void); #endif +extern void do_warn_unused_parameter (tree); +extern void expand_function_end (void); extern rtx get_arg_pointer_save_area (void); +extern void maybe_copy_prologue_epilogue_insn (rtx, rtx); +extern int prologue_epilogue_contains (const_rtx); +extern void emit_return_into_block (bool simple_p, basic_block bb); +extern void set_return_jump_label (rtx); +extern bool active_insn_between (rtx_insn *head, rtx_insn *tail); +extern vec<edge> convert_jumps_to_returns (basic_block last_bb, bool simple_p, + vec<edge> unconverted); +extern basic_block emit_return_for_exit (edge exit_fallthru_edge, + bool simple_p); +extern void reposition_prologue_and_epilogue_notes (void); /* Returns the name of the current function. */ extern const char *fndecl_name (tree); extern const char *function_name (struct function *); extern const char *current_function_name (void); -extern void do_warn_unused_parameter (tree); - -extern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, - tree, bool); -extern bool reference_callee_copied (CUMULATIVE_ARGS *, enum machine_mode, - tree, bool); - extern void used_types_insert (tree); -extern int get_next_funcdef_no (void); -extern int get_last_funcdef_no (void); - -extern rtx get_hard_reg_initial_val (enum machine_mode, unsigned int); -extern rtx has_hard_reg_initial_val (enum machine_mode, unsigned int); -extern rtx get_hard_reg_initial_reg (rtx); -extern bool initial_value_entry (int i, rtx *, rtx *); - -/* Called from gimple_expand_cfg. */ -extern unsigned int emit_initial_value_sets (void); - -/* In predict.c */ -extern bool optimize_function_for_size_p (struct function *); -extern bool optimize_function_for_speed_p (struct function *); - -/* In function.c */ -extern void expand_function_end (void); -extern void expand_function_start (tree); -extern void stack_protect_epilogue (void); -extern void init_dummy_function_start (void); -extern void expand_dummy_function_end (void); -extern void allocate_struct_function (tree, bool); -extern void push_struct_function (tree fndecl); -extern void init_function_start (tree); -extern bool use_register_for_decl (const_tree); -extern void generate_setjmp_warnings (void); -extern void init_temp_slots (void); -extern void free_temp_slots (void); -extern void pop_temp_slots (void); -extern void push_temp_slots (void); -extern void preserve_temp_slots (rtx); -extern int aggregate_value_p (const_tree, const_tree); -extern void push_function_context (void); -extern void pop_function_context (void); -extern gimple_seq gimplify_parameters (void); - #endif /* GCC_FUNCTION_H */ |