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]

Re: Idea for export Implemnation


I am glade someone has actually thought about how to implement the
export keyword.  Do you think you will have something ready by egcs 1.2?

Jason Merrill wrote:
> 
> >>>>> Kevin Atkinson <kevinatk@home.com> writes:
> 
>  > Joe Buck wrote:
> 
> And then there's the question of how
> to handle inlines; the initial implementation probably won't inline
> anything in an exported template.

I always thought that inlines should ALWAYS go in the header files.  I
thought the export keyword was only for non-inline templates.  Am i
missing something here?

>  > Have a separate file the same name but different extensions that holds
>  > all the instantiations and visible by all users on the system.
> 
> Congratulations, you've just reinvented the template repository.  If you go
> that road, there's no reason to restrict it to libraries; the scheme Bjarne
> talks about in Design & Evolution of C++ involves adding to and checking
> the repository during compilation, so that the linker never has to get
> involved.  But we aren't going to do that, because it violates the
> principle of separate compilation.
>
> Rather, the plan is for the prelinker to extract the necessary information
> from the object files, run the compiler on that input, and link the
> resulting object file into the executable.  We could do this in either of
> two ways:
> 
> 1) Spit everything into one file, compile it, link it in.  Do this every
>    time.
> 2) Compile each instantiation separately.  Allow the user to specify where
>    to store these instantiation files.  Record dependency information so
>    they are only regenerated when the object files they depend on change.
> 
> Again, the initial implementation will probably go with #1 for simplicity.

Ok but what about libraries?  Will there be no shared template
instations
for libraries?


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