[PATCH 4/7] Support -fdebug-cpp option

Jakub Jelinek jakub@redhat.com
Mon Aug 22 15:22:00 GMT 2011


On Mon, Aug 22, 2011 at 08:16:45AM -0600, Tom Tromey wrote:
> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
> 
> Jakub> For ccache and friends I think it would be better to have a
> Jakub> preprocessing mode that would output all lines as is (i.e. no
> Jakub> macro replacement), except for processing #include/#include_next
> Jakub> directives.
> 
> That exists -- -fdirectives-only.

It isn't exactly what would be needed, as e.g. \\\n are removed from
from #defines and thus they get different location of the tokens.

BTW, I guess we should do something about parsing such an output,
we emit e.g.
# 1 "<stdin>"
# 1 "<built-in>"
#define __STDC__ 1
#define __STDC_HOSTED__ 1
#define __GNUC__ 4
#define __GNUC_MINOR__ 6
#define __GNUC_PATCHLEVEL__ 0
...

For <built-in> we really should assume line 0 for all the defines
in that "file".

	Jakub



More information about the Gcc-patches mailing list