This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Minor ipa-prop.c internal interface tweak


> 2012-10-31  Martin Jambor  <mjambor@suse.cz>
> 
> 	* ipa-prop.c (ipa_get_param_decl_index_1): New function.
> 	(ipa_get_param_decl_index): Just call ipa_get_param_decl_index_1.
> 	(ipa_populate_param_decls): Accept descriptors parameter rather
> 	than the whole info.
> 	(load_from_unmodified_param): Likewise.
> 	(ipa_load_from_parm_agg_1): Likewise.
> 	(ipa_load_from_parm_agg): Extract descriptors from info.
> 	(compute_complex_assign_jump_func): Likewise.
> 	(ipa_analyze_indirect_call_uses): Likewise.
OK.

Thanks,
Honza
> -int
> -ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
> +static int
> +ipa_get_param_decl_index_1 (VEC (ipa_param_descriptor_t, heap) *descriptors,
> +			    tree ptree)
>  {
>    int i, count;
>  
> -  count = ipa_get_param_count (info);
> +  count = VEC_length (ipa_param_descriptor_t, descriptors);
>    for (i = 0; i < count; i++)
> -    if (ipa_get_param (info, i) == ptree)
> +    if (VEC_index (ipa_param_descriptor_t, descriptors, i).decl == ptree)
>        return i;
>  
>    return -1;
>  }
>  
> -/* Populate the param_decl field in parameter descriptors of INFO that
> -   corresponds to NODE.  */
> +/* Return index of the formal whose tree is PTREE in function which corresponds
> +   to INFO.  */
> +
> +int
> +ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
> +{
> +  return ipa_get_param_decl_index_1 (info->descriptors, ptree);
> +}

I think it would be nice to not have same comment for both functions and explain
the reason why we need _1 variant.

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]