diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-02-25 11:41:57 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-03-09 09:45:18 +0000 |
commit | e14816a8ba5ecf8d7c0125a08afe87fb7d1a6bba (patch) | |
tree | 718883b66af773f86fc1ef753db65f8e33456f1c /gdb/f-exp.y | |
parent | 742732c7f0a989eaba7c1acac3ca5eeaa274df0e (diff) | |
download | gdb-e14816a8ba5ecf8d7c0125a08afe87fb7d1a6bba.zip gdb-e14816a8ba5ecf8d7c0125a08afe87fb7d1a6bba.tar.gz gdb-e14816a8ba5ecf8d7c0125a08afe87fb7d1a6bba.tar.bz2 |
gdb/fortran: add support for RANK keyword
gfortran supports the RANK keyword, see:
https://gcc.gnu.org/onlinedocs/gfortran/RANK.html#RANK
this commit adds support for this keyword to GDB's Fortran expression
parser.
gdb/ChangeLog:
* f-exp.h (eval_op_f_rank): Declare.
(expr::fortran_rank_operation): New typedef.
* f-exp.y (exp): Handle UNOP_FORTRAN_RANK after parsing an
UNOP_INTRINSIC.
(f77_keywords): Add "rank" keyword.
* f-lang.c (eval_op_f_rank): New function.
* std-operator.def (UNOP_FORTRAN_RANK): New operator.
gdb/testsuite/ChangeLog:
* gdb.fortran/rank.exp: New file.
* gdb.fortran/rank.f90: New file.
Diffstat (limited to 'gdb/f-exp.y')
-rw-r--r-- | gdb/f-exp.y | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y index c33b507..02e35c8 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -320,6 +320,9 @@ exp : UNOP_INTRINSIC '(' exp ')' case UNOP_FORTRAN_ALLOCATED: pstate->wrap<fortran_allocated_operation> (); break; + case UNOP_FORTRAN_RANK: + pstate->wrap<fortran_rank_operation> (); + break; default: gdb_assert_not_reached ("unhandled intrinsic"); } @@ -1139,6 +1142,7 @@ static const struct token f77_keywords[] = { "ubound", UNOP_OR_BINOP_INTRINSIC, FORTRAN_UBOUND, false }, { "allocated", UNOP_INTRINSIC, UNOP_FORTRAN_ALLOCATED, false }, { "associated", UNOP_OR_BINOP_INTRINSIC, FORTRAN_ASSOCIATED, false }, + { "rank", UNOP_INTRINSIC, UNOP_FORTRAN_RANK, false }, }; /* Implementation of a dynamically expandable buffer for processing input |