diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-11-06 11:17:04 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-11-06 10:17:04 +0000 |
commit | 35059811529c8e32c37d0d38e5cbbec3feea4a0e (patch) | |
tree | 2bf68231c09bf20e0ef20f8acec4df3d8c11c85c /gcc/fortran/iresolve.c | |
parent | 1f2a3c8f5e220138bfdb2eb724acedcbe6515d39 (diff) | |
download | gcc-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/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 4973eb4..22aeda8 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -441,6 +441,28 @@ gfc_resolve_cshift (gfc_expr * f, gfc_expr * array, void +gfc_resolve_ctime (gfc_expr * f, gfc_expr * time) +{ + gfc_typespec ts; + + f->ts.type = BT_CHARACTER; + f->ts.kind = gfc_default_character_kind; + + /* ctime TIME argument is a INTEGER(KIND=8), says the doc */ + if (time->ts.kind != 8) + { + ts.type = BT_INTEGER; + ts.kind = 8; + ts.derived = NULL; + ts.cl = NULL; + gfc_convert_type (time, &ts, 2); + } + + f->value.function.name = gfc_get_string (PREFIX("ctime")); +} + + +void gfc_resolve_dble (gfc_expr * f, gfc_expr * a) { f->ts.type = BT_REAL; @@ -561,6 +583,15 @@ gfc_resolve_exponent (gfc_expr * f, gfc_expr * x) void +gfc_resolve_fdate (gfc_expr * f) +{ + f->ts.type = BT_CHARACTER; + f->ts.kind = gfc_default_character_kind; + f->value.function.name = gfc_get_string (PREFIX("fdate")); +} + + +void gfc_resolve_floor (gfc_expr * f, gfc_expr * a, gfc_expr * kind) { f->ts.type = BT_INTEGER; @@ -2145,6 +2176,32 @@ gfc_resolve_free (gfc_code * c) void +gfc_resolve_ctime_sub (gfc_code * c) +{ + gfc_typespec ts; + + /* ctime TIME argument is a INTEGER(KIND=8), says the doc */ + if (c->ext.actual->expr->ts.kind != 8) + { + ts.type = BT_INTEGER; + ts.kind = 8; + ts.derived = NULL; + ts.cl = NULL; + gfc_convert_type (c->ext.actual->expr, &ts, 2); + } + + c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX("ctime_sub")); +} + + +void +gfc_resolve_fdate_sub (gfc_code * c) +{ + c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("fdate_sub")); +} + + +void gfc_resolve_gerror (gfc_code * c) { c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("gerror")); |