1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
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 typedef void (type_walk_func)(type_or_ent *, void *);
27 Touches every type and entity in unspecified order. If new
28 types/entities are created during the traversal these will
30 void type_walk(type_walk_func *pre,
34 /** walks over all type information reachable from irg **/
35 void type_walk_irg(ir_graph *irg,
41 Touches every class in specified order:
42 - first the super class
43 - second the class itself
44 - third the sub classes. If new classes are created
45 during the traversal these will be visited, too. **/
46 /** @@@ should be named class-walk **/
47 /* @@@ will be removed? */
48 void type_walk_super2sub(type_walk_func *pre,
53 Touches every class in specified order:
54 - first the super class
55 - second the class itself
56 If new classes are created during the traversal these
57 will be visited, too. **/
58 void type_walk_super(type_walk_func *pre,
62 /* Same as type_walk_super2sub, but visits only class types.
63 Executes pre for a class if all superclasses have been visited.
64 Then iterates to subclasses. Executes post after return from
66 Does not visit global type, frame types.
68 /* @@@ ?? something is wrong with this. */
69 void class_walk_super2sub(type_walk_func *pre,
74 /* Walks over all entities in the type */
75 typedef void (entity_walk_func)(entity *, void *);
76 void walk_types_entities(type *tp,
77 entity_walk_func *doit,
79 #endif /* _TYPEWALK_H_ */