This is the mail archive of the gcc@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: Question on tree-walking and mutually-recursive types


    Okay, well, then rather than pollute walk_tree with what looks like 
    completely ada specific code, 

But *is* it really Ada-specific?  If we define GENERIC as "the tree language
supported just before the tree-ssa merge" (the best definition we have),
we used to allow this mutual recursion.  Is it really on Ada that can
express this?  There's nothing fundamental about Ada here; it just happens
to allow a rather general form of incomplete types.

I know you can't do this in C, but I'm not familiar enough with C++ or Java
(or even modern Fortran) to know it's impossible there.  Do you know for sure
it isn't?

    Call it TREE_DONT_WALK or TREE_MAY_CONTAIN_CYCLES or something.
    That way, you don't have special cased language code in a middle end 
    function.

Because it really isn't special-cases language code.  It's detecting a
particular pattern in the way the types are laid out and it so happens that
we think only Ada can do that, but it's not language-specific per se.  (There
a lots of comments about similar thinks for C and C++).

But finally, that bit you suggest is also language-specific in the same sense
that the code is.  Given how precious bits in types are, I'd much rather have
a small amount of somewhat language *code* than a somewhat language-specific
*flag*!


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