annotate gcc/fortran/trans-types.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Header for Fortran 95 types backend support.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 Copyright (C) 2002-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 Contributed by Paul Brook <paul@nowt.org>
kono
parents:
diff changeset
4 and Steven Bosscher <s.bosscher@student.tudelft.nl>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
9 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
10 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
11 version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
16 for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 #ifndef GFC_BACKEND_H
kono
parents:
diff changeset
24 #define GFC_BACKEND_H
kono
parents:
diff changeset
25
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
26
111
kono
parents:
diff changeset
27 extern GTY(()) tree gfc_array_index_type;
kono
parents:
diff changeset
28 extern GTY(()) tree gfc_array_range_type;
kono
parents:
diff changeset
29 extern GTY(()) tree gfc_character1_type_node;
kono
parents:
diff changeset
30 extern GTY(()) tree ppvoid_type_node;
kono
parents:
diff changeset
31 extern GTY(()) tree pvoid_type_node;
kono
parents:
diff changeset
32 extern GTY(()) tree prvoid_type_node;
kono
parents:
diff changeset
33 extern GTY(()) tree pchar_type_node;
kono
parents:
diff changeset
34 extern GTY(()) tree gfc_float128_type_node;
kono
parents:
diff changeset
35 extern GTY(()) tree gfc_complex_float128_type_node;
kono
parents:
diff changeset
36
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
37 /* logical_type_node is the Fortran LOGICAL type of default kind. In
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
38 addition to uses mandated by the Fortran standard, also prefer it
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
39 for compiler generated temporary variables, is it avoids some minor
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
40 issues with boolean_type_node (the C/C++ _Bool/bool). Namely:
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
41 - On x86, partial register stalls with 8/16 bit register access,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
42 and length prefix changes.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
43 - On s390 there is a compare with immediate and jump instruction,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
44 but it works only with 32-bit quantities and not 8-bit such as
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
45 boolean_type_node.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
46 */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
47 extern GTY(()) tree logical_type_node;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
48 extern GTY(()) tree logical_true_node;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
49 extern GTY(()) tree logical_false_node;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
50
111
kono
parents:
diff changeset
51 /* This is the type used to hold the lengths of character variables.
kono
parents:
diff changeset
52 It must be the same as the corresponding definition in gfortran.h. */
kono
parents:
diff changeset
53 extern GTY(()) tree gfc_charlen_type_node;
kono
parents:
diff changeset
54
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
55
111
kono
parents:
diff changeset
56 /* The following flags give us information on the correspondence of
kono
parents:
diff changeset
57 real (and complex) kinds with C floating-point types long double
kono
parents:
diff changeset
58 and __float128. */
kono
parents:
diff changeset
59 extern bool gfc_real16_is_float128;
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 enum gfc_packed {
kono
parents:
diff changeset
62 PACKED_NO = 0,
kono
parents:
diff changeset
63 PACKED_PARTIAL,
kono
parents:
diff changeset
64 PACKED_FULL,
kono
parents:
diff changeset
65 PACKED_STATIC
kono
parents:
diff changeset
66 };
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 /* be-function.c */
kono
parents:
diff changeset
69 void gfc_convert_function_code (gfc_namespace *);
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 /* trans-types.c */
kono
parents:
diff changeset
72 void gfc_init_kinds (void);
kono
parents:
diff changeset
73 void gfc_init_types (void);
kono
parents:
diff changeset
74 void gfc_init_c_interop_kinds (void);
kono
parents:
diff changeset
75
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
76 tree get_dtype_type_node (void);
111
kono
parents:
diff changeset
77 tree gfc_get_int_type (int);
kono
parents:
diff changeset
78 tree gfc_get_real_type (int);
kono
parents:
diff changeset
79 tree gfc_get_complex_type (int);
kono
parents:
diff changeset
80 tree gfc_get_logical_type (int);
kono
parents:
diff changeset
81 tree gfc_get_char_type (int);
kono
parents:
diff changeset
82 tree gfc_get_pchar_type (int);
kono
parents:
diff changeset
83 tree gfc_get_character_type (int, gfc_charlen *);
kono
parents:
diff changeset
84 tree gfc_get_character_type_len (int, tree);
kono
parents:
diff changeset
85 tree gfc_get_character_type_len_for_eltype (tree, tree);
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 tree gfc_sym_type (gfc_symbol *);
kono
parents:
diff changeset
88 tree gfc_typenode_for_spec (gfc_typespec *, int c = 0);
kono
parents:
diff changeset
89 int gfc_copy_dt_decls_ifequal (gfc_symbol *, gfc_symbol *, bool);
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 tree gfc_get_function_type (gfc_symbol *);
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 tree gfc_type_for_size (unsigned, int);
kono
parents:
diff changeset
94 tree gfc_type_for_mode (machine_mode, int);
kono
parents:
diff changeset
95 tree gfc_build_uint_type (int);
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 tree gfc_get_element_type (tree);
kono
parents:
diff changeset
98 tree gfc_get_array_type_bounds (tree, int, int, tree *, tree *, int,
kono
parents:
diff changeset
99 enum gfc_array_kind, bool);
kono
parents:
diff changeset
100 tree gfc_get_nodesc_array_type (tree, gfc_array_spec *, gfc_packed, bool);
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 /* Add a field of given name and type to a UNION_TYPE or RECORD_TYPE. */
kono
parents:
diff changeset
103 tree gfc_add_field_to_struct (tree, tree, tree, tree **);
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 /* Layout and output debugging info for a type. */
kono
parents:
diff changeset
106 void gfc_finish_type (tree);
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 /* Some functions have an extra parameter for the return value. */
kono
parents:
diff changeset
109 int gfc_return_by_reference (gfc_symbol *);
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 /* Returns true if the array sym does not require a descriptor. */
kono
parents:
diff changeset
112 int gfc_is_nodesc_array (gfc_symbol *);
kono
parents:
diff changeset
113
kono
parents:
diff changeset
114 /* Return the DTYPE for an array. */
kono
parents:
diff changeset
115 tree gfc_get_dtype_rank_type (int, tree);
kono
parents:
diff changeset
116 tree gfc_get_dtype (tree);
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 tree gfc_get_ppc_type (gfc_component *);
kono
parents:
diff changeset
119 tree gfc_get_caf_vector_type (int dim);
kono
parents:
diff changeset
120 tree gfc_get_caf_reference_type ();
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 #endif