> 2014-12-08  Martin Liska  <mli...@suse.cz>
> 
>       * cgraph.h (symbol_table::allocate_cgraph_symbol): Summary UID
>       is filled up.
>       * symbol-summary.h: New file.
>       * gengtype.c (open_base_files): Add symbol-summary.h.
>       * toplev.c (general_init): Call constructor of symbol_table.
> ---
>  gcc/cgraph.h         |   8 ++
>  gcc/gengtype.c       |   4 +-
>  gcc/symbol-summary.h | 281 
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>  gcc/toplev.c         |   3 +-
>  4 files changed, 293 insertions(+), 3 deletions(-)
>  create mode 100644 gcc/symbol-summary.h
> 
> diff --git a/gcc/cgraph.h b/gcc/cgraph.h
> index a5c5f56..1664bd7 100644
> --- a/gcc/cgraph.h
> +++ b/gcc/cgraph.h
> @@ -1237,6 +1237,8 @@ public:
>    int count_materialization_scale;
>    /* Unique id of the node.  */
>    int uid;
> +  /* Summary unique id of the node.  */
> +  int summary_uid;

Hmm, can't we just use uid here?  I guess the only difference is that summary
uid is not kept dense, unlike the uid.
This should not propagate into much of trouble simply because the summary 
datastructure
should safely remove the summaires via removal hook.
> +
> +/* We want to pass just pointer types as argument for function_summary
> +   template class.  */
> +
> +template <class T>
> +class function_summary
> +{
> +private:
> +  function_summary();
> +};
> +
> +template <class T>
> +class GTY((user)) function_summary <T *>

Eventually I would like this to allow attaching summaries to variables (and 
symbols in general),
too. But currently we do not have use for it, so we can care about this later.

The patch is OK.  Preferrably with summary_uid replaced by uid if it is easily 
doable.

Honza

Reply via email to