From 53c52b90fdec73541fbd6703442d0353a0dbaa94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Wed, 2 Feb 2005 14:21:29 +0000 Subject: [PATCH] relaxed checking for compound graph paht: the path can now also be built backwards. [r5013] --- ir/tr/entity.c | 3 +++ ir/tr/entity.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ir/tr/entity.c b/ir/tr/entity.c index a46ac029b..51fd0e63f 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -615,6 +615,9 @@ int is_proper_compound_graph_path(compound_graph_path *gr, int pos) { type *owner = gr->tp; for (i = 0; i <= pos; i++) { node = get_compound_graph_path_node(gr, i); + if (node == NULL) + /* Path not yet complete. */ + return true; if (get_entity_owner(node) != owner) return false; owner = get_entity_type(node); } diff --git a/ir/tr/entity.h b/ir/tr/entity.h index b6910eeb7..e0786146c 100644 --- a/ir/tr/entity.h +++ b/ir/tr/entity.h @@ -376,6 +376,10 @@ void set_compound_graph_path_node(compound_graph_path *gr, int pos, entity *n int get_compound_graph_path_array_index(compound_graph_path *gr, int pos); void set_compound_graph_path_array_index(compound_graph_path *gr, int pos, int index); +/** Checks wether the path up to pos is correct. If the path contains a NULL, + * assumes the path is not complete and returns 'true'. */ +int is_proper_compound_graph_path(compound_graph_path *gr, int pos); + /* A value of a compound entity is a pair of a value and the description of the corresponding access path to the member of the compound. */ void add_compound_ent_value_w_path(entity *ent, ir_node *val, compound_graph_path *path); -- 2.20.1