* How to run over each node of a tree ?
@ 2003-05-20 10:12 Matthieu Moy
2003-05-20 12:01 ` Diego Novillo
2003-05-20 12:01 ` Pop Sébastian
0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Moy @ 2003-05-20 10:12 UTC (permalink / raw)
To: gcc
Hi,
I want to do a complete run over a tree (GCC AST).
Basically, this is a recursive function with a switch statement on the
TREE_CODE of the top of the tree.
But is there a way to be sure I didn't forget any case. For example,
on a WHILE_STMT, I may have forgoten to explore the WHILE_COND, or
something like this.
In particular, how can I know wether a node has a TREE_CHAIN field ?
This field sometimes points to a junk value (Not NULL, not a tree ...)
Thanks for your help,
--
Matthieu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to run over each node of a tree ?
2003-05-20 10:12 How to run over each node of a tree ? Matthieu Moy
@ 2003-05-20 12:01 ` Diego Novillo
2003-05-20 12:01 ` Pop Sébastian
1 sibling, 0 replies; 3+ messages in thread
From: Diego Novillo @ 2003-05-20 12:01 UTC (permalink / raw)
To: Matthieu Moy; +Cc: gcc
On Tue, 2003-05-20 at 05:16, Matthieu Moy wrote:
> I want to do a complete run over a tree (GCC AST).
>
Implement a call-back function for walk_tree.
> In particular, how can I know wether a node has a TREE_CHAIN field ?
> This field sometimes points to a junk value (Not NULL, not a tree ...)
>
Check lang_hooks.tree_inlining.tree_chain_matters_p. If that is true
for a node, TREE_CHAIN should be valid.
Diego.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to run over each node of a tree ?
2003-05-20 10:12 How to run over each node of a tree ? Matthieu Moy
2003-05-20 12:01 ` Diego Novillo
@ 2003-05-20 12:01 ` Pop Sébastian
1 sibling, 0 replies; 3+ messages in thread
From: Pop Sébastian @ 2003-05-20 12:01 UTC (permalink / raw)
To: gcc
On Tue, May 20, 2003 at 11:16:38AM +0200, Matthieu Moy wrote:
>
> I want to do a complete run over a tree (GCC AST).
>
you could use walk_tree ().
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-20 12:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-20 10:12 How to run over each node of a tree ? Matthieu Moy
2003-05-20 12:01 ` Diego Novillo
2003-05-20 12:01 ` Pop Sébastian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).