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 * the type walk function
26 * @param tore points to the visited type or entity
27 * @param env free environment pointer
29 typedef void type_walk_func(type_or_ent *tore, void *env);
32 * the class walk function
34 * @param clss points to the visited class
35 * @param env free environment pointer
37 typedef void class_walk_func(type *clss, void *env);
40 Touches every type and entity in unspecified order. If new
41 types/entities are created during the traversal these will
43 void type_walk(type_walk_func *pre,
47 /** walks over all type information reachable from irg */
48 void type_walk_irg(ir_graph *irg,
54 Touches every class in specified order:
55 - first the super class
56 - second the class itself
57 - third the sub classes. If new classes are created
58 during the traversal these will be visited, too.
60 @todo should be named class-walk
62 @deprecated will be removed?
64 void type_walk_super2sub(type_walk_func *pre,
69 Touches every class in specified order:
70 - first the super class
71 - second the class itself
72 If new classes are created during the traversal these
73 will be visited, too. */
74 void type_walk_super(type_walk_func *pre,
78 /** Same as type_walk_super2sub, but visits only class types.
79 Executes pre for a class if all superclasses have been visited.
80 Then iterates to subclasses. Executes post after return from
82 Does not visit global type, frame types.
84 @bug ?? something is wrong with this.
86 void class_walk_super2sub(class_walk_func *pre,
87 class_walk_func *post,
91 * the entity walk function
93 * @param ent points to the visited entity
94 * @param env free environment pointer
96 typedef void entity_walk_func(entity *ent, void *env);
99 * Walks over all entities in the type.
102 * @param doit the entity walker function
103 * @param env environment, wil be passed to the walker function
105 void walk_types_entities(type *tp,
106 entity_walk_func *doit,
108 #endif /* _TYPEWALK_H_ */