From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31004 invoked by alias); 23 May 2011 18:13:36 -0000 Received: (qmail 30990 invoked by uid 22791); 23 May 2011 18:13:35 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp-101-monday.noc.nerim.net (HELO mallaury.nerim.net) (62.4.17.101) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 May 2011 18:13:19 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by mallaury.nerim.net (Postfix) with ESMTPS id 4021D15341F; Mon, 23 May 2011 20:13:18 +0200 (CEST) Received: from glinka.lesours ([192.168.0.1]) by hector.lesours with smtp (Exim 4.76) (envelope-from ) id 1QOZcU-0004dG-1I; Mon, 23 May 2011 20:12:46 +0200 Date: Mon, 23 May 2011 20:55:00 -0000 From: Basile Starynkevitch To: Piervit , dnovillo@google.com Cc: gcc-patches@gcc.gnu.org, richard.guenther@gmail.com Subject: Re: external declaration of dominance debug functions Message-Id: <20110523201230.03ec2889.basile@starynkevitch.net> In-Reply-To: <20110523115632.5abb6956@zenwalk.local> References: <20110523103355.71528d09@zenwalk.local> <20110523115632.5abb6956@zenwalk.local> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-05/txt/msg01675.txt.bz2 On Mon, 23 May 2011 11:56:32 +0200 Piervit wrote: > Le Mon, 23 May 2011 11:30:34 +0200, > Richard Guenther a =E9crit : >=20 > > On Mon, May 23, 2011 at 10:33 AM, Piervit wrote: > > > Hello, > > > > > > Here is a two lines patch, allowing to use debug_dominance_info and > > > debug_dominance_tree functions outside of gcc/dominance.c. For the > > > moment, those functions are not declared in any gcc/*.h files (as > > > far as I know after trying a grep). I have added them as external > > > functions into gcc/basic-block.h. I feel this is useful to be able > > > to call those functions from others files, for exemple from plugins. > >=20 > > debug_* functions are supposed to be used from interactive gdb > > sessions. They should not be advertised in public headers. > >=20 > > Richard. > >=20 > > > ChangeLog: > > > > > > 2011-05-23 =A0Pierre Vittet =A0 > > > > > > =A0 =A0 =A0 =A0* basic-block.h (debug_dominance_info, debug_dominance= _tree): > > > =A0 =A0 =A0 =A0 =A0Add declaration. >=20 > Thank you for your answer. I am sorry I was not aware of this rule. > However I have try the following command in the gcc/ directory: >=20 > pierre@zenwalk gcc %grep " debug_*" *.h | wc -l > 231 >=20 > And the majority of the result are debug_* functions in header file, > such as extern void debug_tree (tree); in tree.h, extern void > debug_pass (void); in tree-pass.h and many others. I was expecting Richard Guenther to say no at first to any patch, especially when it is by a newbie. (Sorry Richie, but you do have your reputation). But I would like to hear the position of others (in particular Diego Novillo, who did long time ago accept a similar patch from my part). If really all debug_* functions are only for the ease of gdb, they should not be declared in public header files and should not be available to plugins. I believe on the contrary that plugin coders need much more than experienced GCC hackers some debug help, and that indeed the existing debug functions are helping them. So I don't buy Richie's argument. Otherwise, someone would propose a patch to remove the hundreds of debug_ declarations in public header files (i.e. those visible to plugins), and if he did, I hope such a naughty patch won't be accepted. As I told many many times, debug functions are mostly useful to newbies and to plugin developers. People (like Richie) working on GCC since the previous century don't need them. But people working on some plugins for a few months (or young newbies starting to work on GCC) will be desperate if these functions vanished. And these debug functions don't cost at all: they are never called in normal GCC executions! So I don't understand why declaring in a plugin header an existing debug function is such an issue. Hence, as Pierre's GSOC mentor, I told him to perservate on this patch and I hope it will be accepted some day!! GCC need more facilities for newbies & plugin developpers, not less! Regards. --=20 Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***