aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/supergraph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/analyzer/supergraph.cc')
-rw-r--r--gcc/analyzer/supergraph.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index fd905ea..1dcc274 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -450,6 +450,8 @@ supernode::dump_dot (graphviz_out *gv, const dump_args_t &args) const
pp_string (pp, "<TABLE BORDER=\"0\">");
pp_write_text_to_stream (pp);
+ bool had_row = false;
+
if (m_returning_call)
{
gv->begin_tr ();
@@ -464,18 +466,22 @@ supernode::dump_dot (graphviz_out *gv, const dump_args_t &args) const
if (args.m_node_annotator)
args.m_node_annotator->add_stmt_annotations (gv, m_returning_call);
pp_newline (pp);
+
+ had_row = true;
}
if (entry_p ())
{
pp_string (pp, "<TR><TD>ENTRY</TD></TR>");
pp_newline (pp);
+ had_row = true;
}
if (return_p ())
{
pp_string (pp, "<TR><TD>EXIT</TD></TR>");
pp_newline (pp);
+ had_row = true;
}
/* Phi nodes. */
@@ -492,6 +498,7 @@ supernode::dump_dot (graphviz_out *gv, const dump_args_t &args) const
args.m_node_annotator->add_stmt_annotations (gv, stmt);
pp_newline (pp);
+ had_row = true;
}
/* Statements. */
@@ -508,6 +515,15 @@ supernode::dump_dot (graphviz_out *gv, const dump_args_t &args) const
args.m_node_annotator->add_stmt_annotations (gv, stmt);
pp_newline (pp);
+ had_row = true;
+ }
+
+ /* Graphviz requires a TABLE element to have at least one TR
+ (and each TR to have at least one TD). */
+ if (!had_row)
+ {
+ pp_string (pp, "<TR><TD>(empty)</TD></TR>");
+ pp_newline (pp);
}
pp_string (pp, "</TABLE>>];\n\n");