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
c89e74c6
Commit
c89e74c6
authored
Jun 21, 2012
by
Matthias Braun
Browse files
iredges: introduce new reroute_edges_except
I expect this to be a common pattern
parent
8c9aa24a
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/libfirm/iredges.h
View file @
c89e74c6
...
...
@@ -161,6 +161,13 @@ FIRM_API void edges_deactivate_kind(ir_graph *irg, ir_edge_kind_t kind);
*/
FIRM_API
void
edges_reroute_kind
(
ir_node
*
old
,
ir_node
*
nw
,
ir_edge_kind_t
kind
);
/**
* reroutes (normal) edges from an old node to a new node, except for the
* @p exception which keeps its input even if it is old.
*/
FIRM_API
void
edges_reroute_except
(
ir_node
*
old
,
ir_node
*
nw
,
ir_node
*
exception
);
/**
* Verifies the out edges of graph @p irg.
* @return 1 if a problem was found, 0 otherwise
...
...
ir/ir/iredges.c
View file @
c89e74c6
...
...
@@ -657,6 +657,18 @@ void edges_reroute_kind(ir_node *from, ir_node *to, ir_edge_kind_t kind)
}
}
void
edges_reroute_except
(
ir_node
*
from
,
ir_node
*
to
,
ir_node
*
exception
)
{
const
ir_edge_t
*
edge
;
const
ir_edge_t
*
next
;
foreach_out_edge_safe
(
from
,
edge
,
next
)
{
ir_node
*
src
=
get_edge_src_irn
(
edge
);
if
(
src
==
exception
)
continue
;
set_irn_n
(
src
,
edge
->
pos
,
to
);
}
}
static
void
verify_set_presence
(
ir_node
*
irn
,
void
*
data
)
{
build_walker
*
w
=
(
build_walker
*
)
data
;
...
...
Write
Preview
Markdown
is supported
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