From patchwork Wed Jun 1 06:05:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basile Starynkevitch X-Patchwork-Id: 98124 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8CB88B6F7D for ; Wed, 1 Jun 2011 16:06:05 +1000 (EST) Received: (qmail 18277 invoked by alias); 1 Jun 2011 06:06:02 -0000 Received: (qmail 18266 invoked by uid 22791); 1 Jun 2011 06:06:01 -0000 X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL, BAYES_50, RDNS_DYNAMIC, TVD_RCVD_IP X-Spam-Check-By: sourceware.org Received: from 195-14-0-142.nuxit.net (HELO de558.ispfr.net) (195.14.0.142) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Jun 2011 06:05:42 +0000 Received: from ours.starynkevitch.net ([213.41.244.95] helo=glinka.lesours) by de558.ispfr.net with smtp (Exim 4.72) (envelope-from ) id 1QReYm-0001V0-Rl; Wed, 01 Jun 2011 08:05:41 +0200 Date: Wed, 1 Jun 2011 08:05:40 +0200 From: Basile Starynkevitch To: Basile Starynkevitch Cc: gcc-patches@gcc.gnu.org Subject: Re: PATCH: adding invoking_program to plugin_gcc_version Message-Id: <20110601080540.27d8762b.basile@starynkevitch.net> In-Reply-To: <20110601075248.82672ce4.basile@starynkevitch.net> References: <20110601075248.82672ce4.basile@starynkevitch.net> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Wed, 1 Jun 2011 07:52:48 +0200 Basile Starynkevitch wrote: > > Hello All, > > The attached patch to trunk 174518 adds a field invoking_program to the > plugin_gcc_version structure. It informs the plugin about the program > "cc1", "cc1plus", "lto1" using them. Wrong patch, here is a better one ######### gcc/ChangeLog entry ########## 2011-06-01 Basile Starynkevitch * gcc-plugin.h (struct plugin_gcc_version): Add invoking_program field. * configure.ac: Ditto. * configure: Regenerate. * plugin.c (initialize_plugins): Set invoking_program. ######################################## Ok if it bootstraps? Cheers Index: gcc/configure =================================================================== --- gcc/configure (revision 174518) +++ gcc/configure (working copy) @@ -10977,7 +10977,9 @@ static char revision[] = "$gcc_REVISION"; static struct plugin_gcc_version gcc_version = {basever, datestamp, devphase, revision, - configuration_arguments}; + configuration_arguments, +/* Field invoking_program is set in general_init inside toplev.c. */ + NULL}; EOF # Internationalization @@ -17517,7 +17519,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17520 "configure" +#line 17522 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17623,7 +17625,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17626 "configure" +#line 17628 "configure" #include "confdefs.h" #if HAVE_DLFCN_H Index: gcc/configure.ac =================================================================== --- gcc/configure.ac (revision 174518) +++ gcc/configure.ac (working copy) @@ -1521,7 +1521,9 @@ static char revision[] = "$gcc_REVISION"; static struct plugin_gcc_version gcc_version = {basever, datestamp, devphase, revision, - configuration_arguments}; + configuration_arguments, +/* Field invoking_program is set in general_init inside toplev.c. */ + NULL}; EOF changequote([,])dnl Index: gcc/gcc-plugin.h =================================================================== --- gcc/gcc-plugin.h (revision 174518) +++ gcc/gcc-plugin.h (working copy) @@ -70,6 +70,8 @@ struct plugin_gcc_version const char *devphase; const char *revision; const char *configuration_arguments; + /* Short string like "cc1" or "lto1" giving the invoking program. */ + const char *invoking_program; }; /* Object that keeps track of the plugin name and its arguments. */ Index: gcc/plugin.c =================================================================== --- gcc/plugin.c (revision 174518) +++ gcc/plugin.c (working copy) @@ -632,6 +632,7 @@ initialize_plugins (void) timevar_push (TV_PLUGIN_INIT); #ifdef ENABLE_PLUGIN + gcc_version.invoking_program = progname; /* Traverse and initialize each plugin specified in the command-line. */ htab_traverse_noresize (plugin_name_args_tab, init_one_plugin, NULL); #endif