Update to 4.8.2.
[platform/upstream/gcc48.git] / gcc / function.h
index 5aaba74..89d71e5 100644 (file)
@@ -1,7 +1,5 @@
 /* Structure for saving state for a nested function.
-   Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1989-2013 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -22,11 +20,12 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_FUNCTION_H
 #define GCC_FUNCTION_H
 
-#include "tree.h"
 #include "hashtab.h"
-#include "vecprim.h"
-#include "tm.h"                /* For CUMULATIVE_ARGS.  */
-#include "hard-reg-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.
@@ -70,10 +69,6 @@ struct GTY(()) emit_status {
      --param min-nondebug-insn-uid=<value> is given with nonzero value.  */
   int x_cur_debug_insn_uid;
 
-  /* Location the last line-number NOTE emitted.
-     This is used to avoid generating duplicates.  */
-  location_t x_last_location;
-
   /* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
      vectors.  Since these vectors are needed during the expansion phase when
      the total number of registers in the function is not yet known, the
@@ -144,8 +139,6 @@ struct GTY(()) expr_status {
 };
 
 typedef struct call_site_record_d *call_site_record;
-DEF_VEC_P(call_site_record);
-DEF_VEC_ALLOC_P(call_site_record, gc);
 
 /* RTL representation of exception handling.  */
 struct GTY(()) rtl_eh {
@@ -156,9 +149,9 @@ struct GTY(()) rtl_eh {
   rtx sjlj_fc;
   rtx sjlj_exit_after;
 
-  VEC(uchar,gc) *action_record_data;
+  vec<uchar, va_gc> *action_record_data;
 
-  VEC(call_site_record,gc) *call_site_record[2];
+  vec<call_site_record, va_gc> *call_site_record_v[2];
 };
 
 #define pending_stack_adjust (crtl->expr.x_pending_stack_adjust)
@@ -174,13 +167,9 @@ typedef struct temp_slot *temp_slot_p;
 struct call_site_record_d;
 struct dw_fde_struct;
 
-DEF_VEC_P(temp_slot_p);
-DEF_VEC_ALLOC_P(temp_slot_p,gc);
 struct ipa_opt_pass_d;
 typedef struct ipa_opt_pass_d *ipa_opt_pass;
 
-DEF_VEC_P(ipa_opt_pass);
-DEF_VEC_ALLOC_P(ipa_opt_pass,heap);
 
 struct GTY(()) varasm_status {
   /* If we're using a per-function constant pool, this is it.  */
@@ -264,8 +253,11 @@ struct GTY(()) rtl_data {
      the hard register containing the result.  */
   rtx return_rtx;
 
-  /* Opaque pointer used by get_hard_reg_initial_val and
-     has_hard_reg_initial_val (see integrate.[hc]).  */
+  /* Vector of initial-value pairs.  Each pair consists of a pseudo
+     register of approprite mode that stores the initial value a hard
+     register REGNO, and that hard register itself.  */
+  /* ??? This could be a VEC but there is currently no way to define an
+        opaque VEC type.  */
   struct initial_value_struct *hard_reg_initial_vals;
 
   /* A variable living at the top of the frame that holds a known value.
@@ -314,7 +306,7 @@ struct GTY(()) rtl_data {
   rtx x_parm_birth_insn;
 
   /* List of all used temporaries allocated, by level.  */
-  VEC(temp_slot_p,gc) *x_used_temp_slots;
+  vec<temp_slot_p, va_gc> *x_used_temp_slots;
 
   /* List of available temp slots.  */
   struct temp_slot *x_avail_temp_slots;
@@ -347,10 +339,6 @@ struct GTY(()) rtl_data {
 
   /* For reorg.  */
 
-  /* If some insns can be deferred to the delay slots of the epilogue, the
-     delay list for them is recorded here.  */
-  rtx epilogue_delay_list;
-
   /* Nonzero if function being compiled called builtin_return_addr or
      builtin_frame_address with nonzero count.  */
   bool accesses_prior_frames;
@@ -399,7 +387,8 @@ struct GTY(()) rtl_data {
   bool arg_pointer_save_area_init;
 
   /* Nonzero if current function must be given a frame pointer.
-     Set in global.c if anything is allocated on the stack there.  */
+     Set in reload1.c or lra-eliminations.c if anything is allocated
+     on the stack there.  */
   bool frame_pointer_needed;
 
   /* When set, expand should optimize for speed.  */
@@ -441,6 +430,22 @@ struct GTY(()) rtl_data {
   /* True if we performed shrink-wrapping for the current function.  */
   bool shrink_wrapped;
 
+  /* Nonzero if function being compiled doesn't modify the stack pointer
+     (ignoring the prologue and epilogue).  This is only valid after
+     pass_stack_ptr_mod has run.  */
+  bool sp_is_unchanging;
+
+  /* Nonzero if function being compiled doesn't contain any calls
+     (ignoring the prologue and epilogue).  This is set prior to
+     local register allocation and is valid for the remaining
+     compiler passes.  */
+  bool is_leaf;
+
+  /* Nonzero if the function being compiled is a leaf function which only
+     uses leaf registers.  This is valid after reload (specifically after
+     sched2) and is useful only if the port defines LEAF_REGISTERS.  */
+  bool uses_only_leaf_regs;
+
   /* Like regs_ever_live, but 1 if a reg is set or clobbered from an
      asm.  Unlike regs_ever_live, elements of this array corresponding
      to eliminable regs (like the frame pointer) are set if an asm
@@ -507,7 +512,7 @@ struct GTY(()) function {
   struct control_flow_graph *cfg;
 
   /* GIMPLE body for this function.  */
-  struct gimple_seq_d *gimple_body;
+  gimple_seq gimple_body;
 
   /* SSA and dataflow information.  */
   struct gimple_df *gimple_df;
@@ -536,7 +541,7 @@ struct GTY(()) function {
   tree nonlocal_goto_save_area;
 
   /* Vector of function local variables, functions, types and constants.  */
-  VEC(tree,gc) *local_decls;
+  vec<tree, va_gc> *local_decls;
 
   /* For md files.  */
 
@@ -612,6 +617,10 @@ struct GTY(()) function {
      exceptions.  */
   unsigned int can_throw_non_call_exceptions : 1;
 
+  /* Nonzero if instructions that may throw exceptions but don't otherwise
+     contribute to the execution of the program can be deleted.  */
+  unsigned int can_delete_dead_exceptions : 1;
+
   /* Fields below this point are not set for abstract functions; see
      allocate_struct_function.  */
 
@@ -623,9 +632,6 @@ struct GTY(()) function {
      return the address of where it has put a structure value.  */
   unsigned int returns_pcc_struct : 1;
 
-  /* Nonzero if pass_tree_profile was run on this function.  */
-  unsigned int after_tree_profile : 1;
-
   /* Nonzero if this function has local DECL_HARD_REGISTER variables.
      In this case code motion has to be done more carefully.  */
   unsigned int has_local_explicit_reg_vars : 1;
@@ -642,11 +648,11 @@ struct GTY(()) function {
 static inline void
 add_local_decl (struct function *fun, tree d)
 {
-  VEC_safe_push (tree, gc, fun->local_decls, d);
+  vec_safe_push (fun->local_decls, d);
 }
 
 #define FOR_EACH_LOCAL_DECL(FUN, I, D)         \
-  FOR_EACH_VEC_ELT_REVERSE (tree, (FUN)->local_decls, I, D)
+  FOR_EACH_VEC_SAFE_ELT_REVERSE ((FUN)->local_decls, I, D)
 
 /* If va_list_[gf]pr_size is set to this, it means we don't know how
    many units need to be saved.  */
@@ -686,8 +692,7 @@ void types_used_by_var_decl_insert (tree type, tree var_decl);
 
 /* During parsing of a global variable, this vector contains the types
    referenced by the global variable.  */
-extern GTY(()) VEC(tree,gc) *types_used_by_cur_var_decl;
-
+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);
@@ -742,6 +747,8 @@ extern void clobber_return_register (void);
 extern rtx get_arg_pointer_save_area (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);
@@ -760,6 +767,14 @@ extern int get_last_funcdef_no (void);
 extern bool requires_stack_frame_p (rtx, HARD_REG_SET, HARD_REG_SET);
 #endif                        
 
+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 *);