[PATCH 2/4] New data structure for cgraph_summary introduced.

Jan Hubicka hubicka@ucw.cz
Thu Nov 13 15:57:00 GMT 2014


> gcc/ChangeLog:
> 
> 2014-11-12  Martin Liska  <mliska@suse.cz>
> 
> 	* Makefile.in: New object file is added.
> 	* cgraph.h (symbol_table::allocate_cgraph_symbol): Summary UID
> 	is filled up.
> 	* cgraph_summary.c: New file.
> 	* cgraph_summary.h: New file.

Since I am trying to get rid of the cgraph prefixes for symbols (keep it for
the graph only) and the summaries can be annotated to variables too. Even if it
not necessarily supported by your current implementation, lets keep API
prepared for it. So I would call it symtab-summary.* for source files and
symtab_summary for base type  (probably function_summary for annotating
functions/cgraph_edge_summary for annotating edges?)


> diff --git a/gcc/cgraph.h b/gcc/cgraph.h
> index e2becb9..588b6d5 100644
> --- a/gcc/cgraph.h
> +++ b/gcc/cgraph.h
> @@ -1225,6 +1225,8 @@ public:
>    int count_materialization_scale;
>    /* Unique id of the node.  */
>    int uid;
> +  /* Summary unique id of the node.  */
> +  int summary_uid;

What makes summary_uid better than uid?

> diff --git a/gcc/cgraph_summary.c b/gcc/cgraph_summary.c
> new file mode 100644
> index 0000000..9af1d7e
> --- /dev/null
> +++ b/gcc/cgraph_summary.c

And why do we need this file?  It will need license header if really needed.

The implementation seems sane - I will check the actual uses :)
Please send the updated patch though.

Honza



More information about the Gcc-patches mailing list