do not include diagnostic-core.h in toplev.h

Manuel López-Ibáñez lopezibanez@gmail.com
Tue Jul 6 05:50:00 GMT 2010


This patch moves diagnostic-core.h out of toplev.h. Since toplev.h is
included everywhere, it would be an enormous work to check every file
to ensure which one is actually needed. Followup patches can
progressively remove either toplev.h or diagnostic-core.h (or
sometimes even both). Therefore, my patch just includes
diagnostic-core.h whenever toplev.h is included, except in a few
places where I removed the unused includes by hand before giving up.
In particular, the C/C++ frontends did not need to include additional
headers because diagnostic-core.h is included by c-common.h, c-tree.h
and cp-tree.h (Not sure whether this is correct but it was like this
before my patch).

Bootstrapped and regression tested on x86_64-linux-gnu.

OK?

2010-07-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* toplev.h: Do not include diagnostic-core.h.
	Include diagnostic-core.h in every file that includes toplev.h.
	* c-tree.h: Do not include toplev.h.

c-family/
	* c-common.h: Include diagnostic-core.h. Error if already
	included.
	* c-semantics.c: Do not define GCC_DIAG_STYLE here.
cp/
	* cp-tree.h: Do not include toplev.h.
	
java/
	* Include diagnostic-core.h in every file that includes toplev.h.
ada/
	* Include diagnostic-core.h in every file that includes toplev.h.
fortran/
	* Include diagnostic-core.h in every file that includes toplev.h.
lto/
	* Include diagnostic-core.h in every file that includes toplev.h.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toplev.diff
Type: text/x-diff
Size: 97701 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100706/588721eb/attachment.bin>


More information about the Gcc-patches mailing list