This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Don't require -DIN_GCC while compiling plugins
On Wed, May 27, 2009 at 08:05, Rafael Espindola <firstname.lastname@example.org> wrote:
>> OK with gcc-plugin.h including config.h and system.h.
> I will commit the attached patch once the tests finish
> I think it is
> an improvement over the current status, but I still think that we
> would be better with a simpler gcc-plugin.h.
I'm confused. You seem to be arguing two different positions. When
we chatted about creating a single include file for plugin headers,
you argued that plugin writers should actually learn to deal with the
multitude of include files needed for GCC development. This way, if
the plugin is one day converted to a regular pass, all the header
files are there. That's a reasonable point.
OTOH, you argue for a simpler gcc-plugin.h because including config.h
and system.h before gcc-plugin.h adds extra burden to the plugin
developer. That contradicts your view that plugins should be exposed
to the same environment as regular passes. The two files config.h and
system.h are always needed first because they affect many fundamental
symbols and types (like 'bool').
I find both approaches equally good. Either make gcc-plugin.h include
config.h and system.h or document that config.h and system.h should
always be included first.
It could be argued that by creating a single include file, regular
passes could migrate to do what plugins do. But I see the value of
not having huge all-encompassing header files.
Whether we should move to a single header file model is another shed
that we can paint at the summit in a few days, I guess.