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 an ir graph.
54 * Walks over all type information reachable from irg, i.e., starts a
55 * type walk at the irgs entity, the irgs frame type and all types and
56 * entities that are attributes to firm nodes. */
57 void type_walk_irg(ir_graph *irg,
63 Touches every class in specified order:
64 - first the super class
65 - second the class itself
66 - third the sub classes. If new classes are created
67 during the traversal these will be visited, too.
69 @todo should be named class-walk
71 @deprecated will be removed?
73 void type_walk_super2sub(type_walk_func *pre,
78 Touches every class in specified order:
79 - first the super class
80 - second the class itself
81 If new classes are created during the traversal these
82 will be visited, too. */
83 void type_walk_super(type_walk_func *pre,
87 /** Same as type_walk_super2sub, but visits only class types.
88 Executes pre for a class if all superclasses have been visited.
89 Then iterates to subclasses. Executes post after return from
91 Does not visit global type, frame types.
93 @bug ?? something is wrong with this.
95 void class_walk_super2sub(class_walk_func *pre,
96 class_walk_func *post,
100 * the entity walk function
102 * @param ent points to the visited entity
103 * @param env free environment pointer
105 typedef void entity_walk_func(entity *ent, void *env);
108 * Walks over all entities in the type.
111 * @param doit the entity walker function
112 * @param env environment, wil be passed to the walker function
114 void walk_types_entities(type *tp,
115 entity_walk_func *doit,
117 #endif /* _TYPEWALK_H_ */