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]

Re: [pph] Debug Cleanup (issue4380046)


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.


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