OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / ipa-prop.h
index 618b5a0..1a609a5 100644 (file)
@@ -72,13 +72,24 @@ along with GCC; see the file COPYING3.  If not see
 enum jump_func_type
 {
   IPA_JF_UNKNOWN = 0,  /* newly allocated and zeroed jump functions default */
-  IPA_JF_KNOWN_TYPE,        /* represented by field base_binfo */
+  IPA_JF_KNOWN_TYPE,        /* represented by field known_type */
   IPA_JF_CONST,             /* represented by field costant */
   IPA_JF_CONST_MEMBER_PTR,  /* represented by field member_cst */
   IPA_JF_PASS_THROUGH,     /* represented by field pass_through */
   IPA_JF_ANCESTOR          /* represented by field ancestor */
 };
 
+/* Structure holding data required to describe a known type jump function.  */
+struct GTY(()) ipa_known_type_data
+{
+  /* Offset of the component of the base_type being described.  */
+  HOST_WIDE_INT offset;
+  /* Type of the whole object.  */
+  tree base_type;
+  /* Type of the component of the object that is being described.  */
+  tree component_type;
+};
+
 /* Structure holding data required to describe a pass-through jump function.  */
 
 struct GTY(()) ipa_pass_through_data
@@ -119,7 +130,7 @@ struct GTY(()) ipa_member_ptr_cst
 /* A jump function for a callsite represents the values passed as actual
    arguments of the callsite. See enum jump_func_type for the various
    types of jump functions supported.  */
-struct GTY (()) ipa_jump_func
+typedef struct GTY (()) ipa_jump_func
 {
   enum jump_func_type type;
   /* Represents a value of a jump function.  pass_through is used only in jump
@@ -127,13 +138,16 @@ struct GTY (()) ipa_jump_func
      functions and member_cst holds constant c++ member functions.  */
   union jump_func_value
   {
-    tree GTY ((tag ("IPA_JF_KNOWN_TYPE"))) base_binfo;
+    struct ipa_known_type_data GTY ((tag ("IPA_JF_KNOWN_TYPE"))) known_type;
     tree GTY ((tag ("IPA_JF_CONST"))) constant;
     struct ipa_member_ptr_cst GTY ((tag ("IPA_JF_CONST_MEMBER_PTR"))) member_cst;
     struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
     struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
   } GTY ((desc ("%1.type"))) value;
-};
+} ipa_jump_func_t;
+
+DEF_VEC_O (ipa_jump_func_t);
+DEF_VEC_ALLOC_O (ipa_jump_func_t, gc);
 
 /* Summary describing a single formal parameter.  */
 
@@ -223,31 +237,19 @@ ipa_is_param_used (struct ipa_node_params *info, int i)
    arguments.  It can be accessed by the IPA_EDGE_REF macro.  */
 typedef struct GTY(()) ipa_edge_args
 {
-  /* Number of actual arguments in this callsite.  When set to 0,
-     this callsite's parameters would not be analyzed by the different
-     stages of IPA CP.  */
-  int argument_count;
-  /* Array of the callsite's jump function of each parameter.  */
-  struct ipa_jump_func GTY ((length ("%h.argument_count"))) *jump_functions;
+  /* Vector of the callsite's jump function of each parameter.  */
+  VEC (ipa_jump_func_t, gc) *jump_functions;
 } ipa_edge_args_t;
 
 /* ipa_edge_args access functions.  Please use these to access fields that
    are or will be shared among various passes.  */
 
-/* Set the number of actual arguments. */
-
-static inline void
-ipa_set_cs_argument_count (struct ipa_edge_args *args, int count)
-{
-  args->argument_count = count;
-}
-
 /* Return the number of actual arguments. */
 
 static inline int
 ipa_get_cs_argument_count (struct ipa_edge_args *args)
 {
-  return args->argument_count;
+  return VEC_length (ipa_jump_func_t, args->jump_functions);
 }
 
 /* Returns a pointer to the jump function for the ith argument.  Please note
@@ -257,8 +259,7 @@ ipa_get_cs_argument_count (struct ipa_edge_args *args)
 static inline struct ipa_jump_func *
 ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
 {
-  gcc_assert (i >= 0 && i <= args->argument_count);
-  return &args->jump_functions[i];
+  return VEC_index (ipa_jump_func_t, args->jump_functions, i);
 }
 
 /* Vectors need to have typedefs of structures.  */
@@ -292,7 +293,6 @@ void ipa_free_edge_args_substructures (struct ipa_edge_args *);
 void ipa_free_node_params_substructures (struct ipa_node_params *);
 void ipa_free_all_node_params (void);
 void ipa_free_all_edge_args (void);
-void ipa_create_all_structures_for_iinln (void);
 void ipa_free_all_structures_after_ipa_cp (void);
 void ipa_free_all_structures_after_iinln (void);
 void ipa_register_cgraph_hooks (void);
@@ -346,6 +346,9 @@ bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
                                        VEC (cgraph_edge_p, heap) **new_edges);
 
 /* Indirect edge and binfo processing.  */
+tree ipa_get_indirect_edge_target (struct cgraph_edge *ie,
+                                  VEC (tree, heap) *known_csts,
+                                  VEC (tree, heap) *known_binfs);
 struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree);
 
 /* Functions related to both.  */
@@ -437,8 +440,8 @@ void ipa_prop_write_jump_functions (cgraph_node_set set);
 void ipa_prop_read_jump_functions (void);
 void ipa_update_after_lto_read (void);
 int ipa_get_param_decl_index (struct ipa_node_params *, tree);
-tree ipa_cst_from_jfunc (struct ipa_node_params *info,
-                        struct ipa_jump_func *jfunc);
+tree ipa_value_from_jfunc (struct ipa_node_params *info,
+                          struct ipa_jump_func *jfunc);
 
 
 /* From tree-sra.c:  */