OSDN Git Service

2011-05-26 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / ipa-prop.h
index 9244d5a..89a17f4 100644 (file)
@@ -228,6 +228,7 @@ ipa_get_param_count (struct ipa_node_params *info)
 static inline tree
 ipa_get_param (struct ipa_node_params *info, int i)
 {
+  gcc_assert (i >= 0 && i <= info->param_count);
   return info->params[i].decl;
 }
 
@@ -237,6 +238,7 @@ ipa_get_param (struct ipa_node_params *info, int i)
 static inline bool
 ipa_is_param_used (struct ipa_node_params *info, int i)
 {
+  gcc_assert (i >= 0 && i <= info->param_count);
   return info->params[i].used;
 }
 
@@ -247,6 +249,7 @@ ipa_is_param_used (struct ipa_node_params *info, int i)
 static inline bool
 ipa_param_cannot_devirtualize_p (struct ipa_node_params *info, int i)
 {
+  gcc_assert (i >= 0 && i <= info->param_count);
   return info->params[i].cannot_devirtualize;
 }
 
@@ -256,6 +259,7 @@ ipa_param_cannot_devirtualize_p (struct ipa_node_params *info, int i)
 static inline bool
 ipa_param_types_vec_empty (struct ipa_node_params *info, int i)
 {
+  gcc_assert (i >= 0 && i <= info->param_count);
   return info->params[i].types == NULL;
 }
 
@@ -315,6 +319,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];
 }
 
@@ -515,9 +520,25 @@ void ipa_dump_param_adjustments (FILE *, ipa_parm_adjustment_vec, tree);
 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);
+void ipa_lattice_from_jfunc (struct ipa_node_params *info,
+                            struct ipcp_lattice *lat,
+                            struct ipa_jump_func *jfunc);
+tree ipa_cst_from_jfunc (struct ipa_node_params *info,
+                        struct ipa_jump_func *jfunc);
+
 
 /* From tree-sra.c:  */
 tree build_ref_for_offset (location_t, tree, HOST_WIDE_INT, tree,
                           gimple_stmt_iterator *, bool);
 
+/* Return the lattice corresponding to the Ith formal parameter of the function
+   described by INFO.  */
+static inline struct ipcp_lattice *
+ipa_get_lattice (struct ipa_node_params *info, int i)
+{
+  gcc_assert (i >= 0 && i <= info->param_count);
+  return &(info->params[i].ipcp_lattice);
+}
+
 #endif /* IPA_PROP_H */