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