Hi Nikolai,

On 05/11/15 08:29, Nikolai Bozhenov wrote:
Hi!

The attached patch adds a procedure to dump the scheduler's dependency
graph into a dot file. The patch has been bootstrapped and regtested
on x86_64. Please commit if it is OK for trunk.

Thanks,
Nikolai

A couple of style nits.

+      // begin subgraph (basic block)
+      pp_printf (&pp, "subgraph cluster_block_%d {\n", bb);
+      pp_printf (&pp, "\t" "color=blue;" "\n");
+      pp_printf (&pp, "\t" "style=bold;" "\n");
+      pp_printf (&pp, "\t" "label=\"BB #%d\";\n", BB_TO_BLOCK (bb));
+
+      // setup head and tail (no support for EBBs)
+      gcc_assert (EBB_FIRST_BB (bb) == EBB_LAST_BB (bb));
+      get_ebb_head_tail (EBB_FIRST_BB (bb), EBB_LAST_BB (bb), &head, &tail);
+      tail = NEXT_INSN (tail);
+
+      // dump all insns
+      for (con = head; con != tail; con = NEXT_INSN (con))
+       {
+         if (!INSN_P (con))
+           continue;
+
+         // pretty print the insn
+         pp_printf (&pp, "\t%d [label=\"{", INSN_UID (con));

Please use C-style comments i.e. /**/ instead of //.
Also, throughout the comments leave two empty spaces after a full stop
i.e. /* <text>.  */.

You can use the check_GNU_style.sh script in the contrib/ directory on
your patches to highlight similar issues. For example:
$ ./contrib/check_GNU_style.sh ~/patches/dep-graph.patch

Dot, space, space, end of comment.
83:+/* Dump dependency graph for the current region to a file using dot syntax. 
*/
166:+/* Dump dependency graph for the current region to a file using dot 
syntax. */

Sentences should end with a dot.  Dot, space, space, end of the comment.
127:+      /* dump all deps */

Cheers,
Kyrill

Reply via email to