aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:30 -0700
commitf403a4e4a5d6413cf58f7a9ad004b1086fd2254a (patch)
treeeb4c8c48134d9b5c48bc2f859271eb4db7d32764
parenteb4c927182a8c935960e8c70a2c2d3ab2c49e21f (diff)
downloadgdb-f403a4e4a5d6413cf58f7a9ad004b1086fd2254a.zip
gdb-f403a4e4a5d6413cf58f7a9ad004b1086fd2254a.tar.gz
gdb-f403a4e4a5d6413cf58f7a9ad004b1086fd2254a.tar.bz2
Implement fortran_allocated_operation
This implements the Fortran ALLOCATED intrinsic. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * f-exp.h (eval_op_f_allocated): Declare. (fortran_allocated_operation): New typedef. * f-lang.c (eval_op_f_allocated): No longer static.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/f-exp.h9
-rw-r--r--gdb/f-lang.c2
3 files changed, 15 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d92f16b..856d6ff 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2021-03-08 Tom Tromey <tom@tromey.com>
+ * f-exp.h (eval_op_f_allocated): Declare.
+ (fortran_allocated_operation): New typedef.
+ * f-lang.c (eval_op_f_allocated): No longer static.
+
+2021-03-08 Tom Tromey <tom@tromey.com>
+
* f-lang.c (eval_op_f_associated): New functions.
* f-exp.h (fortran_associated_1arg, fortran_associated_2arg): New
typedefs.
diff --git a/gdb/f-exp.h b/gdb/f-exp.h
index 11f403d..81cf341 100644
--- a/gdb/f-exp.h
+++ b/gdb/f-exp.h
@@ -1,6 +1,6 @@
/* Definitions for Fortran expressions
- Copyright (C) 2020 Free Software Foundation, Inc.
+ Copyright (C) 2020, 2021 Free Software Foundation, Inc.
This file is part of GDB.
@@ -68,6 +68,11 @@ extern struct value *eval_op_f_associated (struct type *expect_type,
enum exp_opcode opcode,
struct value *arg1,
struct value *arg2);
+extern struct value * eval_op_f_allocated (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside,
+ enum exp_opcode op,
+ struct value *arg1);
namespace expr
{
@@ -79,6 +84,8 @@ using fortran_floor_operation = unop_operation<UNOP_FORTRAN_FLOOR,
eval_op_f_floor>;
using fortran_kind_operation = unop_operation<UNOP_FORTRAN_KIND,
eval_op_f_kind>;
+using fortran_allocated_operation = unop_operation<UNOP_FORTRAN_ALLOCATED,
+ eval_op_f_allocated>;
using fortran_mod_operation = binop_operation<BINOP_MOD, eval_op_f_mod>;
using fortran_modulo_operation = binop_operation<BINOP_FORTRAN_MODULO,
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 1a49b6b..90ff3d1 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -1209,7 +1209,7 @@ eval_op_f_kind (struct type *expect_type, struct expression *exp,
/* A helper function for UNOP_FORTRAN_ALLOCATED. */
-static struct value *
+struct value *
eval_op_f_allocated (struct type *expect_type, struct expression *exp,
enum noside noside, enum exp_opcode op,
struct value *arg1)