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 *);
25 typedef void (class_walk_func)(type *, void *);
28 Touches every type and entity in unspecified order. If new
29 types/entities are created during the traversal these will
31 void type_walk(type_walk_func *pre,
35 /** walks over all type information reachable from irg **/
36 void type_walk_irg(ir_graph *irg,
42 Touches every class in specified order:
43 - first the super class
44 - second the class itself
45 - third the sub classes. If new classes are created
46 during the traversal these will be visited, too. **/
47 /** @@@ should be named class-walk **/
48 /* @@@ will be removed? */
49 void type_walk_super2sub(type_walk_func *pre,
54 Touches every class in specified order:
55 - first the super class
56 - second the class itself
57 If new classes are created during the traversal these
58 will be visited, too. **/
59 void type_walk_super(type_walk_func *pre,
63 /* Same as type_walk_super2sub, but visits only class types.
64 Executes pre for a class if all superclasses have been visited.
65 Then iterates to subclasses. Executes post after return from
67 Does not visit global type, frame types.
69 /* @@@ ?? something is wrong with this. */
70 void class_walk_super2sub(class_walk_func *pre,
71 class_walk_func *post,
75 /* Walks over all entities in the type */
76 typedef void (entity_walk_func)(entity *, void *);
77 void walk_types_entities(type *tp,
78 entity_walk_func *doit,
80 #endif /* _TYPEWALK_H_ */