1 /* Fortran language support routines for GDB, the GNU debugger.
3 Copyright (C) 1993-2020 Free Software Foundation, Inc.
5 Contributed by Motorola. Adapted from the C parser by Farooq Butt
6 (fmbutt@engage.sps.mot.com).
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #include "expression.h"
27 #include "parser-defs.h"
34 #include "cp-support.h"
37 #include "target-float.h"
44 /* Return the encoding that should be used for the character type
48 f_get_encoding (struct type
*type
)
52 switch (TYPE_LENGTH (type
))
55 encoding
= target_charset (get_type_arch (type
));
58 if (type_byte_order (type
) == BFD_ENDIAN_BIG
)
59 encoding
= "UTF-32BE";
61 encoding
= "UTF-32LE";
65 error (_("unrecognized character type"));
71 /* Print the character string STRING, printing at most LENGTH characters.
72 Printing stops early if the number hits print_max; repeat counts
73 are printed as appropriate. Print ellipses at the end if we
74 had to stop before printing LENGTH characters, or if FORCE_ELLIPSES.
75 FIXME: This is a copy of the same function from c-exp.y. It should
76 be replaced with a true F77 version. */
79 f_printstr (struct ui_file
*stream
, struct type
*type
, const gdb_byte
*string
,
80 unsigned int length
, const char *encoding
, int force_ellipses
,
81 const struct value_print_options
*options
)
83 const char *type_encoding
= f_get_encoding (type
);
85 if (TYPE_LENGTH (type
) == 4)
86 fputs_filtered ("4_", stream
);
88 if (!encoding
|| !*encoding
)
89 encoding
= type_encoding
;
91 generic_printstr (stream
, type
, string
, length
, encoding
,
92 force_ellipses
, '\'', 0, options
);
96 /* Table of operators and their precedences for printing expressions. */
98 static const struct op_print f_op_print_tab
[] =
100 {"+", BINOP_ADD
, PREC_ADD
, 0},
101 {"+", UNOP_PLUS
, PREC_PREFIX
, 0},
102 {"-", BINOP_SUB
, PREC_ADD
, 0},
103 {"-", UNOP_NEG
, PREC_PREFIX
, 0},
104 {"*", BINOP_MUL
, PREC_MUL
, 0},
105 {"/", BINOP_DIV
, PREC_MUL
, 0},
106 {"DIV", BINOP_INTDIV
, PREC_MUL
, 0},
107 {"MOD", BINOP_REM
, PREC_MUL
, 0},
108 {"=", BINOP_ASSIGN
, PREC_ASSIGN
, 1},
109 {".OR.", BINOP_LOGICAL_OR
, PREC_LOGICAL_OR
, 0},
110 {".AND.", BINOP_LOGICAL_AND
, PREC_LOGICAL_AND
, 0},
111 {".NOT.", UNOP_LOGICAL_NOT
, PREC_PREFIX
, 0},
112 {".EQ.", BINOP_EQUAL
, PREC_EQUAL
, 0},
113 {".NE.", BINOP_NOTEQUAL
, PREC_EQUAL
, 0},
114 {".LE.", BINOP_LEQ
, PREC_ORDER
, 0},
115 {".GE.", BINOP_GEQ
, PREC_ORDER
, 0},
116 {".GT.", BINOP_GTR
, PREC_ORDER
, 0},
117 {".LT.", BINOP_LESS
, PREC_ORDER
, 0},
118 {"**", UNOP_IND
, PREC_PREFIX
, 0},
119 {"@", BINOP_REPEAT
, PREC_REPEAT
, 0},
120 {NULL
, OP_NULL
, PREC_REPEAT
, 0}
123 enum f_primitive_types
{
124 f_primitive_type_character
,
125 f_primitive_type_logical
,
126 f_primitive_type_logical_s1
,
127 f_primitive_type_logical_s2
,
128 f_primitive_type_logical_s8
,
129 f_primitive_type_integer
,
130 f_primitive_type_integer_s2
,
131 f_primitive_type_real
,
132 f_primitive_type_real_s8
,
133 f_primitive_type_real_s16
,
134 f_primitive_type_complex_s8
,
135 f_primitive_type_complex_s16
,
136 f_primitive_type_void
,
140 /* Special expression evaluation cases for Fortran. */
142 static struct value
*
143 evaluate_subexp_f (struct type
*expect_type
, struct expression
*exp
,
144 int *pos
, enum noside noside
)
146 struct value
*arg1
= NULL
, *arg2
= NULL
;
153 op
= exp
->elts
[pc
].opcode
;
159 return evaluate_subexp_standard (expect_type
, exp
, pos
, noside
);
162 arg1
= evaluate_subexp (NULL_TYPE
, exp
, pos
, noside
);
163 if (noside
== EVAL_SKIP
)
164 return eval_skip_value (exp
);
165 type
= value_type (arg1
);
166 switch (type
->code ())
171 = fabs (target_float_to_host_double (value_contents (arg1
),
173 return value_from_host_double (type
, d
);
177 LONGEST l
= value_as_long (arg1
);
179 return value_from_longest (type
, l
);
182 error (_("ABS of type %s not supported"), TYPE_SAFE_NAME (type
));
185 arg1
= evaluate_subexp (NULL_TYPE
, exp
, pos
, noside
);
186 arg2
= evaluate_subexp (value_type (arg1
), exp
, pos
, noside
);
187 if (noside
== EVAL_SKIP
)
188 return eval_skip_value (exp
);
189 type
= value_type (arg1
);
190 if (type
->code () != value_type (arg2
)->code ())
191 error (_("non-matching types for parameters to MOD ()"));
192 switch (type
->code ())
197 = target_float_to_host_double (value_contents (arg1
),
200 = target_float_to_host_double (value_contents (arg2
),
202 double d3
= fmod (d1
, d2
);
203 return value_from_host_double (type
, d3
);
207 LONGEST v1
= value_as_long (arg1
);
208 LONGEST v2
= value_as_long (arg2
);
210 error (_("calling MOD (N, 0) is undefined"));
211 LONGEST v3
= v1
- (v1
/ v2
) * v2
;
212 return value_from_longest (value_type (arg1
), v3
);
215 error (_("MOD of type %s not supported"), TYPE_SAFE_NAME (type
));
217 case UNOP_FORTRAN_CEILING
:
219 arg1
= evaluate_subexp (NULL_TYPE
, exp
, pos
, noside
);
220 if (noside
== EVAL_SKIP
)
221 return eval_skip_value (exp
);
222 type
= value_type (arg1
);
223 if (type
->code () != TYPE_CODE_FLT
)
224 error (_("argument to CEILING must be of type float"));
226 = target_float_to_host_double (value_contents (arg1
),
229 return value_from_host_double (type
, val
);
232 case UNOP_FORTRAN_FLOOR
:
234 arg1
= evaluate_subexp (NULL_TYPE
, exp
, pos
, noside
);
235 if (noside
== EVAL_SKIP
)
236 return eval_skip_value (exp
);
237 type
= value_type (arg1
);
238 if (type
->code () != TYPE_CODE_FLT
)
239 error (_("argument to FLOOR must be of type float"));
241 = target_float_to_host_double (value_contents (arg1
),
244 return value_from_host_double (type
, val
);
247 case BINOP_FORTRAN_MODULO
:
249 arg1
= evaluate_subexp (NULL_TYPE
, exp
, pos
, noside
);
250 arg2
= evaluate_subexp (value_type (arg1
), exp
, pos
, noside
);
251 if (noside
== EVAL_SKIP
)
252 return eval_skip_value (exp
);
253 type
= value_type (arg1
);
254 if (type
->code () != value_type (arg2
)->code ())
255 error (_("non-matching types for parameters to MODULO ()"));
256 /* MODULO(A, P) = A - FLOOR (A / P) * P */
257 switch (type
->code ())
261 LONGEST a
= value_as_long (arg1
);
262 LONGEST p
= value_as_long (arg2
);
263 LONGEST result
= a
- (a
/ p
) * p
;
264 if (result
!= 0 && (a
< 0) != (p
< 0))
266 return value_from_longest (value_type (arg1
), result
);
271 = target_float_to_host_double (value_contents (arg1
),
274 = target_float_to_host_double (value_contents (arg2
),
276 double result
= fmod (a
, p
);
277 if (result
!= 0 && (a
< 0.0) != (p
< 0.0))
279 return value_from_host_double (type
, result
);
282 error (_("MODULO of type %s not supported"), TYPE_SAFE_NAME (type
));
285 case BINOP_FORTRAN_CMPLX
:
286 arg1
= evaluate_subexp (NULL_TYPE
, exp
, pos
, noside
);
287 arg2
= evaluate_subexp (value_type (arg1
), exp
, pos
, noside
);
288 if (noside
== EVAL_SKIP
)
289 return eval_skip_value (exp
);
290 type
= builtin_f_type(exp
->gdbarch
)->builtin_complex_s16
;
291 return value_literal_complex (arg1
, arg2
, type
);
293 case UNOP_FORTRAN_KIND
:
294 arg1
= evaluate_subexp (NULL
, exp
, pos
, EVAL_AVOID_SIDE_EFFECTS
);
295 type
= value_type (arg1
);
297 switch (type
->code ())
299 case TYPE_CODE_STRUCT
:
300 case TYPE_CODE_UNION
:
301 case TYPE_CODE_MODULE
:
303 error (_("argument to kind must be an intrinsic type"));
306 if (!TYPE_TARGET_TYPE (type
))
307 return value_from_longest (builtin_type (exp
->gdbarch
)->builtin_int
,
309 return value_from_longest (builtin_type (exp
->gdbarch
)->builtin_int
,
310 TYPE_LENGTH (TYPE_TARGET_TYPE (type
)));
313 /* Should be unreachable. */
317 /* Return true if TYPE is a string. */
320 f_is_string_type_p (struct type
*type
)
322 type
= check_typedef (type
);
323 return (type
->code () == TYPE_CODE_STRING
324 || (type
->code () == TYPE_CODE_ARRAY
325 && TYPE_TARGET_TYPE (type
)->code () == TYPE_CODE_CHAR
));
328 /* Special expression lengths for Fortran. */
331 operator_length_f (const struct expression
*exp
, int pc
, int *oplenp
,
337 switch (exp
->elts
[pc
- 1].opcode
)
340 operator_length_standard (exp
, pc
, oplenp
, argsp
);
343 case UNOP_FORTRAN_KIND
:
344 case UNOP_FORTRAN_FLOOR
:
345 case UNOP_FORTRAN_CEILING
:
350 case BINOP_FORTRAN_CMPLX
:
351 case BINOP_FORTRAN_MODULO
:
361 /* Helper for PRINT_SUBEXP_F. Arguments are as for PRINT_SUBEXP_F, except
362 the extra argument NAME which is the text that should be printed as the
363 name of this operation. */
366 print_unop_subexp_f (struct expression
*exp
, int *pos
,
367 struct ui_file
*stream
, enum precedence prec
,
371 fprintf_filtered (stream
, "%s(", name
);
372 print_subexp (exp
, pos
, stream
, PREC_SUFFIX
);
373 fputs_filtered (")", stream
);
376 /* Helper for PRINT_SUBEXP_F. Arguments are as for PRINT_SUBEXP_F, except
377 the extra argument NAME which is the text that should be printed as the
378 name of this operation. */
381 print_binop_subexp_f (struct expression
*exp
, int *pos
,
382 struct ui_file
*stream
, enum precedence prec
,
386 fprintf_filtered (stream
, "%s(", name
);
387 print_subexp (exp
, pos
, stream
, PREC_SUFFIX
);
388 fputs_filtered (",", stream
);
389 print_subexp (exp
, pos
, stream
, PREC_SUFFIX
);
390 fputs_filtered (")", stream
);
393 /* Special expression printing for Fortran. */
396 print_subexp_f (struct expression
*exp
, int *pos
,
397 struct ui_file
*stream
, enum precedence prec
)
400 enum exp_opcode op
= exp
->elts
[pc
].opcode
;
405 print_subexp_standard (exp
, pos
, stream
, prec
);
408 case UNOP_FORTRAN_KIND
:
409 print_unop_subexp_f (exp
, pos
, stream
, prec
, "KIND");
412 case UNOP_FORTRAN_FLOOR
:
413 print_unop_subexp_f (exp
, pos
, stream
, prec
, "FLOOR");
416 case UNOP_FORTRAN_CEILING
:
417 print_unop_subexp_f (exp
, pos
, stream
, prec
, "CEILING");
420 case BINOP_FORTRAN_CMPLX
:
421 print_binop_subexp_f (exp
, pos
, stream
, prec
, "CMPLX");
424 case BINOP_FORTRAN_MODULO
:
425 print_binop_subexp_f (exp
, pos
, stream
, prec
, "MODULO");
430 /* Special expression names for Fortran. */
433 op_name_f (enum exp_opcode opcode
)
438 return op_name_standard (opcode
);
443 #include "fortran-operator.def"
448 /* Special expression dumping for Fortran. */
451 dump_subexp_body_f (struct expression
*exp
,
452 struct ui_file
*stream
, int elt
)
454 int opcode
= exp
->elts
[elt
].opcode
;
460 return dump_subexp_body_standard (exp
, stream
, elt
);
462 case UNOP_FORTRAN_KIND
:
463 case UNOP_FORTRAN_FLOOR
:
464 case UNOP_FORTRAN_CEILING
:
465 case BINOP_FORTRAN_CMPLX
:
466 case BINOP_FORTRAN_MODULO
:
467 operator_length_f (exp
, (elt
+ 1), &oplen
, &nargs
);
472 for (i
= 0; i
< nargs
; i
+= 1)
473 elt
= dump_subexp (exp
, stream
, elt
);
478 /* Special expression checking for Fortran. */
481 operator_check_f (struct expression
*exp
, int pos
,
482 int (*objfile_func
) (struct objfile
*objfile
,
486 const union exp_element
*const elts
= exp
->elts
;
488 switch (elts
[pos
].opcode
)
490 case UNOP_FORTRAN_KIND
:
491 case UNOP_FORTRAN_FLOOR
:
492 case UNOP_FORTRAN_CEILING
:
493 case BINOP_FORTRAN_CMPLX
:
494 case BINOP_FORTRAN_MODULO
:
495 /* Any references to objfiles are held in the arguments to this
496 expression, not within the expression itself, so no additional
497 checking is required here, the outer expression iteration code
498 will take care of checking each argument. */
502 return operator_check_standard (exp
, pos
, objfile_func
, data
);
508 static const char *f_extensions
[] =
510 ".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP",
511 ".f90", ".F90", ".f95", ".F95", ".f03", ".F03", ".f08", ".F08",
515 /* Expression processing for Fortran. */
516 static const struct exp_descriptor exp_descriptor_f
=
526 /* Constant data that describes the Fortran language. */
528 extern const struct language_data f_language_data
=
539 f_printstr
, /* function to print string constant */
540 f_print_typedef
, /* Print a typedef using appropriate syntax */
541 NULL
, /* name_of_this */
542 false, /* la_store_sym_names_in_linkage_form_p */
543 f_op_print_tab
, /* expression operators for printing */
544 0, /* arrays are first-class (not c-style) */
545 1, /* String lower bound */
548 "(...)" /* la_struct_too_deep_ellipsis */
551 /* Class representing the Fortran language. */
553 class f_language
: public language_defn
557 : language_defn (language_fortran
, f_language_data
)
560 /* See language.h. */
561 void language_arch_info (struct gdbarch
*gdbarch
,
562 struct language_arch_info
*lai
) const override
564 const struct builtin_f_type
*builtin
= builtin_f_type (gdbarch
);
566 lai
->string_char_type
= builtin
->builtin_character
;
567 lai
->primitive_type_vector
568 = GDBARCH_OBSTACK_CALLOC (gdbarch
, nr_f_primitive_types
+ 1,
571 lai
->primitive_type_vector
[f_primitive_type_character
]
572 = builtin
->builtin_character
;
573 lai
->primitive_type_vector
[f_primitive_type_logical
]
574 = builtin
->builtin_logical
;
575 lai
->primitive_type_vector
[f_primitive_type_logical_s1
]
576 = builtin
->builtin_logical_s1
;
577 lai
->primitive_type_vector
[f_primitive_type_logical_s2
]
578 = builtin
->builtin_logical_s2
;
579 lai
->primitive_type_vector
[f_primitive_type_logical_s8
]
580 = builtin
->builtin_logical_s8
;
581 lai
->primitive_type_vector
[f_primitive_type_real
]
582 = builtin
->builtin_real
;
583 lai
->primitive_type_vector
[f_primitive_type_real_s8
]
584 = builtin
->builtin_real_s8
;
585 lai
->primitive_type_vector
[f_primitive_type_real_s16
]
586 = builtin
->builtin_real_s16
;
587 lai
->primitive_type_vector
[f_primitive_type_complex_s8
]
588 = builtin
->builtin_complex_s8
;
589 lai
->primitive_type_vector
[f_primitive_type_complex_s16
]
590 = builtin
->builtin_complex_s16
;
591 lai
->primitive_type_vector
[f_primitive_type_void
]
592 = builtin
->builtin_void
;
594 lai
->bool_type_symbol
= "logical";
595 lai
->bool_type_default
= builtin
->builtin_logical_s2
;
598 /* See language.h. */
599 unsigned int search_name_hash (const char *name
) const override
601 return cp_search_name_hash (name
);
604 /* See language.h. */
606 char *demangle (const char *mangled
, int options
) const override
608 /* We could support demangling here to provide module namespaces
609 also for inferiors with only minimal symbol table (ELF symbols).
610 Just the mangling standard is not standardized across compilers
611 and there is no DW_AT_producer available for inferiors with only
612 the ELF symbols to check the mangling kind. */
616 /* See language.h. */
618 void print_type (struct type
*type
, const char *varstring
,
619 struct ui_file
*stream
, int show
, int level
,
620 const struct type_print_options
*flags
) const override
622 f_print_type (type
, varstring
, stream
, show
, level
, flags
);
625 /* See language.h. This just returns default set of word break
626 characters but with the modules separator `::' removed. */
628 const char *word_break_characters (void) const override
636 retval
= xstrdup (language_defn::word_break_characters ());
637 s
= strchr (retval
, ':');
640 char *last_char
= &s
[strlen (s
) - 1];
650 /* See language.h. */
652 void collect_symbol_completion_matches (completion_tracker
&tracker
,
653 complete_symbol_mode mode
,
654 symbol_name_match_type name_match_type
,
655 const char *text
, const char *word
,
656 enum type_code code
) const override
658 /* Consider the modules separator :: as a valid symbol name character
660 default_collect_symbol_completion_matches_break_on (tracker
, mode
,
666 /* See language.h. */
668 void value_print_inner
669 (struct value
*val
, struct ui_file
*stream
, int recurse
,
670 const struct value_print_options
*options
) const override
672 return f_value_print_inner (val
, stream
, recurse
, options
);
675 /* See language.h. */
677 struct block_symbol lookup_symbol_nonlocal
678 (const char *name
, const struct block
*block
,
679 const domain_enum domain
) const override
681 return cp_lookup_symbol_nonlocal (this, name
, block
, domain
);
684 /* See language.h. */
686 int parser (struct parser_state
*ps
) const override
691 /* See language.h. */
693 void emitchar (int ch
, struct type
*chtype
,
694 struct ui_file
*stream
, int quoter
) const override
696 const char *encoding
= f_get_encoding (chtype
);
697 generic_emit_char (ch
, chtype
, stream
, quoter
, encoding
);
700 /* See language.h. */
702 void printchar (int ch
, struct type
*chtype
,
703 struct ui_file
*stream
) const override
705 fputs_filtered ("'", stream
);
706 LA_EMIT_CHAR (ch
, chtype
, stream
, '\'');
707 fputs_filtered ("'", stream
);
712 /* See language.h. */
714 symbol_name_matcher_ftype
*get_symbol_name_matcher_inner
715 (const lookup_name_info
&lookup_name
) const override
717 return cp_get_symbol_name_matcher (lookup_name
);
721 /* Single instance of the Fortran language class. */
723 static f_language f_language_defn
;
726 build_fortran_types (struct gdbarch
*gdbarch
)
728 struct builtin_f_type
*builtin_f_type
729 = GDBARCH_OBSTACK_ZALLOC (gdbarch
, struct builtin_f_type
);
731 builtin_f_type
->builtin_void
732 = arch_type (gdbarch
, TYPE_CODE_VOID
, TARGET_CHAR_BIT
, "void");
734 builtin_f_type
->builtin_character
735 = arch_type (gdbarch
, TYPE_CODE_CHAR
, TARGET_CHAR_BIT
, "character");
737 builtin_f_type
->builtin_logical_s1
738 = arch_boolean_type (gdbarch
, TARGET_CHAR_BIT
, 1, "logical*1");
740 builtin_f_type
->builtin_integer_s2
741 = arch_integer_type (gdbarch
, gdbarch_short_bit (gdbarch
), 0,
744 builtin_f_type
->builtin_integer_s8
745 = arch_integer_type (gdbarch
, gdbarch_long_long_bit (gdbarch
), 0,
748 builtin_f_type
->builtin_logical_s2
749 = arch_boolean_type (gdbarch
, gdbarch_short_bit (gdbarch
), 1,
752 builtin_f_type
->builtin_logical_s8
753 = arch_boolean_type (gdbarch
, gdbarch_long_long_bit (gdbarch
), 1,
756 builtin_f_type
->builtin_integer
757 = arch_integer_type (gdbarch
, gdbarch_int_bit (gdbarch
), 0,
760 builtin_f_type
->builtin_logical
761 = arch_boolean_type (gdbarch
, gdbarch_int_bit (gdbarch
), 1,
764 builtin_f_type
->builtin_real
765 = arch_float_type (gdbarch
, gdbarch_float_bit (gdbarch
),
766 "real", gdbarch_float_format (gdbarch
));
767 builtin_f_type
->builtin_real_s8
768 = arch_float_type (gdbarch
, gdbarch_double_bit (gdbarch
),
769 "real*8", gdbarch_double_format (gdbarch
));
770 auto fmt
= gdbarch_floatformat_for_type (gdbarch
, "real(kind=16)", 128);
772 builtin_f_type
->builtin_real_s16
773 = arch_float_type (gdbarch
, 128, "real*16", fmt
);
774 else if (gdbarch_long_double_bit (gdbarch
) == 128)
775 builtin_f_type
->builtin_real_s16
776 = arch_float_type (gdbarch
, gdbarch_long_double_bit (gdbarch
),
777 "real*16", gdbarch_long_double_format (gdbarch
));
779 builtin_f_type
->builtin_real_s16
780 = arch_type (gdbarch
, TYPE_CODE_ERROR
, 128, "real*16");
782 builtin_f_type
->builtin_complex_s8
783 = init_complex_type ("complex*8", builtin_f_type
->builtin_real
);
784 builtin_f_type
->builtin_complex_s16
785 = init_complex_type ("complex*16", builtin_f_type
->builtin_real_s8
);
787 if (builtin_f_type
->builtin_real_s16
->code () == TYPE_CODE_ERROR
)
788 builtin_f_type
->builtin_complex_s32
789 = arch_type (gdbarch
, TYPE_CODE_ERROR
, 256, "complex*32");
791 builtin_f_type
->builtin_complex_s32
792 = init_complex_type ("complex*32", builtin_f_type
->builtin_real_s16
);
794 return builtin_f_type
;
797 static struct gdbarch_data
*f_type_data
;
799 const struct builtin_f_type
*
800 builtin_f_type (struct gdbarch
*gdbarch
)
802 return (const struct builtin_f_type
*) gdbarch_data (gdbarch
, f_type_data
);
805 void _initialize_f_language ();
807 _initialize_f_language ()
809 f_type_data
= gdbarch_data_register_post_init (build_fortran_types
);
815 fortran_argument_convert (struct value
*value
, bool is_artificial
)
819 /* If the value is not in the inferior e.g. registers values,
820 convenience variables and user input. */
821 if (VALUE_LVAL (value
) != lval_memory
)
823 struct type
*type
= value_type (value
);
824 const int length
= TYPE_LENGTH (type
);
826 = value_as_long (value_allocate_space_in_inferior (length
));
827 write_memory (addr
, value_contents (value
), length
);
829 = value_from_contents_and_address (type
, value_contents (value
),
831 return value_addr (val
);
834 return value_addr (value
); /* Program variables, e.g. arrays. */
842 fortran_preserve_arg_pointer (struct value
*arg
, struct type
*type
)
844 if (value_type (arg
)->code () == TYPE_CODE_PTR
)
845 return value_type (arg
);