irio: Also dump the frame types of irgs
authorMoritz Kroll <Moritz.Kroll@gmx.de>
Wed, 18 Feb 2009 00:26:48 +0000 (00:26 +0000)
committerMoritz Kroll <Moritz.Kroll@gmx.de>
Wed, 18 Feb 2009 00:26:48 +0000 (00:26 +0000)
[r25520]

include/libfirm/typerep.h
ir/ir/irio.c
ir/tr/typewalk.c

index ddb3170..5dbc3fb 100644 (file)
@@ -2559,6 +2559,12 @@ typedef void class_walk_func(ir_type *clss, void *env);
  *  Does not touch frame types or types for value params ... */
 void type_walk(type_walk_func *pre, type_walk_func *post, void *env);
 
+/** Touches every type, entity, and frame types in unspecified order.  If new
+ *  types/entities are created during the traversal these will
+ *  be visited, too.
+ *  Does not touch types for value params ... (??) */
+void type_walk_plus_frames(type_walk_func *pre, type_walk_func *post, void *env);
+
 /** Walks over all type information reachable from an ir graph.
  *
  *  Walks over all type information reachable from irg, i.e., starts a
index 54e9bf5..db01a36 100644 (file)
@@ -487,7 +487,7 @@ void ir_export(const char *filename)
 
        fputs("typegraph {\n", env.file);
 
-       type_walk(NULL, export_type_or_ent, &env);
+       type_walk_plus_frames(NULL, export_type_or_ent, &env);
        /* TODO: Visit frame types and "types for value params"? */
 
        for(i = 0; i < n_irgs; i++)
index 363fddb..1b64e9b 100644 (file)
@@ -276,6 +276,19 @@ void type_walk(type_walk_func *pre, type_walk_func *post, void *env) {
        do_type_walk(cont, pre, post, env);
 }
 
+void type_walk_plus_frames(type_walk_func *pre, type_walk_func *post, void *env) {
+       int i, n_irgs = get_irp_n_irgs();
+       type_or_ent cont;
+
+       type_walk(pre, post, env);
+
+       for (i = 0; i < n_irgs; ++i) {
+               ir_graph *irg = get_irp_irg(i);
+               cont.typ = get_irg_frame_type(irg);
+               do_type_walk(cont, pre, post, env);
+       }
+}
+
 void type_walk_irg(ir_graph *irg,
                    type_walk_func *pre,
                    type_walk_func *post,