1 /* Header for code constant translation functions
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 Contributed by Paul Brook
5 This file is part of GNU G95.
7 GNU G95 is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU G95 is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU G95; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Returns an INT_CST. */
23 tree gfc_conv_mpz_to_tree (mpz_t, int);
25 /* Returns a REAL_CST. */
26 tree gfc_conv_mpf_to_tree (mpf_t, int);
28 /* Build a tree for a constant. Must be an EXPR_CONSTANT gfc_expr.
29 For CHARACTER literal constants, the caller still has to set the
30 string length as a separate operation. */
31 tree gfc_conv_constant_to_tree (gfc_expr *);
33 /* Like gfc_conv_noncharacter_constant, but works on simplified expression
34 structures. Also sets the length of CHARACTER strings in the gfc_se. */
35 void gfc_conv_constant (gfc_se *, gfc_expr *);
37 tree gfc_build_string_const (int, const char *);
39 /* Translate a string constant for a static initializer. */
40 tree gfc_conv_string_init (tree, gfc_expr *);
42 /* Create a tree node for the string length if it is constant. */
43 void gfc_conv_const_charlen (gfc_charlen *);
45 /* Initialise the nodes for constants. */
46 void gfc_init_constants (void);
48 /* Build a constant with given type from an int_cst. */
49 tree gfc_build_const (tree, tree);
51 /* String constants. */
52 extern GTY(()) tree gfc_strconst_current_filename;
53 extern GTY(()) tree gfc_strconst_bounds;
54 extern GTY(()) tree gfc_strconst_fault;
55 extern GTY(()) tree gfc_strconst_wrong_return;
57 /* Integer constants 0..GFC_MAX_DIMENSIONS. */
58 extern GTY(()) tree gfc_rank_cst[GFC_MAX_DIMENSIONS + 1];
59 #define gfc_index_zero_node gfc_rank_cst[0]