diff mbox

PATCH: adding invoking_program to plugin_gcc_version

Message ID 20110601075248.82672ce4.basile@starynkevitch.net
State New
Headers show

Commit Message

Basile Starynkevitch June 1, 2011, 5:52 a.m. UTC
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.

######### gcc/ChangeLog entry ##########
2011-06-01  Basile Starynkevitch  <basile@starynkevitch.net>

	* gcc-plugin.h (struct plugin_gcc_version): Add invoking_program field.

	* toplev.c (general_init): Fill invoking_program field of gcc_version.

	* configure.ac: Ditto.

	* configure: Regenerate.
########################################

See http://gcc.gnu.org/ml/gcc/2011-06/msg00000.html & 
http://gcc.gnu.org/ml/gcc/2011-05/msg00324.html for why I believe it is useful.

Ok for trunk?

Regards.
diff mbox

Patch

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/toplev.c
===================================================================
--- gcc/toplev.c	(revision 174518)
+++ gcc/toplev.c	(working copy)
@@ -1148,6 +1148,7 @@  general_init (const char *argv0)
     --p;
   progname = p;
 
+  gcc_version.invoking_program = progname;
   xmalloc_set_program_name (progname);
 
   hex_init ();
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. */