aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.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/check.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/check.c')
-rw-r--r--gcc/fortran/check.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index ec7f6b8..bf81e9f 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -667,6 +667,19 @@ gfc_check_cshift (gfc_expr * array, gfc_expr * shift, gfc_expr * dim)
try
+gfc_check_ctime (gfc_expr * time)
+{
+ if (scalar_check (time, 0) == FAILURE)
+ return FAILURE;
+
+ if (type_check (time, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_dcmplx (gfc_expr * x, gfc_expr * y)
{
if (numeric_check (x, 0) == FAILURE)
@@ -2540,6 +2553,21 @@ gfc_check_srand (gfc_expr * x)
}
try
+gfc_check_ctime_sub (gfc_expr * time, gfc_expr * result)
+{
+ if (scalar_check (time, 0) == FAILURE)
+ return FAILURE;
+
+ if (type_check (time, 0, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (type_check (result, 1, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+try
gfc_check_etime (gfc_expr * x)
{
if (array_check (x, 0) == FAILURE)
@@ -2592,6 +2620,16 @@ gfc_check_etime_sub (gfc_expr * values, gfc_expr * time)
try
+gfc_check_fdate_sub (gfc_expr * date)
+{
+ if (type_check (date, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_gerror (gfc_expr * msg)
{
if (type_check (msg, 0, BT_CHARACTER) == FAILURE)