From: Moritz Kroll Date: Wed, 18 Feb 2009 00:26:48 +0000 (+0000) Subject: irio: Also dump the frame types of irgs X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=71ac39d709c0e8baef0fcda635f2708e43a1ac7e;p=libfirm irio: Also dump the frame types of irgs [r25520] --- diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index ddb31708a..5dbc3fb84 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -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 diff --git a/ir/ir/irio.c b/ir/ir/irio.c index 54e9bf560..db01a3655 100644 --- a/ir/ir/irio.c +++ b/ir/ir/irio.c @@ -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++) diff --git a/ir/tr/typewalk.c b/ir/tr/typewalk.c index 363fddbd6..1b64e9bde 100644 --- a/ir/tr/typewalk.c +++ b/ir/tr/typewalk.c @@ -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,