/* Interprocedural analyses.
- Copyright (C) 2005-2014 Free Software Foundation, Inc.
+ Copyright (C) 2005-2015 Free Software Foundation, Inc.
This file is part of GCC.
#ifndef IPA_PROP_H
#define IPA_PROP_H
-
/* The following definitions and interfaces are used by
interprocedural analyses or parameters. */
struct ipa_node_params
{
+ ~ipa_node_params ();
+
/* Information about individual formal parameters that are gathered when
summaries are generated. */
vec<ipa_param_descriptor> descriptors;
/* Node has been completely replaced by clones and will be removed after
ipa-cp is finished. */
unsigned node_dead : 1;
+ /* Node is involved in a recursion, potentionally indirect. */
+ unsigned node_within_scc : 1;
+ /* Node is calling a private function called only once. */
+ unsigned node_calling_single_call : 1;
};
/* ipa_node_params access functions. Please use these to access fields that
return &(*args->polymorphic_call_contexts)[i];
}
-/* Types of vectors holding the infos. */
+/* Function summary for ipa_node_params. */
+class ipa_node_params_t: public function_summary <ipa_node_params *>
+{
+public:
+ ipa_node_params_t (symbol_table *table):
+ function_summary<ipa_node_params *> (table) { }
-/* Vector where the parameter infos are actually stored. */
-extern vec<ipa_node_params> ipa_node_params_vector;
+ /* Hook that is called by summary when a node is duplicated. */
+ virtual void duplicate (cgraph_node *node,
+ cgraph_node *node2,
+ ipa_node_params *data,
+ ipa_node_params *data2);
+};
+
+/* Function summary where the parameter infos are actually stored. */
+extern ipa_node_params_t *ipa_node_params_sum;
/* Vector of IPA-CP transformation data for each clone. */
extern GTY(()) vec<ipcp_transformation_summary, va_gc> *ipcp_transformations;
/* Vector where the parameter infos are actually stored. */
/* Return the associated parameter/argument info corresponding to the given
node/edge. */
-#define IPA_NODE_REF(NODE) (&ipa_node_params_vector[(NODE)->uid])
+#define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE))
#define IPA_EDGE_REF(EDGE) (&(*ipa_edge_args_vector)[(EDGE)->uid])
/* This macro checks validity of index returned by
ipa_get_param_decl_index function. */
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);
int count_formal_params (tree fndecl);
static inline void
ipa_check_create_node_params (void)
{
- if (!ipa_node_params_vector.exists ())
- ipa_node_params_vector.create (symtab->cgraph_max_uid);
-
- if (ipa_node_params_vector.length () <= (unsigned) symtab->cgraph_max_uid)
- ipa_node_params_vector.safe_grow_cleared (symtab->cgraph_max_uid + 1);
+ if (!ipa_node_params_sum)
+ ipa_node_params_sum = new ipa_node_params_t (symtab);
}
/* This function ensures the array of edge arguments infos is big enough to