aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.h
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-03 19:48:39 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-03 19:48:39 +0000
commitb22832dc3297d30a20afa5a7675d46a9bf900e78 (patch)
treef58a3c72614d08e1db1d533101a557475b159314 /gcc/ipa-prop.h
parent72f09c1c96c64b6280401c6c82c3484327b4ce24 (diff)
2011-09-03 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (ipa_jump_func_t): New typedef. (struct ipa_edge_args): Removed field argument_count, field jump_functions turned into a vector. (ipa_set_cs_argument_count): Removed. (ipa_get_cs_argument_count): Updated to work on vectors. (ipa_get_ith_jump_func): Likewise. * ipa-prop.c (ipa_count_arguments): Removed. (compute_scalar_jump_functions): Use ipa_get_ith_jump_func to access jump functions. Update caller. (compute_pass_through_member_ptrs): Likewise. (compute_cst_member_ptr_arguments): Likewise. (ipa_compute_jump_functions_for_edge): Get number of arguments from the statement, allocate vector. (ipa_compute_jump_functions): Do not call ipa_count_arguments. (duplicate_ipa_jump_func_array): Removed. (ipa_edge_duplication_hook): Use VEC_copy, do not copy argument count. (ipa_read_node_info): Allocate vector. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178502 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r--gcc/ipa-prop.h28
1 files changed, 9 insertions, 19 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 618b5a0b9cd..fafd17d2fce 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -119,7 +119,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
@@ -133,7 +133,10 @@ struct GTY (()) ipa_jump_func
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 +226,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 +248,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. */