[OOP] SELECT TYPE with CLASS IS

Janus Weil janus@gcc.gnu.org
Sun Nov 8 13:09:00 GMT 2009


Hi folks,

here is an early shot at CLASS IS. As announced before, my
implementation uses the library function "is_extension_of" that I
introduced with the EXTENDS_TYPE_OF patch and translates the CLASS IS
cases into a chain of IF/ELSE IF statements (you can have a look at
the dump for the attached test case to see an example of the code it
generates). The patch is not quite complete yet, since CLASS IS cases
are not being sorted if they're in the wrong order. But apart from
this, most things should work already. In particular the following
cases:

 * SELECT TYPE statements with only one CLASS IS branch
 * those cases where the CLASS IS labels are not extensions of each other, or
 * cases where the CLASS IS labels are sorted in the right way
manually (i.e. extensions before their parents)

If anyone wants to try it out or have a look at the patch, that would
be great (the patch has to be applied to the fortran-dev branch, btw).
I'll try to get the sorting right soon.

Salvatore, do you have a version of your code which includes CLASS IS
cases? If yes, can you try the patch on it, or alternatively send your
code to me, so that I can try it? [Without the sorting, the runtime
behaviour can potentially be wrong, but hopefully there should be no
compile-time problems.]

Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class_is.diff
Type: text/x-diff
Size: 7020 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091108/2371856e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class_is.f90
Type: application/octet-stream
Size: 839 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20091108/2371856e/attachment.obj>


More information about the Fortran mailing list