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
4038a683
Commit
4038a683
authored
Aug 05, 2008
by
Michael Beck
Browse files
BugFix: map all anchored nodes of the called graph to nodes of the callers graph
[r20998]
parent
5fb7bd33
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/opt_inline.c
View file @
4038a683
...
...
@@ -852,6 +852,7 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
ir_entity
*
ent
;
ir_graph
*
rem
,
*
irg
;
irg_inline_property
prop
=
get_irg_inline_property
(
called_graph
);
unsigned
long
visited
;
if
(
prop
==
irg_inline_forbidden
)
return
0
;
...
...
@@ -995,17 +996,30 @@ int inline_method(ir_node *call, ir_graph *called_graph) {
set_irg_visited
(
irg
,
get_irg_visited
(
called_graph
)
+
1
);
if
(
get_irg_block_visited
(
irg
)
<
get_irg_block_visited
(
called_graph
))
set_irg_block_visited
(
irg
,
get_irg_block_visited
(
called_graph
));
visited
=
get_irg_visited
(
irg
);
/* Set pre_call as new Start node in link field of the start node of
calling graph and pre_calls block as new block for the start block
of calling graph.
Further mark these nodes so that they are not visited by the
copying. */
set_irn_link
(
get_irg_start
(
called_graph
),
pre_call
);
set_irn_visited
(
get_irg_start
(
called_graph
),
get_irg_
visited
(
irg
)
);
set_irn_visited
(
get_irg_start
(
called_graph
),
visited
);
set_irn_link
(
get_irg_start_block
(
called_graph
),
get_nodes_block
(
pre_call
));
set_irn_visited
(
get_irg_start_block
(
called_graph
),
get_irg_visited
(
irg
));
set_irn_link
(
get_irg_bad
(
called_graph
),
get_irg_bad
(
irg
));
set_irn_visited
(
get_irg_bad
(
called_graph
),
get_irg_visited
(
irg
));
set_irn_visited
(
get_irg_start_block
(
called_graph
),
visited
);
assert
(
get_irg_n_anchors
(
called_graph
)
==
get_irg_n_anchors
(
irg
));
for
(
i
=
get_irg_n_anchors
(
called_graph
)
-
1
;
i
>=
0
;
--
i
)
{
ir_node
*
anchor
=
get_irg_anchor
(
called_graph
,
i
);
if
(
get_irn_visited
(
anchor
)
>=
visited
)
{
/* already set above */
continue
;
}
set_irn_link
(
anchor
,
get_irg_anchor
(
irg
,
i
));
set_irn_visited
(
anchor
,
visited
);
}
/* Initialize for compaction of in arrays */
inc_irg_block_visited
(
irg
);
...
...
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