+/* Return the used flag corresponding to the Ith formal parameter of the
+ function associated with INFO. */
+
+static inline bool
+ipa_is_param_used (struct ipa_node_params *info, int i)
+{
+ return VEC_index (ipa_param_descriptor_t, info->descriptors, i)->used;
+}
+
+/* ipa_edge_args stores information related to a callsite and particularly its
+ arguments. It can be accessed by the IPA_EDGE_REF macro. */
+typedef struct GTY(()) ipa_edge_args
+{
+ /* 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. */
+
+/* Return the number of actual arguments. */
+
+static inline int
+ipa_get_cs_argument_count (struct ipa_edge_args *args)
+{
+ return VEC_length (ipa_jump_func_t, args->jump_functions);
+}
+
+/* Returns a pointer to the jump function for the ith argument. Please note
+ there is no setter function as jump functions are all set up in
+ ipa_compute_jump_functions. */
+
+static inline struct ipa_jump_func *
+ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
+{
+ return VEC_index (ipa_jump_func_t, args->jump_functions, i);
+}
+
+/* Vectors need to have typedefs of structures. */
+typedef struct ipa_node_params ipa_node_params_t;
+
+/* Types of vectors holding the infos. */
+DEF_VEC_O (ipa_node_params_t);
+DEF_VEC_ALLOC_O (ipa_node_params_t, heap);
+DEF_VEC_O (ipa_edge_args_t);
+DEF_VEC_ALLOC_O (ipa_edge_args_t, gc);
+
+/* Vector where the parameter infos are actually stored. */
+extern VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
+/* Vector where the parameter infos are actually stored. */
+extern GTY(()) VEC (ipa_edge_args_t, gc) *ipa_edge_args_vector;
+
+/* Return the associated parameter/argument info corresponding to the given
+ node/edge. */
+#define IPA_NODE_REF(NODE) (VEC_index (ipa_node_params_t, \
+ ipa_node_params_vector, (NODE)->uid))
+#define IPA_EDGE_REF(EDGE) (VEC_index (ipa_edge_args_t, \
+ ipa_edge_args_vector, (EDGE)->uid))
+/* This macro checks validity of index returned by
+ ipa_get_param_decl_index function. */
+#define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1)
+
+/* Creating and freeing ipa_node_params and ipa_edge_args. */
+void ipa_create_all_node_params (void);
+void ipa_create_all_edge_args (void);
+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_free_all_structures_after_ipa_cp (void);
+void ipa_free_all_structures_after_iinln (void);
+void ipa_register_cgraph_hooks (void);
+
+/* This function ensures the array of node param infos is big enough to
+ accommodate a structure for all nodes and reallocates it if not. */
+
+static inline void
+ipa_check_create_node_params (void)
+{
+ if (!ipa_node_params_vector)
+ ipa_node_params_vector = VEC_alloc (ipa_node_params_t, heap,
+ cgraph_max_uid);
+
+ if (VEC_length (ipa_node_params_t, ipa_node_params_vector)
+ <= (unsigned) cgraph_max_uid)
+ VEC_safe_grow_cleared (ipa_node_params_t, heap,
+ ipa_node_params_vector, cgraph_max_uid + 1);
+}
+
+/* This function ensures the array of edge arguments infos is big enough to
+ accommodate a structure for all edges and reallocates it if not. */
+
+static inline void
+ipa_check_create_edge_args (void)
+{
+ if (!ipa_edge_args_vector)
+ ipa_edge_args_vector = VEC_alloc (ipa_edge_args_t, gc,
+ cgraph_edge_max_uid);
+
+ if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
+ <= (unsigned) cgraph_edge_max_uid)
+ VEC_safe_grow_cleared (ipa_edge_args_t, gc, ipa_edge_args_vector,
+ cgraph_edge_max_uid + 1);
+}
+
+/* Returns true if the array of edge infos is large enough to accommodate an
+ info for EDGE. The main purpose of this function is that debug dumping
+ function can check info availability without causing reallocations. */
+
+static inline bool
+ipa_edge_args_info_available_for_edge_p (struct cgraph_edge *edge)
+{
+ return ((unsigned) edge->uid < VEC_length (ipa_edge_args_t,
+ ipa_edge_args_vector));
+}
+
+/* Function formal parameters related computations. */
+void ipa_initialize_node_params (struct cgraph_node *node);
+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. */
+void ipa_analyze_node (struct cgraph_node *);