comments added
[libfirm] / ir / tr / typewalk.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2
3 ** All rights reserved.
4 **
5 ** Author: Goetz Lindenmaier
6 **
7 ** traverse the type information.  The walker walks the whole ir graph
8 ** to find the distinct type trees in the type graph forest.
9 ** - execute the pre function before recursion
10 ** - execute the post function after recursion
11 */
12
13
14 /* walk over all type information reachable from the ir graph. */
15
16 #ifndef _TYPEWALK_H_
17 #define _TYPEWALK_H_
18
19 # include "type_or_entity.h"
20
21
22 /** Walks over all type information reachable from global roots.
23     Touches every type and entity in unspecified order.  If new
24     types/entities are created during the traversal these will
25     be visited, too. **/
26 void type_walk(void (pre)(type_or_ent*, void*),
27                void (post)(type_or_ent*, void*),
28                void *env);
29
30 /** walks over all type information reachable from irg **/
31 void type_walk_irg(ir_graph *irg,
32                    void (pre)(type_or_ent*, void*),
33                    void (post)(type_or_ent*, void*),
34                    void *env);
35
36 /** Walks over all type information reachable from global roots.
37     Touches every type and entity in specified order:
38     - first the super types
39     - secand the type itself
40     - third the sub types.  If new types/entities are created
41     during the traversal these will be visited, too. **/
42 void type_walk_super2sub(void (pre)(type_or_ent*, void*),
43                          void (post)(type_or_ent*, void*),
44                          void *env);
45
46 #endif /* _TYPEWALK_H_ */