diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2006-07-30 22:48:00 +0200 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2006-07-30 20:48:00 +0000 |
commit | a119fc1ca825952bcf82337a48eeef3645ec4e8d (patch) | |
tree | 42900f38bd309eacda612a5027a33176a6f75fb0 /gcc/fortran/iresolve.c | |
parent | bd11bebe1b23ef6604982e3bc4e64e7f3adda83b (diff) | |
download | gcc-a119fc1ca825952bcf82337a48eeef3645ec4e8d.zip gcc-a119fc1ca825952bcf82337a48eeef3645ec4e8d.tar.gz gcc-a119fc1ca825952bcf82337a48eeef3645ec4e8d.tar.bz2 |
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r-- | gcc/fortran/iresolve.c | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index a65992e..a9a9858 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -90,6 +90,16 @@ gfc_resolve_abs (gfc_expr * f, gfc_expr * a) void +gfc_resolve_access (gfc_expr * f, gfc_expr * name ATTRIBUTE_UNUSED, + gfc_expr * mode ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_c_int_kind; + f->value.function.name = PREFIX("access_func"); +} + + +void gfc_resolve_acos (gfc_expr * f, gfc_expr * x) { f->ts = x->ts; @@ -353,6 +363,32 @@ gfc_resolve_chdir_sub (gfc_code * c) void +gfc_resolve_chmod (gfc_expr * f, gfc_expr * name ATTRIBUTE_UNUSED, + gfc_expr * mode ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_c_int_kind; + f->value.function.name = PREFIX("chmod_func"); +} + + +void +gfc_resolve_chmod_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->next->expr != NULL) + kind = c->ext.actual->next->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("chmod_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + +void gfc_resolve_cmplx (gfc_expr * f, gfc_expr * x, gfc_expr * y, gfc_expr * kind) { f->ts.type = BT_COMPLEX; @@ -919,6 +955,24 @@ gfc_resolve_ishft (gfc_expr * f, gfc_expr * i, gfc_expr * shift) void +gfc_resolve_rshift (gfc_expr * f, gfc_expr * i, gfc_expr * shift) +{ + f->ts = i->ts; + f->value.function.name = + gfc_get_string ("__rshift_%d_%d", i->ts.kind, shift->ts.kind); +} + + +void +gfc_resolve_lshift (gfc_expr * f, gfc_expr * i, gfc_expr * shift) +{ + f->ts = i->ts; + f->value.function.name = + gfc_get_string ("__lshift_%d_%d", i->ts.kind, shift->ts.kind); +} + + +void gfc_resolve_ishftc (gfc_expr * f, gfc_expr * i, gfc_expr * shift, gfc_expr * size) { @@ -2398,7 +2452,7 @@ gfc_resolve_etime_sub (gfc_code * c) } -/* G77 compatibility subroutines itime() and idate(). */ +/* G77 compatibility subroutines itime(), idate(), ltime() and gmtime(). */ void gfc_resolve_itime (gfc_code * c) @@ -2408,7 +2462,6 @@ gfc_resolve_itime (gfc_code * c) gfc_default_integer_kind)); } - void gfc_resolve_idate (gfc_code * c) { @@ -2417,6 +2470,22 @@ gfc_resolve_idate (gfc_code * c) gfc_default_integer_kind)); } +void +gfc_resolve_ltime (gfc_code * c) +{ + c->resolved_sym = gfc_get_intrinsic_sub_symbol + (gfc_get_string (PREFIX("ltime_i%d"), + gfc_default_integer_kind)); +} + +void +gfc_resolve_gmtime (gfc_code * c) +{ + c->resolved_sym = gfc_get_intrinsic_sub_symbol + (gfc_get_string (PREFIX("gmtime_i%d"), + gfc_default_integer_kind)); +} + /* G77 compatibility subroutine second(). */ |