1 /* Simulate storage of variables into target memory, header. 2 Copyright (C) 2007-2021 Free Software Foundation, Inc. 3 Contributed by Paul Thomas and Brooks Moses 4 5 This file is part of GCC. 6 7 GCC is free software; you can redistribute it and/or modify it under 8 the terms of the GNU General Public License as published by the Free 9 Software Foundation; either version 3, or (at your option) any later 10 version. 11 12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13 WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with GCC; see the file COPYING3. If not see 19 <http://www.gnu.org/licenses/>. */ 20 21 #ifndef GFC_TARGET_MEMORY_H 22 #define GFC_TARGET_MEMORY_H 23 24 /* Convert a BOZ to REAL or COMPLEX. */ 25 bool gfc_convert_boz (gfc_expr *, gfc_typespec *); 26 27 bool gfc_element_size (gfc_expr *, size_t *); 28 bool gfc_target_expr_size (gfc_expr *, size_t *); 29 30 /* Write a constant expression in binary form to a target buffer. */ 31 size_t gfc_encode_character (int, size_t, const gfc_char_t *, unsigned char *, 32 size_t); 33 unsigned HOST_WIDE_INT gfc_target_encode_expr (gfc_expr *, unsigned char *, 34 size_t); 35 36 /* Read a target buffer into a constant expression. */ 37 38 int gfc_interpret_integer (int, unsigned char *, size_t, mpz_t); 39 int gfc_interpret_float (int, unsigned char *, size_t, mpfr_t); 40 int gfc_interpret_complex (int, unsigned char *, size_t, mpc_t); 41 int gfc_interpret_logical (int, unsigned char *, size_t, int *); 42 size_t gfc_interpret_character (unsigned char *, size_t, gfc_expr *); 43 int gfc_interpret_derived (unsigned char *, size_t, gfc_expr *); 44 size_t gfc_target_interpret_expr (unsigned char *, size_t, gfc_expr *, bool); 45 46 /* Merge overlapping equivalence initializers for trans-common.c. */ 47 size_t gfc_merge_initializers (gfc_typespec, gfc_expr *, locus *, 48 unsigned char *, unsigned char *, 49 size_t); 50 51 #endif /* GFC_TARGET_MEMORY_H */ 52