private components in module files

Andrew Benson abenson@carnegiescience.edu
Wed Oct 23 17:25:00 GMT 2019


On Wednesday, October 23, 2019 10:23:10 AM PDT Steve Kargl wrote:
> On Wed, Oct 23, 2019 at 09:56:54AM -0700, Andrew Benson wrote:
> > On Wednesday, October 23, 2019 9:23:15 AM PDT Steve Kargl wrote:
> > > On Wed, Oct 23, 2019 at 09:07:03AM -0700, Andrew Benson wrote:
> > > > I've been slowly trying to educate myself about the structure of
> > > > gfortran
> > > > module files, in the hope that I can eventually work on making some
> > > > improvements (I'm particularly interested in anything that would
> > > > reduce
> > > > the
> > > > file size or speed up parsing).
> > > > 
> > > > In module.c there's the following code:
> > > >    /* Note that components are always saved, even if they are supposed
> > > >    
> > > >      to be private.  Component access is checked during searching.  */
> > > >   
> > > >   mio_component_list (&sym->components, sym->attr.vtype);
> > > >   if (sym->components != NULL)
> > > >   
> > > >     sym->component_access
> > > >     
> > > >       = MIO_NAME (gfc_access) (sym->component_access, access_types);
> > > > 
> > > > Can anyone on this list help me understand why even private components
> > > > are
> > > > saved to the module file? After thinking about this for some time my
> > > > best
> > > > guess is that they might be needed by submodules which read this
> > > > module
> > > > file. Is that correct?
> 
> (a bunch removed to keep the emai short)
> 
> > > It appears the code you quoted came from revision 206759.
> > > 
> > > ------------------------------------------------------------------------
> > > r206759 | mikael | 2014-01-18 12:05:25 -0800 (Sat, 18 Jan 2014) | 19
> > > lines
> > > 
> > > AFAICT, submodule appeared after this commit.  I haven't seen a
> > > post from Mikael in sometime, so don't know if can clear up the
> > > need for this code.
> > 
> > Looking back through svn history I think this code is from even earlier.
> > Way back in revision 81764 I see:
> > 
> > /* Note that components are always saved, even if they are supposed
> > 
> >  	     to be private.  Component access is checked during searching.  */
> >  	  
> >  	  mio_component_list (&sym->components);
> > 
> > in module.c (lines 2683-2686). This revision log message was "Merge tree-
> > ssa-20020619-branch into mainline.".
> 
> In that case, you would need to ask Steven Bosscher and Paul Brook.
> Neither have contributed to gfortran in years if not a decade.
> 
> Tobias's explanation seems to be a logical reason.  There is always
> the option of removing the code, building gfortran, and running
> the testsuite.  Things will/should break if the info is required
> for the module.

Agreed - I'll find some time to try this next week and see if anything breaks.

-- 

* Andrew Benson: http://users.obs.carnegiescience.edu/abenson/contact.html

* Galacticus: https://github.com/galacticusorg/galacticus



More information about the Fortran mailing list