This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch 3/5] Remove options.h dependency from tree-core.h
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Jun 2015 14:37:19 +0200
- Subject: Re: [patch 3/5] Remove options.h dependency from tree-core.h
- Authentication-results: sourceware.org; auth=none
- References: <55805AD2 dot 5060205 at redhat dot com>
On Tue, Jun 16, 2015 at 7:20 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> tree-core.h won't compile without seeing options.h (which is usually brought
> in by tm.h) because a TARGET_OPTION node contains an instance of struct
> cl_target_option, defined thru options.h.
>
> Its fairly straightforward to change it so the tree node simply contains a
> pointer to one of these structures, and allocates it whenever the node is
> created or copied. This adds an extra allocation, but I don't think this
> tree node is extensively utilized.
>
> This removes the only compilation dependency on options.h from tree-core.
> This will hopefully lead to many less instances of tm,h being required.
>
> THis bootstraps on x86_64-unknown-linux-gnu with no new regressions, and
> passes compilation on all the config-list.mk targets.
>
> OK for mainline?
Something is broken with indenting
+ case tcc_exceptional:
+ if (code == TARGET_OPTION_NODE)
+ {
+ TREE_TARGET_OPTION(t) = ggc_cleared_alloc<struct cl_target_option> ();
+ }
+ break;
....
+ else if (code == TARGET_OPTION_NODE)
+ {
+ TREE_TARGET_OPTION (t) = ggc_alloc<struct cl_target_option>();
+ memcpy (TREE_TARGET_OPTION (t), TREE_TARGET_OPTION (node),
+ sizeof (struct cl_target_option));
+ }
otherwise ok.
Thanks,
Richard.
> Andrew