From 660f709377ad5d9b9742e9c1bcc37a6f999715b3 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 16 Nov 2007 15:52:30 +0000 Subject: [PATCH] renamed cdep type to ir_cdep and placed it into firm_types.h [r16560] --- include/libfirm/cdep.h | 7 +++---- include/libfirm/firm_types.h | 1 + ir/ana/cdep.c | 20 ++++++++++---------- ir/opt/ifconv.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/libfirm/cdep.h b/include/libfirm/cdep.h index 88bf8023e..17335fe7b 100644 --- a/include/libfirm/cdep.h +++ b/include/libfirm/cdep.h @@ -31,10 +31,9 @@ /** * An entry in the control dependence list. */ -typedef struct cdep cdep; -struct cdep { +struct ir_cdep { ir_node *node; /**< A node on which the current block is control dependent on. */ - cdep *next; /**< Link to the next one if any. */ + ir_cdep *next; /**< Link to the next one if any. */ }; /** Compute the control dependence graph for a graph. */ @@ -46,7 +45,7 @@ void free_cdep(ir_graph *irg); /** * Return a list of all control dependences of a block. */ -cdep *find_cdep(const ir_node *block); +ir_cdep *find_cdep(const ir_node *block); void exchange_cdep(ir_node *old, const ir_node *nw); diff --git a/include/libfirm/firm_types.h b/include/libfirm/firm_types.h index 4749ddab7..f6e52cee7 100644 --- a/include/libfirm/firm_types.h +++ b/include/libfirm/firm_types.h @@ -64,6 +64,7 @@ typedef struct compound_graph_path compound_graph_path, *ir_compound_graph_path typedef struct _ir_phase ir_phase, *ir_phase_ptr; typedef struct _ir_extblk ir_extblk, *ir_extblk_ptr; typedef struct ir_exec_freq ir_exec_freq, *ir_exec_freq_ptr; +typedef struct ir_cdep ir_cdep, *ir_cdep_ptr; typedef struct sn_entry *seqno_t; typedef void irg_walk_func(ir_node *, void *); diff --git a/ir/ana/cdep.c b/ir/ana/cdep.c index 4070ca0a4..baea84b2d 100644 --- a/ir/ana/cdep.c +++ b/ir/ana/cdep.c @@ -37,7 +37,7 @@ static pmap *cdep_map; -cdep *find_cdep(const ir_node *block) +ir_cdep *find_cdep(const ir_node *block) { return pmap_get(cdep_map, (void *)block); } @@ -45,7 +45,7 @@ cdep *find_cdep(const ir_node *block) void exchange_cdep(ir_node *old, const ir_node *nw) { - cdep *cdep = find_cdep(nw); + ir_cdep *cdep = find_cdep(nw); pmap_insert(cdep_map, old, cdep); } @@ -53,19 +53,19 @@ void exchange_cdep(ir_node *old, const ir_node *nw) static void add_cdep(ir_node* node, ir_node* dep_on) { - cdep *dep = find_cdep(node); + ir_cdep *dep = find_cdep(node); #if 0 ir_fprintf(stderr, "Adding cdep of %+F on %+F\n", node, dep_on); #endif if (dep == NULL) { - cdep *newdep = xmalloc(sizeof(*newdep)); + ir_cdep *newdep = xmalloc(sizeof(*newdep)); newdep->node = dep_on; newdep->next = NULL; pmap_insert(cdep_map, node, newdep); } else { - cdep *newdep; + ir_cdep *newdep; for (;;) { if (dep->node == dep_on) return; @@ -121,7 +121,7 @@ static void cdep_pre(ir_node *node, void *ctx) */ static int cdep_edge_hook(FILE *F, ir_node *block) { - cdep *cd; + ir_cdep *cd; #if 0 ir_node *pdom = get_Block_ipostdom(block); @@ -190,7 +190,7 @@ void free_cdep(ir_graph *irg) int is_cdep_on(const ir_node *dependee, const ir_node *candidate) { - const cdep *dep; + const ir_cdep *dep; for (dep = find_cdep(dependee); dep != NULL; dep = dep->next) { if (dep->node == candidate) return 1; @@ -201,7 +201,7 @@ int is_cdep_on(const ir_node *dependee, const ir_node *candidate) int is_iterated_cdep_on(ir_node *dependee, ir_node *candidate) { - const cdep *dep; + const ir_cdep *dep; while ((dep = find_cdep(dependee)) != NULL) { if (dep->next != NULL) return 0; @@ -214,7 +214,7 @@ int is_iterated_cdep_on(ir_node *dependee, ir_node *candidate) ir_node *get_unique_cdep(const ir_node *block) { - cdep *cdep = find_cdep(block); + ir_cdep *cdep = find_cdep(block); return cdep != NULL && cdep->next == NULL ? cdep->node : NULL; } @@ -222,7 +222,7 @@ ir_node *get_unique_cdep(const ir_node *block) int has_multiple_cdep(const ir_node *block) { - cdep *cdep = find_cdep(block); + ir_cdep *cdep = find_cdep(block); return cdep != NULL && cdep->next != NULL; } diff --git a/ir/opt/ifconv.c b/ir/opt/ifconv.c index 7429b4de0..eea59d7d5 100644 --- a/ir/opt/ifconv.c +++ b/ir/opt/ifconv.c @@ -274,7 +274,7 @@ restart: arity = get_irn_arity(block); for (i = 0; i < arity; ++i) { ir_node* pred0; - cdep* cdep; + ir_cdep* cdep; pred0 = get_nodes_block(get_irn_n(block, i)); for (cdep = find_cdep(pred0); cdep != NULL; cdep = cdep->next) { -- 2.20.1