This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] CFG dump patch.


Does anyone have any objections to this patch? I find that the pred/succ
information makes it hard for me to look at large listings sometimes
because there is a lot of cruft that I dont normally care about in the
pred/succ chains.  All I did here was make the block print routine
summarize the pred/succ blocks when TDF_SLIM is passed as a flags.

So instead of seeing:
  # BLOCK 29
  # PRED: 27 [50.0%]  (false,exec) 26 [50.0%]  (false,exec) 24 [50.0%] 
(false,exec) 25 [100.0%]  (fallthru,exec) 28 [100.0%]  (fallthru,exec)

when I add 'slim', to the command line -fdump-tree-slim-...
I get:
  # BLOCK 29
  # PRED: 27 26 24 25 28

Which makes it much easier to find the other information I am interested
in.

Andrew


	* tree-pretty-print.c (dump_bb_header):  Allow TDF_SLIM printing.
	(dump_bb_end):  Allow TDF_SLIM printing.
	(dump_generic_bb_buff):  Add flags parameter to dump_bb_end.


Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-pretty-print.c,v
retrieving revision 1.1.2.70
diff -c -p -r1.1.2.70 tree-pretty-print.c
*** tree-pretty-print.c	19 Dec 2003 07:01:36 -0000	1.1.2.70
--- tree-pretty-print.c	5 Feb 2004 17:46:11 -0000
*************** dump_bb_header (pretty_printer *buffer, 
*** 2107,2113 ****
        pp_string (buffer, "# PRED:");
        pp_write_text_to_stream (buffer);
        for (e = bb->pred; e; e = e->pred_next)
! 	dump_edge_info (buffer->buffer->stream, e, 0);
        pp_newline (buffer);
      }
    else
--- 2107,2122 ----
        pp_string (buffer, "# PRED:");
        pp_write_text_to_stream (buffer);
        for (e = bb->pred; e; e = e->pred_next)
!         if (flags & TDF_SLIM)
! 	  {
! 	    pp_string (buffer, " ");
! 	    if (e->src == ENTRY_BLOCK_PTR)
! 	      pp_string (buffer, "ENTRY");
! 	    else
! 	      pp_decimal_int (buffer, e->src->index);
! 	  }
! 	else
! 	  dump_edge_info (buffer->buffer->stream, e, 0);
        pp_newline (buffer);
      }
    else
*************** dump_bb_header (pretty_printer *buffer, 
*** 2128,2134 ****
     spaces.  */
  
  static void
! dump_bb_end (pretty_printer *buffer, basic_block bb, int indent)
  {
    edge e;
  
--- 2137,2143 ----
     spaces.  */
  
  static void
! dump_bb_end (pretty_printer *buffer, basic_block bb, int indent, int flags)
  {
    edge e;
  
*************** dump_bb_end (pretty_printer *buffer, bas
*** 2136,2142 ****
    pp_string (buffer, "# SUCC:");
    pp_write_text_to_stream (buffer);
    for (e = bb->succ; e; e = e->succ_next)
!     dump_edge_info (buffer->buffer->stream, e, 1);
    pp_newline (buffer);
  }
  
--- 2145,2160 ----
    pp_string (buffer, "# SUCC:");
    pp_write_text_to_stream (buffer);
    for (e = bb->succ; e; e = e->succ_next)
!     if (flags & TDF_SLIM)
!       {
! 	pp_string (buffer, " ");
! 	if (e->dest == EXIT_BLOCK_PTR)
! 	  pp_string (buffer, "EXIT");
! 	else
! 	  pp_decimal_int (buffer, e->dest->index);
!       }
!     else
!       dump_edge_info (buffer->buffer->stream, e, 1);
    pp_newline (buffer);
  }
  
*************** dump_generic_bb_buff (pretty_printer *bu
*** 2239,2243 ****
    dump_implicit_edges (buffer, bb, indent);
  
    if (flags & TDF_BLOCKS)
!     dump_bb_end (buffer, bb, indent);
  }
--- 2257,2261 ----
    dump_implicit_edges (buffer, bb, indent);
  
    if (flags & TDF_BLOCKS)
!     dump_bb_end (buffer, bb, indent, flags);
  }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]