This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unit at a time C++ again


> > The C++ standard says which classes/functions are instantiated based on
> > a particular input program, and our template instantiation model
> > dictates that you instantiate all of the needed ones in every
> > translation unit that needs them.
> 
> Hmm, I don't follow.  If C++ standard dicates what classes/functions are
> instantiated and we do exactly that, how exactly do you propose to
> change the current code?

I don't.  But I want to make sure that all of this instantiation takes
place before any heuristic decisions about inlining are made and before
decisions variable emission is done.

One reason for the latter is that sometimes, if you can do enough
optimization, you no longer need to emit the variables.

If we're going to unit-at-a-time, go all the way.  Wait until the entire
file is processed, all the templates are instantiated, etc., before
writing out *anything*.

> I was reffering to the following code:
> static void
> output_vtable_inherit (tree vars)
> {

I don't even know what that code does, I'm afraid. :-)

It's for some special stuff that tries to help the linker discard
unneeded vtables, I think.  It should be postponed until the vtable
actually gets emitted, via some kind of hook.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]