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: [patch 3/5] Remove options.h dependency from tree-core.h


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


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