[patch,fortran] Revamp type enumerators

Thomas Koenig tkoenig@netcologne.de
Sun Oct 17 14:03:00 GMT 2010


Hi Jerry,

> +/* Basic types.  BT_VOID is used by ISO C Binding so funcs like
> c_f_pointer
> +   can take any arg with the pointer attribute as a param.  These are
> also
> +   used in the run-time library for IO.  */
>  typedef enum
> -{
> -  GFC_DTYPE_UNKNOWN = 0,
> -  GFC_DTYPE_INTEGER,
> -  /* TODO: recognize logical types.  */
> -  GFC_DTYPE_LOGICAL,
> -  GFC_DTYPE_REAL,
> -  GFC_DTYPE_COMPLEX,
> -  GFC_DTYPE_DERIVED,
> -  GFC_DTYPE_CHARACTER
> +{ BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_CHARACTER, BT_REAL,
> BT_COMPLEX,
> +  BT_DERIVED, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID
>  }
> -dtype;
> -
> +bt;

Isn't changing the values of the enums an ABI change?

ig25@linux-fd1f:~/Krempel/Dtype> cat char.f90
module foo
contains
  subroutine a(x)
    character(len=2) :: x(:)
  end subroutine a
end module foo

program main
  use foo
  character(2) :: x(3)
  call a(x)
end program main
ig25@linux-fd1f:~/Krempel/Dtype> gfortran -fdump-tree-original char.f90
ig25@linux-fd1f:~/Krempel/Dtype> grep dtype char.f90.003t.original
    parm.0.dtype = 153;
ig25@linux-fd1f:~/Krempel/Dtype> /usr/bin/gfortran-4.4
-fdump-tree-original char.f90
ig25@linux-fd1f:~/Krempel/Dtype> grep dtype char.f90.003t.original
    parm.1.dtype = 177;
ig25@linux-fd1f:~/Krempel/Dtype>





More information about the Fortran mailing list