This is the mail archive of the
mailing list for the GCC project.
Re: [gnat] reuse of ASTs already constructed
- From: oliver dot kellogg at t-online dot de (Oliver Kellogg)
- To: gcc at gcc dot gnu dot org
- Date: Tue, 14 Apr 2009 12:31:21 +0200
- Subject: Re: [gnat] reuse of ASTs already constructed
- References: <firstname.lastname@example.org>
- Reply-to: okellogg at users dot sourceforge dot net
Apparently, calling compile_file() more than once has not been done
I am seeing many global variables in cgraphunit.c that need to
be reinitialized in this case.
Also, some static variables are defined locally in functions, e.g.
'first_analyzed' and 'first_analyzed_var' in cgraph_analyze_functions().
Those need to be pulled outside for reinitialization.
I am making the necessary changes and extending init_cgraph() as needed.
I hope my changes stand a chance for being integrated ;)
On 2009-04-12 at 19:29 +0200, Oliver Kellogg wrote:
> Picking up an old thread,
> On Tue, 4 Mar 2003, Geert Bosch <bosch at gnat dot com> wrote:
> > [...]
> > Best would be to first post a design overview,
> > before doing a lot of work in order to prevent spending time
> > on implementing something that may turn out to have fundamental
> > problems.
> I've done a little experimenting to get a feel for this.
> I've looked at the work done toward the GCC compile server but
> decided that I want to concentrate on GNAT trees (whereas the
> compile server targets the GNU trees.)
> Also I am aiming somewhat lower - not making a separate compile
> server process but rather extending gnat1 to handle multiple
> files in a single invocation.
> The current GNAT code makes a strong assumption that there be
> only one main unit, and this Main_Unit be located at index 0 of
> Lib.Units.Table (see procedure Lib.Load.Load_Main_Source).
> I am currently looking at having each main unit supplied on
> the gnat1 command line overwrite the Main_Unit in the Units table.
> What do you think of this approach?
> The attached patch sets the stage for passing multiple source
> files to a single gnat1 invocation. (Beware, this is a rough cut.
> Best use "svn diff --diff-cmd diff -x -uw" after applying as
> there are many changes that only affect indentation.)