On Fri, 23 Oct 2020, Xiong Hu Luo wrote:

> Sometimes debug_bb_slim&debug_bb_n_slim is not enough, how about adding
> this debug_bb_details&debug_bb_n_details? Or any other similar call
> existed?

There's already debug_bb and debug_bb_n in cfg.c which works on both
RTL and GIMPLE.  How about instead adding overloads that accept
a flags argument so you can do

debug_bb_n (5, TDF_DETAILS)

?  The debug_bb_slim variant would then just a forwarder.

> gcc/ChangeLog:
> 
> 2020-10-23  Xionghu Luo  <luo...@linux.ibm.com>
> 
>       * print-rtl.c (debug_bb_details): New function.
>       * (debug_bb_n_details): New function.
> ---
>  gcc/print-rtl.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
> index 25265efc71b..f45873b8863 100644
> --- a/gcc/print-rtl.c
> +++ b/gcc/print-rtl.c
> @@ -2150,6 +2150,21 @@ debug_bb_n_slim (int n)
>    debug_bb_slim (bb);
>  }
>  
> +extern void debug_bb_details (basic_block);
> +DEBUG_FUNCTION void
> +debug_bb_details (basic_block bb)
> +{
> +  dump_bb (stderr, bb, 0, TDF_DETAILS | TDF_BLOCKS);
> +}
> +
> +extern void debug_bb_n_details (int);
> +DEBUG_FUNCTION void
> +debug_bb_n_details (int n)
> +{
> +  basic_block bb = BASIC_BLOCK_FOR_FN (cfun, n);
> +  debug_bb_details (bb);
> +}
> +
>  #endif
>  
>  #if __GNUC__ >= 10
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imend

Reply via email to