Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
8572a6c5
Commit
8572a6c5
authored
May 13, 2016
by
yb9976
Browse files
Use appropriate macros for iterating over out edges
parent
a8583be0
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/libfirm/iredges.h
View file @
8572a6c5
...
...
@@ -99,6 +99,11 @@ FIRM_API const ir_edge_t *get_irn_out_edge_next(const ir_node *irn,
*/
#define foreach_block_succ(bl, edge) foreach_out_edge_kind(bl, edge, EDGE_KIND_BLOCK)
/**
* A convenience iteration macro for all control flow edges.
*/
#define foreach_block_succ_safe(bl, edge) foreach_out_edge_kind_safe(bl, edge, EDGE_KIND_BLOCK)
/**
* Returns the source node of an edge.
* @param edge The edge.
...
...
ir/be/bestack.c
View file @
8572a6c5
...
...
@@ -78,7 +78,7 @@ static void process_stack_bias(sp_sim_func const sim, ir_node *const block,
}
/* Continue at our control flow successors. */
foreach_
out_edge_kind
(
block
,
edge
,
EDGE_KIND_BLOCK
)
{
foreach_
block_succ
(
block
,
edge
)
{
ir_node
*
succ
=
get_edge_src_irn
(
edge
);
process_stack_bias
(
sim
,
succ
,
p2align
,
misalign
,
state
.
offset
,
state
.
align_padding
);
...
...
ir/ir/iredges.c
View file @
8572a6c5
...
...
@@ -351,7 +351,7 @@ void edges_notify_edge(ir_node *src, int pos, ir_node *tgt, ir_node *old_tgt,
}
else
if
(
get_irn_mode
(
src
)
==
mode_X
&&
old_tgt
!=
NULL
&&
pos
==
-
1
)
{
assert
(
is_Block
(
old_tgt
));
/* moving a jump node from one block to another */
foreach_
out_edge_kind
_safe
(
old_tgt
,
edge
,
EDGE_KIND_BLOCK
)
{
foreach_
block_succ
_safe
(
old_tgt
,
edge
)
{
ir_node
*
succ
=
get_edge_src_irn
(
edge
);
int
succ_pos
=
get_edge_src_pos
(
edge
);
ir_node
*
block_pred
=
get_Block_cfgpred
(
succ
,
succ_pos
);
...
...
@@ -831,7 +831,7 @@ static void irg_walk_edges2(ir_node *node, irg_walk_func *pre,
if
(
pre
!=
NULL
)
pre
(
node
,
env
);
foreach_out_edge_
kind_
safe
(
node
,
edge
,
EDGE_KIND_NORMAL
)
{
foreach_out_edge_safe
(
node
,
edge
)
{
/* find the corresponding successor block. */
ir_node
*
pred
=
get_edge_src_irn
(
edge
);
assert
(
pred
!=
NULL
&&
"edge deleted while iterating?"
);
...
...
@@ -867,7 +867,7 @@ static void irg_block_edges_walk2(ir_node *bl, irg_walk_func *pre,
if
(
pre
)
pre
(
bl
,
env
);
foreach_
out_edge_kind
_safe
(
bl
,
edge
,
EDGE_KIND_BLOCK
)
{
foreach_
block_succ
_safe
(
bl
,
edge
)
{
/* find the corresponding successor block. */
ir_node
*
pred
=
get_edge_src_irn
(
edge
);
irg_block_edges_walk2
(
pred
,
pre
,
post
,
env
);
...
...
ir/opt/loop.c
View file @
8572a6c5
...
...
@@ -263,7 +263,7 @@ count:
unsigned
outs_n
=
0
;
/* Count innerloop branches */
foreach_
out_edge_kind
(
node
,
edge
,
EDGE_KIND_BLOCK
)
{
foreach_
block_succ
(
node
,
edge
)
{
ir_node
*
succ
=
get_edge_src_irn
(
edge
);
if
(
is_Block
(
succ
)
&&
is_in_loop
(
succ
))
++
outs_n
;
...
...
@@ -817,7 +817,7 @@ static void find_condition_chain(ir_node *const block)
/* Get node count */
unsigned
nodes_n
=
0
;
foreach_out_edge
_kind
(
block
,
edge
,
EDGE_KIND_NORMAL
)
{
foreach_out_edge
(
block
,
edge
)
{
++
nodes_n
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment