This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto][patch] Clear TREE_LANG_FLAG_[0-6]
- From: Diego Novillo <dnovillo at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 12 Jan 2009 09:23:47 -0500
- Subject: Re: [lto][patch] Clear TREE_LANG_FLAG_[0-6]
- References: <38a0d8450901120559u1ad15a50j9524c5aebfe93f88@mail.gmail.com>
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.