On 12/19/2014 08:44 AM, Andrew MacLeod wrote:
On 12/19/2014 06:20 AM, Richard Biener wrote:
On Fri, Dec 19, 2014 at 1:37 AM, Michael Collison
<michael.colli...@linaro.org> wrote:
This patch flattens tree.h and tree-core.h. This work is part of the
GCC
Re-Architecture effort being led by Andrew MacLeod.
I removed the includes in tree.h and tree-core.h except for the
include of
tree-core.h in tree.h.
I modified genattrtab.c, genautomata.c, genemit.c, gengtype.c,
gengtype.c,
genoptinit.c, genoutput.c,
genpeep.c, genpreds.c, and optc-save-gen-awk to include the the
necessary
include files removed from
tree.h and tree-core.h when generating their respective files.
All other changes include the necessary include files removed from
tree.h
and tree-core.h. Note the patches modifies all the front-ends.
I bootstrapped on x86 with all languages. I also bootstrapped on all
targets
listed in contrib/config-list.mk with c and c++ enabled.
Is this okay for trunk?
No - you need to rework it (substantially?). Nothing but tree.h (and
gimple.h)
may include tree-core.h directly. Instead where you added includes of
tree-core.h you need to include tree.h. Basically tree-core.h is an
implementation
detail introduced to hide layer violations where we understand them
(gimple.h).
I also meant to mention that I've been trying to make flattening
plugin-neutral these days too. so when a file is flattened, replicate
any includes that are removed to gcc-plugin.h as well.. if possible.
We're truning it into a giant accumulator that a plugin can use across
releases to shield them from include restructuring as much as possible.
Anyway, it looks like tree-core.h provided a few that aren't currently
in gcc-plugin.h:
#include "statistics.h"
#include "double-int.h"
#include "real.h"
#include "fixed-value.h"
#include "alias.h"
#include "flags.h"
#include "symtab.h"
and tree.h provided:
#include "wide-int.h"
#include "inchash.h"
#include "fold-const.h"
Maybe add those to gcc-plugin.h and make sure it compiles OK?
That way any plugin that use to include tree.h will still compile
without having to figure out what include files are missing again. I'm a
bit surprised the plugin testcases worked, presumably some of the
includes weren't critical to parsing tree.h or were included elsewhere.
Thanks
Andrew