added debug support constructors
[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 /* $Id$ */
14
15
16 /* walk over all type information reachable from the ir graph. */
17
18 #ifndef _TYPEWALK_H_
19 #define _TYPEWALK_H_
20
21 # include "type_or_entity.h"
22
23
24 /** Walks over all type information reachable from global roots.
25     Touches every type and entity in unspecified order.  If new
26     types/entities are created during the traversal these will
27     be visited, too. **/
28 void type_walk(void (pre)(type_or_ent*, void*),
29                void (post)(type_or_ent*, void*),
30                void *env);
31
32 /** walks over all type information reachable from irg **/
33 void type_walk_irg(ir_graph *irg,
34                    void (pre)(type_or_ent*, void*),
35                    void (post)(type_or_ent*, void*),
36                    void *env);
37
38 /** Walks over all type information reachable from global roots.
39     Touches every class in specified order:
40     - first the super class
41     - second the class itself
42     - third the sub classes.  If new classes are created
43     during the traversal these will be visited, too. **/
44 /** @@@ should be named class-walk **/
45 /*  @@@ will be removed? */
46 void type_walk_super2sub(void (pre)(type_or_ent*, void*),
47                          void (post)(type_or_ent*, void*),
48                          void *env);
49
50 /** Walks over all type information reachable from global roots.
51     Touches every class in specified order:
52     - first the super class
53     - second the class itself
54     If new classes are created during the traversal these
55     will be visited, too. **/
56 void type_walk_super(void (pre)(type_or_ent*, void*),
57                      void (post)(type_or_ent*, void*),
58                      void *env);
59
60 /* Same as type_walk_super2sub, but visits only class types.
61    Executes pre for a class if all superclasses have been visited.
62    Then iterates to subclasses.  Executes post after return from
63    subclass.
64    Does not visit global type, frame types.
65 */
66 /* @@@ ?? something is wrong with this. */
67 void class_walk_super2sub(void (pre)(type*, void*),
68                           void (post)(type*, void*),
69                           void *env);
70
71
72 /* Walks over all entities in the type */
73 void walk_types_entities(type *tp,
74                          void (doit)(entity*, void*),
75                          void *env);
76 #endif /* _TYPEWALK_H_ */