Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
f004ad9a
Commit
f004ad9a
authored
Feb 20, 2013
by
Matthias Braun
Browse files
iredges: fix incorrect usage of visited flags in build walkers
Also simplified the code.
parent
01bea684
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iredges.c
View file @
f004ad9a
...
...
@@ -486,29 +486,6 @@ static void init_lh_walker_dep(ir_node *irn, void *data)
}
}
typedef
struct
visitor_info_t
{
irg_walk_func
*
visit
;
void
*
data
;
}
visitor_info_t
;
/**
* Visitor: initializes the list-heads and set the out-count
* of all nodes to 0 of nodes that are not seen so far.
*/
static
void
visitor
(
ir_node
*
irn
,
void
*
data
)
{
visitor_info_t
*
info
=
(
visitor_info_t
*
)
data
;
if
(
is_Deleted
(
irn
))
return
;
if
(
!
is_Block
(
irn
)
&&
is_Deleted
(
get_nodes_block
(
irn
)))
return
;
if
(
!
irn_visited_else_mark
(
irn
))
{
info
->
visit
(
irn
,
info
->
data
);
}
}
void
edges_activate_kind
(
ir_graph
*
irg
,
ir_edge_kind_t
kind
)
{
/*
...
...
@@ -535,12 +512,9 @@ void edges_activate_kind(ir_graph *irg, ir_edge_kind_t kind)
*/
struct
build_walker
w
;
irg_edge_info_t
*
info
=
get_irg_edge_info
(
irg
,
kind
);
visitor_info_t
visit
;
w
.
kind
=
kind
;
visit
.
data
=
&
w
;
assert
(
!
info
->
activated
);
info
->
activated
=
1
;
...
...
@@ -548,12 +522,13 @@ void edges_activate_kind(ir_graph *irg, ir_edge_kind_t kind)
if
(
kind
==
EDGE_KIND_DEP
)
{
irg_walk_anchors
(
irg
,
init_lh_walker_dep
,
NULL
,
&
w
);
/* Argh: Dep nodes might be dead, so we MUST visit identities first */
visit
.
visit
=
init_lh_walker_dep
;
visit_all_identities
(
irg
,
visitor
,
&
visit
);
visit_all_identities
(
irg
,
init_lh_walker_dep
,
&
w
);
irg_walk_anchors
(
irg
,
NULL
,
build_edges_walker
,
&
w
);
}
else
if
(
kind
==
EDGE_KIND_BLOCK
)
{
visit_all_identities
(
irg
,
init_lh_walker
,
&
w
);
irg_block_walk_graph
(
irg
,
init_lh_walker
,
build_edges_walker
,
&
w
);
}
else
{
visit
.
visit
=
init_lh_walker
;
visit_all_identities
(
irg
,
visitor
,
&
visit
);
visit_all_identities
(
irg
,
init_lh_walker
,
&
w
);
irg_walk_anchors
(
irg
,
init_lh_walker
,
build_edges_walker
,
&
w
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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