This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran] RFC: Renaming 'enum gfc_generic_isym_id'
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Daniel Franke <franke dot daniel at gmail dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 29 May 2007 23:18:00 +0300
- Subject: Re: [patch, fortran] RFC: Renaming 'enum gfc_generic_isym_id'
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
Daniel Franke wrote:
(1) rename 'enum gfc_generic_isym_id' to 'enum> gfc_isym_id'
(2) add missing intrinsics to 'enum gfc_isym_id'
(3) add an additional 'id' argument to 'add_sym_[s]'
(4) change all callers, add the corresponding 'gfc_isym_id'
(5) rename member 'generic_id' in 'struct gfc_intrinsic_sym' to 'id'
(6) change all callers
I'll go ahead and prepare a patch following the outline given above. A
patch tells more than vague descriptions.
With attached patch, any intrinsic---functions and subroutines alike---becomes
easily identifyable by its isym->id (modulo specific names as ABS and ZABS).
Currently all subroutine calls, including intrinsic subroutines, are
translated via gfc_trans_call(). There are two reasons to splice off the
translation of intrinsic subroutines from gfc_trans_call():
(a) manually translate subroutines with INTENT(out) arguments to ...
(b) cast the input/output before/after the corresponding library call
to get rid of duplicate implementations with different types.
For this, I have a patch in-the-works that fixes wrong-code PR29651, but it
lacks the framework to identify the intrinsic called. The resolved_symbol
in 'code' does not help and up until now isym->generic_id equals
GFC_ISYM_NONE. With attached patch in place identifying the subroutine can be
done similar to gfc_conv_intrinsic_function().
Regtested on i686-pc-linux-gnu. Ok for trunk?
2007-05-28 Daniel Franke <firstname.lastname@example.org>
* gfortran.h: Renamed 'enum gfc_generic_isym_id' to 'enum gfc_isym_id',
added missing GFC_ISYM_* enumators, ordered alphabetically.
(struct gfc_intrinsic_sym): Renamed 'generic_id' to 'id'.
(gfc_find_subroutine): Newly exposed.
* intrinsic.c (add_sym, add_sym_*): Added argument 'id' and changed all
(find_subroutine): Renamed to 'gfc_find_subroutine', removed static.
* dependency.c: Changed usage of isym->generic_id to isym->id.
* openmp.c: Likewise.
* resolve.c: Likewise.
* trans-array.c: Likewise.
* trans-expr.c: Likewise.
* trans-intrinsic.c: Likewise.
* trans-openmp.c: Likewise.
The patch is quite technical and does not bear any surprises besides its
Ok for trunk.