[pph] Debug Cleanup (issue4380046)

Diego Novillo dnovillo@google.com
Mon Apr 11 13:01:00 GMT 2011


On Fri, Apr 8, 2011 at 22:00, Lawrence Crowl <crowl@google.com> wrote:

> Split pph_output_tree into pph_output_tree and pph_output_tree_aux.
> The former is the primary external interface, and pph_output_tree_aux
> is the internal (recursive) auxillary, which is used for function
> bodies.

Hm, why?  They both seem identical, except they check different tracing levels.

> 2011-04-08  Lawrence Crowl  <crowl@google.com>
>
>        * pph.c (*): Change use of flag_pph_debug to flag_pph_decls_debug
>        for declaration dependence analysis.
>        (pth_finish): Simplify inconsistency reporting.
>        * name-lookup.c (add_decl_to_level): Change use of flag_pph_debug to
>        flag_pph_decls_debug for declaration dependence analysis.
>        * parser.c (cp_parser_elaborated_type_specifier): Change use of
>        flag_pph_debug to flag_pph_decls_debug for declaration dependence
>        analysis.
>        * pph-streamer.h (pph_output_tree_aux): New.
>        (*): Compare flag_pph_tracer against value.
>        (pph_output_*): Ensure trace happens before write.
>        (pph_output_string_with_length): Add trace for null case.

Regexps in function names in a ChangeLog entry are not allowed.  Sorry :)

> --- 953,960 ----
>  C++ Var(flag_pph_stats)
>  -fpph-stats   Enable statistics gathering for PPH
>
> ! fpph-tracer=
> ! C++ Joined RejectNegative UInteger Var(flag_pph_tracer)
>  -fpph-tracer  Enable tracing of PPH streaming operations

Could you add what the different levels mean to the help text?

> --- 119,139 ----
>  /* Inline functions.  */
>
>  /* Output AST T to STREAM.  If REF_P is true, output all the leaves of T
> !    as references.  This function is the primary interface.  */
>  static inline void
>  pph_output_tree (pph_stream *stream, tree t, bool ref_p)
>  {
> !   if (flag_pph_tracer >= 1)
> !     pph_stream_trace_tree (stream, t);
> !   lto_output_tree (stream->ob, t, ref_p);
> ! }
> !
> ! /* Output AST T to STREAM.  If REF_P is true, output all the leaves of T
> !    as references.  this function is an internal auxillary routine.  */
> ! static inline void
> ! pph_output_tree_aux (pph_stream *stream, tree t, bool ref_p)
> ! {
> !   if (flag_pph_tracer >= 3)
>      pph_stream_trace_tree (stream, t);
>    lto_output_tree (stream->ob, t, ref_p);
>  }

Maybe just make the flag_pph_tracer level an argument to
pph_output_tree?  I guess that in the absence of default arg values,
there is no optimum solution here.


Diego.



More information about the Gcc-patches mailing list