On Tue, Sep 10, 2013 at 9:27 PM, Andrew MacLeod <amacl...@redhat.com> wrote:
> This splits out tree-ssaname related things to tree-ssanames.h. This is then
> included from tree-ssa.h

This patch is ok as-is.

> similar treatment can  be given to tree-phinodes.c
>
> I notice a number of the other ssa passes only export a couple of functions,
> and thats it.. no structs or anything like that.  (like tree-ssa-uninit.c
> which exports ssa_undefined_value_p but that cant be easily relocated since
> it depends on static objects in the file which are constructed earlier by
> the pass)

Well - usually the reason is a bad design choice.  There should have been
a ssa_undefined_value_p predicate without the special
possibly_undefined_names pointer-set handling available in generic code
and tree-ssa-uninit.c wrapping that adding it's own special handling.

Most of the awkwardness here is because the generic uninit warning
machinery resides in tree-ssa.c.  Consider moving that (the
early uninit pass and its helpers) to tree-ssa-uninit.c.

> I was thinking that rather than create tree-ssa-passxyz.h in these cases
> would could simply put those prototypes into tree-ssa.h since they are SSA
> related... but I'm ok creating those pass headers if that is the direction
> we want to go....  then we have 1:1 correspondences rather than recreating
> the /* In file.c */ setup again in tree-ssa.h :-)

Please not ;)  Just keep the existing mess rather than changing it to a
different one.  Or go the full way of restructuring things like outlined above
for this special case so no mess is required.

> It looks like there is a bunch of tree-ssa-loop stuff in there as well, I
> would think all of that would be good to put into a tree-ssa-loop.h, and
> then any non-loop files won't need to see these structs and functions unless
> they want to include that file.  (ie tree-ssa.h wouldn't include
> tree-ssa-loop.h, but all the tree-ssa-loop*.c files would)

Sure.  Note that for generic loop stuff we have the IL agnostic cfgloop*
files.

> after that, tree-flow.h will end up with some gimple flow and other
> miscellaneous things which can be looked at, as well as the SSA immediate
> use code which should go somewhere else... perhaps  in
> tree-ssa-operands.h...  Sometimes its hard to tell until you try moving it
> :-)

Immediate use stuff indeed looks like belonging to tree-ssa-operands.[ch].

> then I'd go tackle the stuff in gimple.h and tree.h that doesn't belong
> there.

Keep in mind the tree (GENERIC) vs. GIMPLE (non-SSA specific) and
SSA (SSA-on-GIMPLE specific) distinction.

Richard.

> Andrew

Reply via email to