diff options
author | Steven G. Kargl <kargls@comcast.net> | 2004-12-02 04:10:26 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-12-02 04:10:26 +0000 |
commit | df65f0938c4b76b388958c04666e0efd279ba333 (patch) | |
tree | c20ca282f2b337834e069d56d9239c0253de5b3e /gcc/fortran/intrinsic.c | |
parent | 8930ce20d027c54f5019ab3b0171222bf85e357c (diff) | |
download | gcc-df65f0938c4b76b388958c04666e0efd279ba333.zip gcc-df65f0938c4b76b388958c04666e0efd279ba333.tar.gz gcc-df65f0938c4b76b388958c04666e0efd279ba333.tar.bz2 |
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r-- | gcc/fortran/intrinsic.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 801072a..ebf40ce 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -857,7 +857,7 @@ add_functions (void) *s = "s", *dm = "dim", *kind = "kind", *msk = "mask", *x = "x", *sh = "shift", *stg = "string", *ssg = "substring", *y = "y", *sz = "size", *sta = "string_a", *stb = "string_b", - *z = "z", *ln = "len"; + *z = "z", *ln = "len", *ut = "unit"; int di, dr, dd, dl, dc, dz, ii; @@ -1280,12 +1280,25 @@ add_functions (void) make_generic ("floor", GFC_ISYM_FLOOR, GFC_STD_F95); + /* G77 compatible fnum */ + add_sym_1 ("fnum", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_fnum, NULL, gfc_resolve_fnum, + ut, BT_INTEGER, di, REQUIRED); + + make_generic ("fnum", GFC_ISYM_FNUM, GFC_STD_GNU); + add_sym_1 ("fraction", 1, 1, BT_REAL, dr, GFC_STD_F95, gfc_check_x, gfc_simplify_fraction, gfc_resolve_fraction, x, BT_REAL, dr, REQUIRED); make_generic ("fraction", GFC_ISYM_FRACTION, GFC_STD_F95); + add_sym_2 ("fstat", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_fstat, NULL, gfc_resolve_fstat, + a, BT_INTEGER, di, REQUIRED, b, BT_INTEGER, di, REQUIRED); + + make_generic ("fstat", GFC_ISYM_FSTAT, GFC_STD_GNU); + /* Unix IDs (g77 compatibility) */ add_sym_1 ("getcwd", 0, 1, BT_INTEGER, di, GFC_STD_GNU, NULL, NULL, gfc_resolve_getcwd, @@ -1876,6 +1889,12 @@ add_functions (void) make_generic ("sqrt", GFC_ISYM_SQRT, GFC_STD_F77); + add_sym_2 ("stat", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_stat, NULL, gfc_resolve_stat, + a, BT_CHARACTER, dc, REQUIRED, b, BT_INTEGER, di, REQUIRED); + + make_generic ("stat", GFC_ISYM_STAT, GFC_STD_GNU); + add_sym_3red ("sum", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95, gfc_check_product_sum, NULL, gfc_resolve_sum, ar, BT_REAL, dr, REQUIRED, dm, BT_INTEGER, ii, OPTIONAL, @@ -1983,7 +2002,7 @@ add_subroutines (void) *f = "from", *sz = "size", *ln = "len", *cr = "count_rate", *com = "command", *length = "length", *st = "status", *val = "value", *num = "number", *name = "name", - *trim_name = "trim_name"; + *trim_name = "trim_name", *ut = "unit"; int di, dr, dc, dl; @@ -2073,6 +2092,20 @@ add_subroutines (void) gfc_check_exit, NULL, gfc_resolve_exit, c, BT_INTEGER, di, OPTIONAL); + add_sym_1s ("flush", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_flush, NULL, gfc_resolve_flush, + c, BT_INTEGER, di, OPTIONAL); + + add_sym_3s ("fstat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_fstat_sub, NULL, gfc_resolve_fstat_sub, + ut, BT_INTEGER, di, REQUIRED, vl, BT_INTEGER, di, REQUIRED, + st, BT_INTEGER, di, OPTIONAL); + + add_sym_3s ("stat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_stat_sub, NULL, gfc_resolve_stat_sub, + name, BT_CHARACTER, dc, REQUIRED, vl, BT_INTEGER, di, REQUIRED, + st, BT_INTEGER, di, OPTIONAL); + add_sym_2s ("system", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, NULL, NULL, gfc_resolve_system_sub, c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); |