From b22832dc3297d30a20afa5a7675d46a9bf900e78 Mon Sep 17 00:00:00 2001 From: jamborm Date: Sat, 3 Sep 2011 19:48:39 +0000 Subject: 2011-09-03 Martin Jambor * 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 --- gcc/ipa-prop.h | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'gcc/ipa-prop.h') 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. */ -- cgit v1.2.3