[Patch, Fortran] [RFC] Reworking type-bound procedures

Daniel Kraft d@domob.eu
Thu Apr 23 17:49:00 GMT 2009


Hi Paul,

thanks for taking this patch on!

Paul Richard Thomas wrote:
>> Addressing these points and preparing for type-bound operators, I reworked
>> the type-bound procedures implementation; see the gfortran.h and
>> documentation changes for an overview.
>>
>> Most of the changes were simply mechanical after the changes to gfc_symtree
>> and gfc_namespace, but there were also some more delicate things to do.  For
>> instance, as now the tentative-symbol handling does no longer handle
>> type-bound procedures as well (which was in any case a more-or-less lucky
>> issue that it did so well at all!), I implemented my own list of tentative
>> TBP's and mark those dropped as erraneous, so that the compiler gets not
>> confused about them later.
> 
> You say that it was more or less lucky... really?  I think that it
> should work naturally, if the API is used correctly.  What is
> surprising to me is that it no longer works - why is that?

The main point here is that we used to call gfc_get_sym_tree for 
creating the TBP symtrees; this takes care of the tentative-symbol list, 
but creates the symtrees in sym_root (and creates ordinary gfc_symbol 
structures).  As we no longer want this to happen, I had to switch to 
gfc_new_symtree.  This is why it no longer works now and I had to 
implement a tentative list myself (without one, I get regressions 
because of dangling references to not-existing TBPs from TBPs not removed).

>> I believe that those changes are worthwhile and make the code cleaner and
>> more robust as well as make it easier to implement type-bound operators
>> based on this now.  But I would like to get some second opinions and fresh
>> thoughts!
>>
>> Currently running a regression-test on GNU/Linux-x86-32.  Ok for trunk if
>> successful?  Or should we go for fortran-dev instead first?
> 
> Did it regtest???? It looks OK for trunk to me.

It did.  I'm doing a fresh update and build/regtest now, and will commit 
if successful tomorrow (if there aren't any more comments).

Hopefully, I can then continue my work on typebound operators :)

Yours,
Daniel

-- 
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri



More information about the Gcc-patches mailing list