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: [lto][patch] Clear TREE_LANG_FLAG_[0-6]


On Mon, Jan 12, 2009 at 08:59, Rafael Espindola <espindola@google.com> wrote:

>  	  varpool_mark_needed_node (varpool_node (t));
> -	  if (lang_hooks.callgraph.analyze_expr)
> +	  if (lang_specifics_available)

Why not just set 'lang_hooks.callgraph.analyze_expr = NULL' after
pass_ipa_free_lang_specifics?  I don't really want to introduce
yet another global flag if we can avoid it.

This way, every langhook we want to disable we simply NULL it out
and add guards to test for their presence if the guards are not
already there.

>  	    return lang_hooks.callgraph.analyze_expr (tp, walk_subtrees);
>  	}
>        break;
> diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
> index de63f1e..268a6f6 100644
> --- a/gcc/cp/decl2.c
> +++ b/gcc/cp/decl2.c
> @@ -3240,6 +3240,7 @@ tree
>  cxx_callgraph_analyze_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED)
>  {
>    tree t = *tp;
> +  gcc_assert (lang_specifics_available);

This assert would then be unnecessary.

The rest is OK.


Diego.


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