Question on tree-walking and mutually-recursive types
Daniel Berlin
dberlin@dberlin.org
Tue Jun 29 03:48:00 GMT 2004
On Jun 28, 2004, at 11:37 PM, Richard Kenner wrote:
> I'm confused.
> Why can't you just use walk_tree_without_duplicates to do your tree
> walk in the caller, instead of polluting walk_tree?
>
> Or is this common code that requires a walk_tree instead (it's not
> clear), and if so, what code exactly?
>
> It's *all* the tree walking that can run into this. I'm seeing it for
> the walk using check_pointer_types_r, but it could occur on any of
> them.
>
Okay, well, then rather than pollute walk_tree with what looks like
completely ada specific code, why not generalize it so that there is a
tree bit used to tell walk_tree not to recurse further (or to use
duplicate detection starting with this node), and have the Ada frontend
set that bit on these trees.
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.
--Dan
More information about the Gcc
mailing list