From 6a775aaa1390c329226e37fb2f04b8b7ecbcf508 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Thu, 11 Nov 2004 12:24:52 +0000 Subject: [PATCH] fixes [r4374] --- ir/external/pseudo_irg.c | 5 ++++- ir/external/pseudo_irg.h | 5 +++-- ir/external/read.c | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ir/external/pseudo_irg.c b/ir/external/pseudo_irg.c index 7914d962f..87eac1549 100644 --- a/ir/external/pseudo_irg.c +++ b/ir/external/pseudo_irg.c @@ -9,15 +9,18 @@ /** Returns the number of pseudo graphs in the program. */ int get_irp_n_pseudo_irgs(void) { + assert (irp && irp->pseudo_graphs); return ARR_LEN(irp->pseudo_graphs); } /** Returns the number of pseudo graphs in the program. */ ir_graph *get_irp_pseudo_irg(int pos) { + assert(0 <= pos && pos <= get_irp_n_pseudo_irgs()); return irp->pseudo_graphs[pos]; } void add_irp_pseudo_irg(ir_graph *irg) { + assert (irp && irp->pseudo_graphs); ARR_APP1(ir_graph *, irp->pseudo_graphs, irg); } @@ -30,7 +33,7 @@ void add_irp_pseudo_irg(ir_graph *irg) { ir_graph * new_pseudo_ir_graph(entity *ent, int n_loc) { ir_graph *res = new_r_ir_graph (ent, n_loc); - add_irp_irg(res); /* remember this graph global. */ + add_irp_pseudo_irg(res); /* remember this graph global. */ return res; } diff --git a/ir/external/pseudo_irg.h b/ir/external/pseudo_irg.h index 2861a31f2..eb88836df 100644 --- a/ir/external/pseudo_irg.h +++ b/ir/external/pseudo_irg.h @@ -21,7 +21,8 @@ int get_irp_n_pseudo_irgs(void); ir_graph *get_irp_pseudo_irg(int pos); -/** If set, get_irp_n_irgs and get_irp_irg behave as if all - pseudo graphs are in the irg list. */ +/** If set, get_irp_n_irgs and get_irp_irg behave as if all pseudo + graphs are in the irg list. If not set, get_entity_irg returns + NULL if the entity refers to a pseudo irg. */ void set_visit_pseudo_irgs(int x); int get_visit_pseudo_irgs(void); diff --git a/ir/external/read.c b/ir/external/read.c index 652bebca9..780655bfa 100644 --- a/ir/external/read.c +++ b/ir/external/read.c @@ -1383,7 +1383,7 @@ static void create_abstract_firm(module_t *module, proc_t *proc, entity *fent) irg = new_pseudo_ir_graph(fent, 0); set_irg_inline_property(irg, irg_inline_forbidden); - /* If the spec says so: */ + /* @@@ If the spec says so: */ set_entity_visibility(fent, visibility_local); VERBOSE_PRINT((stdout, "create effects for %s\n", @@ -1649,6 +1649,9 @@ void free_abstraction(void) { /* * $Log$ + * Revision 1.16 2004/11/11 12:24:52 goetz + * fixes + * * Revision 1.15 2004/11/11 09:28:32 goetz * treat pseudo irgs special * parse 'local' from xml files -- 2.20.1