[ccache] Re: [PATCH] support caching of translation unit dumps

tridge at samba.org tridge at samba.org
Mon Jul 17 05:26:43 GMT 2006


Dan,

I'm currently looking at a way of generically supporting all of the
options like -fdump-translation-unit-all which generate auxillary data
files. As you may have noticed, I didn't incorporate your patch as I
thought that the ratio of complexity to utility was too high. The
problem is that gcc supports more than a dozen different auxillary
data files like .tu files, and if we try to support them all without a
general approach the ccache code will quickly become unreadable.

So instead, I'd like to have something like this:

static const char *auxillary_data[] = {
	"gcno",
	"tu",
	"class",
	"cgraph",
	"gimple",
	"cfg",
	"vcg",
	"ch",
	"ssa",
	"salias",
	"alias",
	"ccp",
	"storecpp",
	"pre",
	"mudflap",
	NULL
};

(I haven't put them all in, see the gcc docs for all the others).

This is actually pretty easy to add to ccache, except for one minor
problem - gcc isn't consistent in how it names these files between gcc
versions :-(

For example, with -fdump-translation-unit-all I get the following:

 gcc-3.3:  file.c.tu
 gcc-3.4:  file.c.tu
 gcc-4.0:  nothing??
 gcc-4.1:  file.c.t00.tu

it gets even sillier with things like -fdump-tree-all-all, which 
gives the following files with gcc-4.0:

 file.c.t02.original
 file.c.t03.generic
 file.c.t06.vcg
 file.c.t08.gimple
 file.c.t09.useless
 file.c.t11.lower
 file.c.t12.eh
 file.c.t13.cfg
 file.c.t14.oplower

and these with gcc-4.1:

 file.c.t00.tu
 file.c.t02.original
 file.c.t03.gimple
 file.c.t06.vcg
 file.c.t16.useless
 file.c.t18.lower
 file.c.t19.eh
 file.c.t20.cfg
 file.c.t21.cplxlower0
 file.c.t22.veclower
 file.c.t24.fixupcfg

So, I'm wondering if you or anyone else knows a way to get gcc to
produce saner file names? How the heck do we predict the t?? part of
the name?

If we can get that fixed, then I think it will be pretty easy to make
ccache correctly cache all of these auxillary files.

Cheers, Tridge


More information about the ccache mailing list