This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compiling multiple source files at once
Neil Booth <neil@daikokuya.demon.co.uk> writes:
> I imagine most of this benefit, possibly with less restrictions, could
> come from Geoff's precompiled header work (though he's never explained
> the details of how they're going to work).
Perhaps. But compiling N files in 1 invocation of cc1plus+as is
still likely to be faster than compiling N files in N invocations.
And you still have the problem with duplicate debug info.
> This would be easy to implement for the cpplib part of cc1, but I
> imagine being able to reset the state of the compiler proper would be
> much harder to guarantee, given all the static variables and other
> stuff it uses, and maybe not worth it.
There is no need to "re-set" the state of the compiler. You just have
a separate scope for global declarations and you create a new per-file
scope for static declarations. As I vaguely recall the compiler
already does use separate scopes for global and static.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/