[cs] patch to re-use tag types

Per Bothner per@bothner.com
Mon Dec 1 07:02:00 GMT 2003


I checked the attached patch into the compile server.

This patch handle tag types such as 'struct foo'.
Suppose some fragment declares or defines 'struct foo', and
perhaps uses 'struct foo' in a declaration.  Now suppose a new
compilation refers to 'struct foo', but we haven't included
any old fragments that refer to 'struct foo'.  I.e. 'struct foo'
was references in a previous compilation unit, but we hav't seen
it yet in the current compilation union.  In that case we want to
re-use the same RECORD_TYPE for 'struct foo' that we already have.
This is because if we later re-use the fragment (form the previous
complation) that references 'struct foo' we want these to be the
same RECORD_TYPE.

A cleaner solution might be to use the C_DECL_INVISIBLE flag,
attached to the TYPE_STUB_DECL.  I might do that if I fix the
TYPE_STUB_DECL kludge, as I'm tempted to.

The patches also changes some functions to use the newtrack_declarations
and track_dependencies globals.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: save-tags.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20031201/3f006566/attachment.ksh>


More information about the Gcc-patches mailing list