]>
Commit | Line | Data |
---|---|---|
6de9cd9a | 1 | /* Header for Fortran 95 types backend support. |
85ec4feb | 2 | Copyright (C) 2002-2018 Free Software Foundation, Inc. |
6de9cd9a DN |
3 | Contributed by Paul Brook <paul@nowt.org> |
4 | and Steven Bosscher <s.bosscher@student.tudelft.nl> | |
5 | ||
9fc4d79b | 6 | This file is part of GCC. |
6de9cd9a | 7 | |
9fc4d79b TS |
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 | |
d234d788 | 10 | Software Foundation; either version 3, or (at your option) any later |
9fc4d79b | 11 | version. |
6de9cd9a | 12 | |
9fc4d79b TS |
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. | |
6de9cd9a DN |
17 | |
18 | You should have received a copy of the GNU General Public License | |
d234d788 NC |
19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
6de9cd9a DN |
21 | |
22 | ||
23 | #ifndef GFC_BACKEND_H | |
24 | #define GFC_BACKEND_H | |
25 | ||
6de9cd9a | 26 | extern GTY(()) tree gfc_array_index_type; |
7e6de2a5 | 27 | extern GTY(()) tree gfc_array_range_type; |
e2cad04b | 28 | extern GTY(()) tree gfc_character1_type_node; |
6de9cd9a DN |
29 | extern GTY(()) tree ppvoid_type_node; |
30 | extern GTY(()) tree pvoid_type_node; | |
10174ddf | 31 | extern GTY(()) tree prvoid_type_node; |
6de9cd9a | 32 | extern GTY(()) tree pchar_type_node; |
c65699ef JM |
33 | extern GTY(()) tree gfc_float128_type_node; |
34 | extern GTY(()) tree gfc_complex_float128_type_node; | |
7e6de2a5 | 35 | |
63ee5404 JB |
36 | /* logical_type_node is the Fortran LOGICAL type of default kind. In |
37 | addition to uses mandated by the Fortran standard, also prefer it | |
38 | for compiler generated temporary variables, is it avoids some minor | |
39 | issues with boolean_type_node (the C/C++ _Bool/bool). Namely: | |
40 | - On x86, partial register stalls with 8/16 bit register access, | |
41 | and length prefix changes. | |
42 | - On s390 there is a compare with immediate and jump instruction, | |
43 | but it works only with 32-bit quantities and not 8-bit such as | |
44 | boolean_type_node. | |
45 | */ | |
46 | extern GTY(()) tree logical_type_node; | |
47 | extern GTY(()) tree logical_true_node; | |
48 | extern GTY(()) tree logical_false_node; | |
49 | ||
d7177ab2 TS |
50 | /* This is the type used to hold the lengths of character variables. |
51 | It must be the same as the corresponding definition in gfortran.h. */ | |
c1e9bbcc JB |
52 | /* TODO: This is still hardcoded as kind=4 in some bits of the compiler |
53 | and runtime library. */ | |
d7177ab2 | 54 | extern GTY(()) tree gfc_charlen_type_node; |
6de9cd9a | 55 | |
62732c30 | 56 | /* The following flags give us information on the correspondence of |
a3c85b74 FXC |
57 | real (and complex) kinds with C floating-point types long double |
58 | and __float128. */ | |
59 | extern bool gfc_real16_is_float128; | |
60 | ||
a79683d5 | 61 | enum gfc_packed { |
dcfef7d4 TS |
62 | PACKED_NO = 0, |
63 | PACKED_PARTIAL, | |
64 | PACKED_FULL, | |
65 | PACKED_STATIC | |
a79683d5 | 66 | }; |
dcfef7d4 | 67 | |
6de9cd9a DN |
68 | /* be-function.c */ |
69 | void gfc_convert_function_code (gfc_namespace *); | |
70 | ||
71 | /* trans-types.c */ | |
5e8e542f | 72 | void gfc_init_kinds (void); |
6de9cd9a | 73 | void gfc_init_types (void); |
28d0b595 | 74 | void gfc_init_c_interop_kinds (void); |
6de9cd9a DN |
75 | |
76 | tree gfc_get_int_type (int); | |
77 | tree gfc_get_real_type (int); | |
78 | tree gfc_get_complex_type (int); | |
79 | tree gfc_get_logical_type (int); | |
374929b2 FXC |
80 | tree gfc_get_char_type (int); |
81 | tree gfc_get_pchar_type (int); | |
6de9cd9a | 82 | tree gfc_get_character_type (int, gfc_charlen *); |
40f20186 | 83 | tree gfc_get_character_type_len (int, tree); |
d393bbd7 | 84 | tree gfc_get_character_type_len_for_eltype (tree, tree); |
6de9cd9a DN |
85 | |
86 | tree gfc_sym_type (gfc_symbol *); | |
de91486c | 87 | tree gfc_typenode_for_spec (gfc_typespec *, int c = 0); |
43afc047 | 88 | int gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool); |
6de9cd9a DN |
89 | |
90 | tree gfc_get_function_type (gfc_symbol *); | |
91 | ||
92 | tree gfc_type_for_size (unsigned, int); | |
ef4bddc2 | 93 | tree gfc_type_for_mode (machine_mode, int); |
0a05c536 | 94 | tree gfc_build_uint_type (int); |
6de9cd9a DN |
95 | |
96 | tree gfc_get_element_type (tree); | |
f33beee9 | 97 | tree gfc_get_array_type_bounds (tree, int, int, tree *, tree *, int, |
de91486c | 98 | enum gfc_array_kind, bool); |
10174ddf | 99 | tree gfc_get_nodesc_array_type (tree, gfc_array_spec *, gfc_packed, bool); |
6de9cd9a DN |
100 | |
101 | /* Add a field of given name and type to a UNION_TYPE or RECORD_TYPE. */ | |
35151cd5 | 102 | tree gfc_add_field_to_struct (tree, tree, tree, tree **); |
6de9cd9a DN |
103 | |
104 | /* Layout and output debugging info for a type. */ | |
105 | void gfc_finish_type (tree); | |
106 | ||
107 | /* Some functions have an extra parameter for the return value. */ | |
108 | int gfc_return_by_reference (gfc_symbol *); | |
109 | ||
110 | /* Returns true if the array sym does not require a descriptor. */ | |
111 | int gfc_is_nodesc_array (gfc_symbol *); | |
112 | ||
40b026d8 | 113 | /* Return the DTYPE for an array. */ |
d7463e5b | 114 | tree gfc_get_dtype_rank_type (int, tree); |
40b026d8 PB |
115 | tree gfc_get_dtype (tree); |
116 | ||
713485cc | 117 | tree gfc_get_ppc_type (gfc_component *); |
b5116268 | 118 | tree gfc_get_caf_vector_type (int dim); |
3c9f5092 | 119 | tree gfc_get_caf_reference_type (); |
713485cc | 120 | |
6de9cd9a | 121 | #endif |