This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Developing mixed-language code with fortran-dev and g++
Dear Nick,
> If you find any comprehensible documentation on C++ underlying concepts,
> and implementation assumptions, PLEASE tell me. ?I can tell you from
> certain knowledge that they have to be reverse engineered from between
> the lines of the standard. ?Even Bjarne's books are short on such detail,
> which isn't unreasonable, but it's a specialist need.
Thus challenged, I thought that I would give it a try!
I have found some references where I recognize what is described and,
I am glad to say, in the fortran-dev version of OOP, Janus and I have
even evolved to something fairly close to the C++ industry standard
ABI. I give a few references below.
Sod's Law would have us inverting the standard order of vptr and the
content of the base object; and so it has turned out! Also, our base
object content is pointed to, either in the form of a pointer or an
allocatable component.
The vtable implementation is also somewhat different but we could
converge; g++ has a pointer to unknown_function () and, as far as I
can tell, is padded out with nulls between the procedure pointers. We
also have no need for the four default methods for C++ and so,
obviously, they have not been implemented. In addition there is other
base information in the C++ vtable that we should review. Amongst
other things, we are still relying on a hash of the dynamic type name
and module to identify the type at runtime. We need to have a name
register and to use pointers to the entries or unique keys.
Finally, we should understand how g++ implements the initialization of
its vtables; otherwise we have a fairly complete toolkit to prepare
any implementation that we care to.
Janus and I can go a little bit further before we require some
decision making process on the details of OOP in gfortran.
Cheers
Paul
In no particular order:
http://en.wikipedia.org/wiki/Virtual_method_table
http://www.codesourcery.com/public/cxx-abi/cxx-vtable-ex.html
http://www.cse.wustl.edu/~mdeters/seminar/fall2005/mi.html#virtual
http://www.codesourcery.com/public/cxx-abi/abi.html#acknowledgements