1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
3 ** All rights reserved.
5 ** Author: Goetz Lindenmaier
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
16 /* walk over all type information reachable from the ir graph. */
21 # include "type_or_entity.h"
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
28 void type_walk(void (pre)(type_or_ent*, void*),
29 void (post)(type_or_ent*, void*),
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*),
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*),
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*),
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
64 Does not visit global type, frame types.
66 /* @@@ ?? something is wrong with this. */
67 void class_walk_super2sub(void (pre)(type*, void*),
68 void (post)(type*, void*),
72 /* Walks over all entities in the type */
73 void walk_types_entities(type *tp,
74 void (doit)(entity*, void*),
76 #endif /* _TYPEWALK_H_ */