aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2005-11-06 11:17:04 +0100
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2005-11-06 10:17:04 +0000
commit35059811529c8e32c37d0d38e5cbbec3feea4a0e (patch)
tree2bf68231c09bf20e0ef20f8acec4df3d8c11c85c /gcc/fortran/intrinsic.c
parent1f2a3c8f5e220138bfdb2eb724acedcbe6515d39 (diff)
downloadgcc-35059811529c8e32c37d0d38e5cbbec3feea4a0e.zip
gcc-35059811529c8e32c37d0d38e5cbbec3feea4a0e.tar.gz
gcc-35059811529c8e32c37d0d38e5cbbec3feea4a0e.tar.bz2
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics. (add_subroutines): Likewise. * intrinsic.h: Prototypes for gfc_check_ctime, gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime, gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub. * gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE. * iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions. * trans-decl.c (gfc_build_intrinsic_function_decls): Add gfor_fndecl_fdate and gfor_fndecl_ctime. * check.c (gfc_check_ctime, gfc_check_ctime_sub, gfc_check_fdate_sub): New functions. * trans-intrinsic.c (gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate): New functions. (gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME and GFC_ISYM_FDATE. * intrinsic.texi: Documentation for the new CTIME and FDATE intrinsics. * trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate. * intrinsics/ctime.c: New file. * configure.ac: Add check for ctime. * Makefile.am: Add ctime.c * configure: Regenerate. * config.h.in: Regenerate. * Makefile.in: Regenerate. From-SVN: r106558
Diffstat (limited to 'gcc/fortran/intrinsic.c')
-rw-r--r--gcc/fortran/intrinsic.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 96ba02b..eedbaa7 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -872,7 +872,7 @@ add_functions (void)
*x = "x", *sh = "shift", *stg = "string", *ssg = "substring",
*y = "y", *sz = "size", *sta = "string_a", *stb = "string_b",
*z = "z", *ln = "len", *ut = "unit", *han = "handler",
- *num = "number";
+ *num = "number", *tm = "time";
int di, dr, dd, dl, dc, dz, ii;
@@ -1214,6 +1214,12 @@ add_functions (void)
make_generic ("cshift", GFC_ISYM_CSHIFT, GFC_STD_F95);
+ add_sym_1 ("ctime", 0, 1, BT_CHARACTER, 0, GFC_STD_GNU,
+ gfc_check_ctime, NULL, gfc_resolve_ctime,
+ tm, BT_INTEGER, di, REQUIRED);
+
+ make_generic ("ctime", GFC_ISYM_CTIME, GFC_STD_GNU);
+
add_sym_1 ("dble", 1, 1, BT_REAL, dd, GFC_STD_F77,
gfc_check_dble, gfc_simplify_dble, gfc_resolve_dble,
a, BT_REAL, dr, REQUIRED);
@@ -1329,6 +1335,11 @@ add_functions (void)
make_generic ("exponent", GFC_ISYM_EXPONENT, GFC_STD_F95);
+ add_sym_0 ("fdate", 1, 0, BT_CHARACTER, dc, GFC_STD_GNU,
+ NULL, NULL, gfc_resolve_fdate);
+
+ make_generic ("fdate", GFC_ISYM_FDATE, GFC_STD_GNU);
+
add_sym_2 ("floor", 1, 1, BT_INTEGER, di, GFC_STD_F95,
gfc_check_a_ikind, gfc_simplify_floor, gfc_resolve_floor,
a, BT_REAL, dr, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
@@ -2147,7 +2158,7 @@ add_subroutines (void)
*com = "command", *length = "length", *st = "status",
*val = "value", *num = "number", *name = "name",
*trim_name = "trim_name", *ut = "unit", *han = "handler",
- *sec = "seconds";
+ *sec = "seconds", *res = "result";
int di, dr, dc, dl, ii;
@@ -2166,6 +2177,10 @@ add_subroutines (void)
tm, BT_REAL, dr, REQUIRED);
/* More G77 compatibility garbage. */
+ add_sym_2s ("ctime", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_ctime_sub, NULL, gfc_resolve_ctime_sub,
+ tm, BT_INTEGER, di, REQUIRED, res, BT_CHARACTER, dc, REQUIRED);
+
add_sym_1s ("second", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_second_sub, NULL, gfc_resolve_second_sub,
tm, BT_REAL, dr, REQUIRED);
@@ -2188,6 +2203,10 @@ add_subroutines (void)
gfc_check_etime_sub, NULL, gfc_resolve_etime_sub,
vl, BT_REAL, 4, REQUIRED, tm, BT_REAL, 4, REQUIRED);
+ add_sym_1s ("fdate", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
+ gfc_check_fdate_sub, NULL, gfc_resolve_fdate_sub,
+ dt, BT_CHARACTER, dc, REQUIRED);
+
add_sym_1s ("gerror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU,
gfc_check_gerror, NULL, gfc_resolve_gerror, c, BT_CHARACTER,
dc, REQUIRED);