projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct comment: xvcg wants LF, not CR.
[libfirm]
/
ir
/
ir
/
irgwalk_blk.c
diff --git
a/ir/ir/irgwalk_blk.c
b/ir/ir/irgwalk_blk.c
index
b5d25f9
..
e42c681
100644
(file)
--- a/
ir/ir/irgwalk_blk.c
+++ b/
ir/ir/irgwalk_blk.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-20
08
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-20
11
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-21,7
+21,6
@@
* @file
* @brief Blockwise walker implementation
* @author Michael Beck
* @file
* @brief Blockwise walker implementation
* @author Michael Beck
- * @version $Id$
*/
#include "config.h"
*/
#include "config.h"
@@
-32,6
+31,7
@@
#include "irhooks.h"
#include "array.h"
#include "hashptr.h"
#include "irhooks.h"
#include "array.h"
#include "hashptr.h"
+#include "ircons.h"
#define _get_walk_arity(env, node) \
((env)->follow_deps ? get_irn_ins_or_deps((node)) : get_irn_arity((node)))
#define _get_walk_arity(env, node) \
((env)->follow_deps ? get_irn_ins_or_deps((node)) : get_irn_arity((node)))
@@
-64,8
+64,8
@@
typedef struct block_entry_t {
*/
static int addr_cmp(const void *elt, const void *key)
{
*/
static int addr_cmp(const void *elt, const void *key)
{
- const block_entry_t *e1 = elt;
- const block_entry_t *e2 = key;
+ const block_entry_t *e1 =
(const block_entry_t*)
elt;
+ const block_entry_t *e2 =
(const block_entry_t*)
key;
return e1->block != e2->block;
}
return e1->block != e2->block;
}
@@
-79,7
+79,7
@@
static block_entry_t *block_find_entry(ir_node *block, blk_collect_data_t *ctx)
block_entry_t *elem;
key.block = block;
block_entry_t *elem;
key.block = block;
- elem =
pset_find(ctx->blk_map, &key, HASH_PTR
(block));
+ elem =
(block_entry_t*)pset_find(ctx->blk_map, &key, hash_ptr
(block));
if (elem)
return elem;
if (elem)
return elem;
@@
-91,7
+91,7
@@
static block_entry_t *block_find_entry(ir_node *block, blk_collect_data_t *ctx)
elem->cf_list = NEW_ARR_F(ir_node *, 0);
elem->entry_list = NEW_ARR_F(ir_node *, 0);
elem->cf_list = NEW_ARR_F(ir_node *, 0);
elem->entry_list = NEW_ARR_F(ir_node *, 0);
- return
pset_insert(ctx->blk_map, elem, HASH_PTR
(block));
+ return
(block_entry_t*)pset_insert(ctx->blk_map, elem, hash_ptr
(block));
}
/**
}
/**
@@
-99,20
+99,20
@@
static block_entry_t *block_find_entry(ir_node *block, blk_collect_data_t *ctx)
*/
static void traverse_block_pre(ir_node *block, block_entry_t *entry, irg_walk_func *pre, void *env)
{
*/
static void traverse_block_pre(ir_node *block, block_entry_t *entry, irg_walk_func *pre, void *env)
{
-
in
t j;
+
size_
t j;
- for (j = ARR_LEN(entry->cf_list)
- 1; j >= 0; --j
) {
- ir_node *node = entry->cf_list[j];
+ for (j = ARR_LEN(entry->cf_list)
; j > 0;
) {
+ ir_node *node = entry->cf_list[
--
j];
pre(node, env);
}
pre(node, env);
}
- for (j = ARR_LEN(entry->df_list)
- 1; j >= 0; --j
) {
- ir_node *node = entry->df_list[j];
+ for (j = ARR_LEN(entry->df_list)
; j > 0;
) {
+ ir_node *node = entry->df_list[
--
j];
pre(node, env);
}
pre(node, env);
}
- for (j = ARR_LEN(entry->phi_list)
- 1; j >= 0; --j
) {
- ir_node *node = entry->phi_list[j];
+ for (j = ARR_LEN(entry->phi_list)
; j > 0;
) {
+ ir_node *node = entry->phi_list[
--
j];
pre(node, env);
}
pre(node, env);
}
@@
-125,7
+125,7
@@
static void traverse_block_pre(ir_node *block, block_entry_t *entry, irg_walk_fu
static void traverse_block_post(ir_node *block, block_entry_t *entry,
irg_walk_func *post, void *env)
{
static void traverse_block_post(ir_node *block, block_entry_t *entry,
irg_walk_func *post, void *env)
{
-
in
t j, n;
+
size_
t j, n;
post(block, env);
post(block, env);
@@
-150,10
+150,10
@@
static void traverse_block_post(ir_node *block, block_entry_t *entry,
*/
static void traverse_pre(blk_collect_data_t *blks, irg_walk_func *pre, void *env)
{
*/
static void traverse_pre(blk_collect_data_t *blks, irg_walk_func *pre, void *env)
{
-
in
t i;
+
size_
t i;
- for (i = ARR_LEN(blks->blk_list)
- 1; i >= 0; --i
) {
- ir_node *block = blks->blk_list[i];
+ for (i = ARR_LEN(blks->blk_list)
; i > 0;
) {
+ ir_node *block = blks->blk_list[
--
i];
block_entry_t *entry = block_find_entry(block, blks);
traverse_block_pre(block, entry, pre, env);
block_entry_t *entry = block_find_entry(block, blks);
traverse_block_pre(block, entry, pre, env);
@@
-170,7
+170,7
@@
static void traverse_pre(blk_collect_data_t *blks, irg_walk_func *pre, void *env
*/
static void traverse_post(blk_collect_data_t *blks, irg_walk_func *post, void *env)
{
*/
static void traverse_post(blk_collect_data_t *blks, irg_walk_func *post, void *env)
{
-
in
t i, k;
+
size_
t i, k;
for (i = 0, k = ARR_LEN(blks->blk_list); i < k; ++i) {
ir_node *block = blks->blk_list[i];
for (i = 0, k = ARR_LEN(blks->blk_list); i < k; ++i) {
ir_node *block = blks->blk_list[i];
@@
-190,10
+190,10
@@
static void traverse_post(blk_collect_data_t *blks, irg_walk_func *post, void *e
*/
static void traverse_both(blk_collect_data_t *blks, irg_walk_func *pre, irg_walk_func *post, void *env)
{
*/
static void traverse_both(blk_collect_data_t *blks, irg_walk_func *pre, irg_walk_func *post, void *env)
{
-
in
t i;
+
size_
t i;
- for (i = ARR_LEN(blks->blk_list)
- 1; i >= 0; --i
) {
- ir_node *block = blks->blk_list[i];
+ for (i = ARR_LEN(blks->blk_list)
; i > 0;
) {
+ ir_node *block = blks->blk_list[
--
i];
block_entry_t *entry = block_find_entry(block, blks);
traverse_block_pre(block, entry, pre, env);
block_entry_t *entry = block_find_entry(block, blks);
traverse_block_pre(block, entry, pre, env);
@@
-225,7
+225,7
@@
typedef struct dom_traversal_t {
*/
static void dom_block_visit_pre(ir_node *block, void *env)
{
*/
static void dom_block_visit_pre(ir_node *block, void *env)
{
- dom_traversal_t *ctx = env;
+ dom_traversal_t *ctx =
(dom_traversal_t*)
env;
block_entry_t *entry = block_find_entry(block, ctx->blks);
traverse_block_pre(block, entry, ctx->pre, ctx->env);
block_entry_t *entry = block_find_entry(block, ctx->blks);
traverse_block_pre(block, entry, ctx->pre, ctx->env);
@@
-236,7
+236,7
@@
static void dom_block_visit_pre(ir_node *block, void *env)
*/
static void dom_block_visit_post(ir_node *block, void *env)
{
*/
static void dom_block_visit_post(ir_node *block, void *env)
{
- dom_traversal_t *ctx = env;
+ dom_traversal_t *ctx =
(dom_traversal_t*)
env;
block_entry_t *entry = block_find_entry(block, ctx->blks);
traverse_block_post(block, entry, ctx->post, ctx->env);
block_entry_t *entry = block_find_entry(block, ctx->blks);
traverse_block_post(block, entry, ctx->post, ctx->env);
@@
-247,7
+247,7
@@
static void dom_block_visit_post(ir_node *block, void *env)
*/
static void dom_block_visit_both(ir_node *block, void *env)
{
*/
static void dom_block_visit_both(ir_node *block, void *env)
{
- dom_traversal_t *ctx = env;
+ dom_traversal_t *ctx =
(dom_traversal_t*)
env;
block_entry_t *entry = block_find_entry(block, ctx->blks);
traverse_block_pre(block, entry, ctx->pre, ctx->env);
block_entry_t *entry = block_find_entry(block, ctx->blks);
traverse_block_pre(block, entry, ctx->pre, ctx->env);
@@
-267,11
+267,11
@@
static void traverse_dom_blocks_top_down(blk_collect_data_t* blks, irg_walk_func
ctx.env = env;
if (pre != NULL && post != NULL)
ctx.env = env;
if (pre != NULL && post != NULL)
- dom_tree_walk_irg(current_ir_graph,
dom_block_visit_both, NULL, &ctx);
+ dom_tree_walk_irg(current_ir_graph, dom_block_visit_both, NULL, &ctx);
else if (pre != NULL)
else if (pre != NULL)
- dom_tree_walk_irg(current_ir_graph,
dom_block_visit_pre, NULL, &ctx);
+ dom_tree_walk_irg(current_ir_graph, dom_block_visit_pre, NULL, &ctx);
else if (post != NULL)
else if (post != NULL)
- dom_tree_walk_irg(current_ir_graph,
dom_block_visit_post, NULL, &ctx);
+ dom_tree_walk_irg(current_ir_graph, dom_block_visit_post, NULL, &ctx);
}
/**
}
/**
@@
-389,18
+389,18
@@
static void collect_blks_lists(ir_node *node, ir_node *block,
*/
static void collect_lists(blk_collect_data_t *env)
{
*/
static void collect_lists(blk_collect_data_t *env)
{
-
int
i, j;
+
size_t
i, j;
ir_node *block, *node;
block_entry_t *entry;
inc_irg_visited(current_ir_graph);
ir_node *block, *node;
block_entry_t *entry;
inc_irg_visited(current_ir_graph);
- for (i = ARR_LEN(env->blk_list)
- 1; i >= 0; --i
) {
- block = env->blk_list[i];
+ for (i = ARR_LEN(env->blk_list)
; i > 0;
) {
+ block = env->blk_list[
--
i];
entry = block_find_entry(block, env);
entry = block_find_entry(block, env);
- for (j = ARR_LEN(entry->entry_list)
- 1; j >= 0; --j
) {
- node = entry->entry_list[j];
+ for (j = ARR_LEN(entry->entry_list)
; j > 0;
) {
+ node = entry->entry_list[
--
j];
/* a entry might already be visited due to Phi loops */
if (node->visited < current_ir_graph->visited)
/* a entry might already be visited due to Phi loops */
if (node->visited < current_ir_graph->visited)
@@
-410,7
+410,7
@@
static void collect_lists(blk_collect_data_t *env)
}
/**
}
/**
- * Intra
proz
edural graph walker over blocks.
+ * Intra
proc
edural graph walker over blocks.
*/
static void do_irg_walk_blk(ir_graph *irg, irg_walk_func *pre,
irg_walk_func *post, void *env, unsigned follow_deps,
*/
static void do_irg_walk_blk(ir_graph *irg, irg_walk_func *pre,
irg_walk_func *post, void *env, unsigned follow_deps,