]>
Commit | Line | Data |
---|---|---|
6de9cd9a | 1 | /* Header for code constant translation functions |
818ab71a | 2 | Copyright (C) 2002-2016 Free Software Foundation, Inc. |
6de9cd9a DN |
3 | Contributed by Paul Brook |
4 | ||
9fc4d79b | 5 | This file is part of GCC. |
6de9cd9a | 6 | |
9fc4d79b TS |
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 | |
d234d788 | 9 | Software Foundation; either version 3, or (at your option) any later |
9fc4d79b | 10 | version. |
6de9cd9a | 11 | |
9fc4d79b TS |
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. | |
6de9cd9a DN |
16 | |
17 | You should have received a copy of the GNU General Public License | |
d234d788 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
6de9cd9a | 20 | |
18452a7d | 21 | /* Converts between INT_CST and GMP integer representations. */ |
6de9cd9a | 22 | tree gfc_conv_mpz_to_tree (mpz_t, int); |
18452a7d | 23 | void gfc_conv_tree_to_mpz (mpz_t, tree); |
6de9cd9a | 24 | |
18452a7d | 25 | /* Converts between REAL_CST and MPFR floating-point representations. */ |
346a77d1 | 26 | tree gfc_conv_mpfr_to_tree (mpfr_t, int, int); |
18452a7d | 27 | void gfc_conv_tree_to_mpfr (mpfr_ptr, tree); |
6de9cd9a | 28 | |
a67189d4 FXC |
29 | /* Build a tree containing a real infinity (or HUGE if infinities are |
30 | not supported for the given type. */ | |
31 | tree gfc_build_inf_or_huge (tree, int); | |
32 | ||
565fad70 FXC |
33 | /* Build a tree containing a NaN for the given type, with significand |
34 | specified by second argument. */ | |
35 | tree gfc_build_nan (tree, const char *); | |
36 | ||
6de9cd9a DN |
37 | /* Build a tree for a constant. Must be an EXPR_CONSTANT gfc_expr. |
38 | For CHARACTER literal constants, the caller still has to set the | |
39 | string length as a separate operation. */ | |
40 | tree gfc_conv_constant_to_tree (gfc_expr *); | |
41 | ||
42 | /* Like gfc_conv_noncharacter_constant, but works on simplified expression | |
43 | structures. Also sets the length of CHARACTER strings in the gfc_se. */ | |
44 | void gfc_conv_constant (gfc_se *, gfc_expr *); | |
45 | ||
46 | tree gfc_build_string_const (int, const char *); | |
d393bbd7 | 47 | tree gfc_build_wide_string_const (int, int, const gfc_char_t *); |
95638988 | 48 | tree gfc_build_cstring_const (const char *); |
ee37d2f5 | 49 | tree gfc_build_localized_cstring_const (const char *); |
6de9cd9a DN |
50 | |
51 | /* Translate a string constant for a static initializer. */ | |
52 | tree gfc_conv_string_init (tree, gfc_expr *); | |
53 | ||
54 | /* Create a tree node for the string length if it is constant. */ | |
55 | void gfc_conv_const_charlen (gfc_charlen *); | |
56 | ||
1f2959f0 | 57 | /* Initialize the nodes for constants. */ |
6de9cd9a DN |
58 | void gfc_init_constants (void); |
59 | ||
60 | /* Build a constant with given type from an int_cst. */ | |
61 | tree gfc_build_const (tree, tree); | |
62 | ||
6de9cd9a DN |
63 | /* Integer constants 0..GFC_MAX_DIMENSIONS. */ |
64 | extern GTY(()) tree gfc_rank_cst[GFC_MAX_DIMENSIONS + 1]; | |
7ab92584 | 65 | |
6de9cd9a | 66 | #define gfc_index_zero_node gfc_rank_cst[0] |
7ab92584 | 67 | #define gfc_index_one_node gfc_rank_cst[1] |