From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7674 invoked by alias); 11 Apr 2011 13:01:49 -0000 Received: (qmail 7666 invoked by uid 22791); 11 Apr 2011 13:01:48 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Apr 2011 13:01:42 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id p3BD1e9M010835 for ; Mon, 11 Apr 2011 06:01:40 -0700 Received: from gyb11 (gyb11.prod.google.com [10.243.49.75]) by wpaz5.hot.corp.google.com with ESMTP id p3BD1KSn001556 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 11 Apr 2011 06:01:39 -0700 Received: by gyb11 with SMTP id 11so3155867gyb.1 for ; Mon, 11 Apr 2011 06:01:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.114.6 with SMTP id m6mr4439733ybc.184.1302526898691; Mon, 11 Apr 2011 06:01:38 -0700 (PDT) Received: by 10.150.202.15 with HTTP; Mon, 11 Apr 2011 06:01:38 -0700 (PDT) In-Reply-To: <20110409020031.EBB9A222647@jade.mtv.corp.google.com> References: <20110409020031.EBB9A222647@jade.mtv.corp.google.com> Date: Mon, 11 Apr 2011 13:01:00 -0000 Message-ID: Subject: Re: [pph] Debug Cleanup (issue4380046) From: Diego Novillo To: Lawrence Crowl Cc: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00749.txt.bz2 On Fri, Apr 8, 2011 at 22:00, Lawrence Crowl 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 lev= els. > 2011-04-08 =C2=A0Lawrence Crowl =C2=A0 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0* pph.c (*): Change use of flag_pph_debug to f= lag_pph_decls_debug > =C2=A0 =C2=A0 =C2=A0 =C2=A0for declaration dependence analysis. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(pth_finish): Simplify inconsistency reporting. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* name-lookup.c (add_decl_to_level): Change us= e of flag_pph_debug to > =C2=A0 =C2=A0 =C2=A0 =C2=A0flag_pph_decls_debug for declaration dependenc= e analysis. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* parser.c (cp_parser_elaborated_type_specifie= r): Change use of > =C2=A0 =C2=A0 =C2=A0 =C2=A0flag_pph_debug to flag_pph_decls_debug for dec= laration dependence > =C2=A0 =C2=A0 =C2=A0 =C2=A0analysis. > =C2=A0 =C2=A0 =C2=A0 =C2=A0* pph-streamer.h (pph_output_tree_aux): New. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(*): Compare flag_pph_tracer against value. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(pph_output_*): Ensure trace happens before wr= ite. > =C2=A0 =C2=A0 =C2=A0 =C2=A0(pph_output_string_with_length): Add trace for= null case. Regexps in function names in a ChangeLog entry are not allowed. Sorry :) > --- 953,960 ---- > =C2=A0C++ Var(flag_pph_stats) > =C2=A0-fpph-stats =C2=A0 Enable statistics gathering for PPH > > ! fpph-tracer=3D > ! C++ Joined RejectNegative UInteger Var(flag_pph_tracer) > =C2=A0-fpph-tracer =C2=A0Enable tracing of PPH streaming operations Could you add what the different levels mean to the help text? > --- 119,139 ---- > =C2=A0/* Inline functions. =C2=A0*/ > > =C2=A0/* Output AST T to STREAM. =C2=A0If REF_P is true, output all the l= eaves of T > ! =C2=A0 =C2=A0as references. =C2=A0This function is the primary interfac= e. =C2=A0*/ > =C2=A0static inline void > =C2=A0pph_output_tree (pph_stream *stream, tree t, bool ref_p) > =C2=A0{ > ! =C2=A0 if (flag_pph_tracer >=3D 1) > ! =C2=A0 =C2=A0 pph_stream_trace_tree (stream, t); > ! =C2=A0 lto_output_tree (stream->ob, t, ref_p); > ! } > ! > ! /* Output AST T to STREAM. =C2=A0If REF_P is true, output all the leave= s of T > ! =C2=A0 =C2=A0as references. =C2=A0this function is an internal auxillar= y routine. =C2=A0*/ > ! static inline void > ! pph_output_tree_aux (pph_stream *stream, tree t, bool ref_p) > ! { > ! =C2=A0 if (flag_pph_tracer >=3D 3) > =C2=A0 =C2=A0 =C2=A0pph_stream_trace_tree (stream, t); > =C2=A0 =C2=A0lto_output_tree (stream->ob, t, ref_p); > =C2=A0} 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.