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
e3065a30
Commit
e3065a30
authored
May 06, 2011
by
Matthias Braun
Browse files
fix cfg_dumper omitting bads
parent
a14af9db
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/irdump.c
View file @
e3065a30
...
...
@@ -2329,9 +2329,13 @@ void dump_ir_graph_file(FILE *out, ir_graph *irg)
static
void
dump_block_to_cfg
(
ir_node
*
block
,
void
*
env
)
{
FILE
*
F
=
(
FILE
*
)
env
;
int
i
,
fl
=
0
;
int
i
;
ir_node
*
pred
;
if
(
is_Bad
(
block
)
&&
get_irn_mode
(
block
)
==
mode_X
)
{
dump_node
(
F
,
block
);
}
if
(
is_Block
(
block
))
{
/* This is a block. Dump a node for the block. */
fprintf
(
F
,
"node: {title:
\"
"
);
PRINT_NODEID
(
block
);
...
...
@@ -2349,30 +2353,25 @@ static void dump_block_to_cfg(ir_node *block, void *env)
/* the generic version. */
dump_irnode_to_file
(
F
,
block
);
/* Check whether we have bad predecessors to color the block. */
for
(
i
=
get_Block_n_cfgpreds
(
block
)
-
1
;
i
>=
0
;
--
i
)
if
((
fl
=
is_Bad
(
get_Block_cfgpred
(
block
,
i
))))
break
;
fprintf
(
F
,
"
\"
"
);
/* closing quote of info */
if
((
block
==
get_irg_start_block
(
get_irn_irg
(
block
)))
||
(
block
==
get_irg_end_block
(
get_irn_irg
(
block
)))
)
fprintf
(
F
,
" color:blue "
);
else
if
(
fl
)
fprintf
(
F
,
" color:yellow "
);
fprintf
(
F
,
"}
\n
"
);
/* Dump the edges */
for
(
i
=
get_Block_n_cfgpreds
(
block
)
-
1
;
i
>=
0
;
--
i
)
if
(
!
is_Bad
(
skip_Proj
(
get_Block_cfgpred
(
block
,
i
))))
{
pred
=
get_nodes_block
(
skip_Proj
(
get_Block_cfgpred
(
block
,
i
)));
fprintf
(
F
,
"edge: { sourcename:
\"
"
);
PRINT_NODEID
(
block
);
fprintf
(
F
,
"
\"
targetname:
\"
"
);
PRINT_NODEID
(
pred
);
fprintf
(
F
,
"
\"
}
\n
"
);
}
for
(
i
=
get_Block_n_cfgpreds
(
block
)
-
1
;
i
>=
0
;
--
i
)
{
ir_node
*
pred
=
get_Block_cfgpred
(
block
,
i
);
if
(
!
is_Bad
(
pred
))
pred
=
get_nodes_block
(
pred
);
fprintf
(
F
,
"edge: { sourcename:
\"
"
);
PRINT_NODEID
(
block
);
fprintf
(
F
,
"
\"
targetname:
\"
"
);
PRINT_NODEID
(
pred
);
fprintf
(
F
,
"
\"
}
\n
"
);
}
/* Dump dominator/postdominator edge */
if
(
ir_get_dump_flags
()
&
ir_dump_flag_dominance
)
{
...
...
@@ -2401,8 +2400,7 @@ void dump_cfg(FILE *F, ir_graph *irg)
dump_vcg_header
(
F
,
get_irg_dump_name
(
irg
),
NULL
,
NULL
);
/* walk over the blocks in the graph */
irg_block_walk
(
get_irg_end
(
irg
),
dump_block_to_cfg
,
NULL
,
F
);
/* dump_node(F, get_irg_bad(irg)); */
irg_walk_graph
(
irg
,
dump_block_to_cfg
,
NULL
,
F
);
dump_vcg_footer
(
F
);
}
...
...
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