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]

plugins & PCH are incompatible ...


Hello All,

In my perception, plugins and precompiled headers generation are incompatible, since when the generated PCH would be reloaded, the plugins might not be available or similar enough.

Or is there already some mechanism avoiding (or at least checking reliably) PCH generation with plugins?

The small attached patch to trunk rev 146887 (bootstrapped for C on x86_64-linux-gnu) issues an error message when plugins are used while asking for a PCH file to be written.

Changelog:
2009-04-28  Basile Starynkevitch  <basile@starynkevitch.net>
   * plugin.c: Added include of "c-common.h" for pch_file.
   (initialize_plugins): Issue an error when generating PCH.

Ok for trunk?

Regards.

--
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

Index: gcc/plugin.c
===================================================================
--- gcc/plugin.c	(revision 146887)
+++ gcc/plugin.c	(working copy)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "toplev.h"
 #include "tree.h"
+#include "c-common.h"
 #include "tree-pass.h"
 #include "intl.h"
 #include "plugin.h"
@@ -644,6 +645,11 @@ initialize_plugins (void)
   timevar_push (TV_PLUGIN_INIT);
  
 #ifdef ENABLE_PLUGIN
+  /* plugins are incompatible with precompiled headers, because at PCH
+     reload time the plugins might not be available or similar enough. */
+  if (pch_file) 
+    error ("Plugins are incompatible with precompiled headers");
+
   /* Traverse and initialize each plugin specified in the command-line.  */
   htab_traverse_noresize (plugin_name_args_tab, init_one_plugin, NULL);
 #endif

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