*** empty log message ***
[libfirm] / ir / ir / irgwalk.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
3 **
4 ** Author: Boris Boesler
5 **
6 ** traverse an ir graph
7 ** - execute the pre function before recursion
8 ** - execute the post function after recursion
9 */
10
11
12
13 # ifndef _IRGWALK_H_
14 # define _IRGWALK_H_
15
16 # include "irnode.h"
17
18 /* Walks over the ir graph, starting at the node given as first argument.
19    Executes pre before visiting the predecessor of a node, post after.
20    irg_walk uses the visited flag in irg and the nodes to determine visited
21    nodes.  It executes inc_irg_visited(current_ir_graph) to generate a new
22    flag. */
23 void irg_walk(ir_node *node,
24               void (pre)(ir_node*, void*), void (post)(ir_node*, void*),
25               void *env);
26
27 /* walks only over Block nodes in the graph.  Has it's own visited
28    flag, so that it can be interleaved with the other walker.         */
29 void irg_block_walk(ir_node *node,
30                     void (pre)(ir_node*, void*), void (post)(ir_node*, void*),
31                     void *env);
32
33
34 # endif /* _IRGWALK_H_ */