This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: issue with placing includes in gcc-plugin.h
- From: Richard Biener <rguenther at suse dot de>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: Andrew MacLeod <amacleod at redhat dot com>, Michael Collison <michael dot collison at linaro dot org>, Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>, gcc at gcc dot gnu dot org
- Date: Wed, 14 Jan 2015 10:07:36 +0100 (CET)
- Subject: Re: issue with placing includes in gcc-plugin.h
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMk2mX0rXipeWkkvWDV+vDL8StbfWMaGBCyZ=RKtvud3fw at mail dot gmail dot com>
On Wed, 14 Jan 2015, Prathamesh Kulkarni wrote:
> Hi,
> I am having an issue with placing includes of expr.h in gcc-plugin.h.
> rtl.h is required to be included before expr.h, so I put it in gcc-plugin.h.
> However the front-ends then fail to build because rtl.h is not allowed
> in front-ends,
> and the front-ends include gcc-plugin.h (via plugin.h).
>
> For instance ada/gcc-interface/misc.c failed to build with following error:
> In file included from ../../gcc/gcc/gcc-plugin.h:64:0,
> from ../../gcc/gcc/plugin.h:23,
> from ../../gcc/gcc/ada/gcc-interface/misc.c:53:
> ../../gcc/gcc/rtl.h:20:9: error: attempt to use poisoned "GCC_RTL_H"
>
> However rtl.h is required to be included before expr.h, so we cannot skip
> including rtl.h in gcc-plugin.h. How do we get around this ?
> As a temporary hack, could we #undef IN_GCC_FRONTEND in gcc-plugin.h ?
> java/builtins.c does this to include expr.h.
Err - obviously nothing in GCC itself should include gcc-plugin.h,
only plugins should. Do we tell plugins that they should include
plugin.h?! Why is the include in there?
I'd simply remove it....
Richard.
> Thank you,
> Prathamesh
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Jennifer Guild,
Dilip Upmanyu, Graham Norton HRB 21284 (AG Nuernberg)