OSDN Git Service

Implement -Wno-maybe-uninitialized
[pf3gnuchains/gcc-fork.git] / gcc / ipa-prop.h
index 8244a7f..d5f1bc6 100644 (file)
@@ -1,5 +1,5 @@
 /* Interprocedural analyses.
-   Copyright (C) 2005, 2007, 2008, 2009
+   Copyright (C) 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "vec.h"
 #include "cgraph.h"
+#include "gimple.h"
 
 /* The following definitions and interfaces are used by
    interprocedural analyses or parameters.  */
@@ -227,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;
 }
 
@@ -236,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;
 }
 
@@ -246,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;
 }
 
@@ -255,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;
 }
 
@@ -314,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];
 }
 
@@ -429,7 +435,8 @@ bool ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
                                        VEC (cgraph_edge_p, heap) **new_edges);
 
 /* Indirect edge and binfo processing.  */
-struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree);
+struct cgraph_edge *ipa_make_edge_direct_to_target (struct cgraph_edge *, tree,
+                                                   tree);
 
 
 /* Debugging interface.  */
@@ -457,6 +464,10 @@ struct ipa_parm_adjustment
      be a pointer to this type.  */
   tree type;
 
+  /* Alias refrerence type to be used in MEM_REFs when adjusting caller
+     arguments.  */
+  tree alias_ptr_type;
+
   /* The new declaration when creating/replacing a parameter.  Created by
      ipa_modify_formal_parameters, useful for functions modifying the body
      accordingly. */
@@ -509,8 +520,21 @@ 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);
 
 /* From tree-sra.c:  */
-bool build_ref_for_offset (tree *, tree, HOST_WIDE_INT, tree, bool);
+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 */