1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
8 * Traverse the type information.
10 * @author Goetz Lindenmaier
12 * The walker walks the whole ir graph
13 * to find the distinct type trees in the type graph forest.
14 * - execute the pre() function before recursion
15 * - execute the post() function after recursion
21 /* walk over all type information reachable from the ir graph. */
26 # include "type_or_entity.h"
29 * the type walk function
31 * @param tore points to the visited type or entity
32 * @param env free environment pointer
34 typedef void type_walk_func(type_or_ent *tore, void *env);
37 * the class walk function
39 * @param clss points to the visited class
40 * @param env free environment pointer
42 typedef void class_walk_func(type *clss, void *env);
45 Touches every type and entity in unspecified order. If new
46 types/entities are created during the traversal these will
48 void type_walk(type_walk_func *pre,
52 /** walks over all type information reachable from irg */
53 void type_walk_irg(ir_graph *irg,
59 Touches every class in specified order:
60 - first the super class
61 - second the class itself
62 - third the sub classes. If new classes are created
63 during the traversal these will be visited, too.
65 @todo should be named class-walk
67 @deprecated will be removed?
69 void type_walk_super2sub(type_walk_func *pre,
74 Touches every class in specified order:
75 - first the super class
76 - second the class itself
77 If new classes are created during the traversal these
78 will be visited, too. */
79 void type_walk_super(type_walk_func *pre,
83 /** Same as type_walk_super2sub, but visits only class types.
84 Executes pre for a class if all superclasses have been visited.
85 Then iterates to subclasses. Executes post after return from
87 Does not visit global type, frame types.
89 @bug ?? something is wrong with this.
91 void class_walk_super2sub(class_walk_func *pre,
92 class_walk_func *post,
96 * the entity walk function
98 * @param ent points to the visited entity
99 * @param env free environment pointer
101 typedef void entity_walk_func(entity *ent, void *env);
104 * Walks over all entities in the type.
107 * @param doit the entity walker function
108 * @param env environment, wil be passed to the walker function
110 void walk_types_entities(type *tp,
111 entity_walk_func *doit,
113 #endif /* _TYPEWALK_H_ */