Convert comments to doxygen
[libfirm] / ir / tr / typewalk.h
1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2
3 * All rights reserved.
4 *
5 * Author: Goetz Lindenmaier
6 *
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
11 */
12
13 /* $Id$ */
14
15
16 /* walk over all type information reachable from the ir graph. */
17
18 #ifndef _TYPEWALK_H_
19 #define _TYPEWALK_H_
20
21 # include "type_or_entity.h"
22
23
24 typedef void (type_walk_func)(type_or_ent *, void *);
25 typedef void (class_walk_func)(type *, void *);
26
27 /**
28     Touches every type and entity in unspecified order.  If new
29     types/entities are created during the traversal these will
30     be visited, too. **/
31 void type_walk(type_walk_func *pre,
32                type_walk_func *post,
33                void *env);
34
35 /** walks over all type information reachable from irg **/
36 void type_walk_irg(ir_graph *irg,
37                    type_walk_func *pre,
38                    type_walk_func *post,
39                    void *env);
40
41 /**
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,
50                          type_walk_func *post,
51                          void *env);
52
53 /**
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,
60                      type_walk_func *post,
61                      void *env);
62
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
66    subclass.
67    Does not visit global type, frame types.
68 */
69 /* @@@ ?? something is wrong with this. */
70 void class_walk_super2sub(class_walk_func *pre,
71                           class_walk_func *post,
72                           void *env);
73
74
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,
79                          void *env);
80 #endif /* _TYPEWALK_H_ */