annotate gcc/fortran/libgfortran.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Header file to the Fortran front-end and runtime library
kono
parents:
diff changeset
2 Copyright (C) 2007-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 /* Flags to specify which standard/extension contains a feature.
kono
parents:
diff changeset
22 Note that no features were obsoleted nor deleted in F2003.
kono
parents:
diff changeset
23 Please remember to keep those definitions in sync with
kono
parents:
diff changeset
24 gfortran.texi. */
kono
parents:
diff changeset
25 /* For now, use F2015 = GFC_STD_GNU. */
kono
parents:
diff changeset
26 #define GFC_STD_F2015 (1<<5) /* PLACEHOLDER for Fortran 2015. */
kono
parents:
diff changeset
27 #define GFC_STD_F2008_TS (1<<9) /* POST-F2008 technical reports. */
kono
parents:
diff changeset
28 #define GFC_STD_F2008_OBS (1<<8) /* Obsolescent in F2008. */
kono
parents:
diff changeset
29 #define GFC_STD_F2008 (1<<7) /* New in F2008. */
kono
parents:
diff changeset
30 #define GFC_STD_LEGACY (1<<6) /* Backward compatibility. */
kono
parents:
diff changeset
31 #define GFC_STD_GNU (1<<5) /* GNU Fortran extension. */
kono
parents:
diff changeset
32 #define GFC_STD_F2003 (1<<4) /* New in F2003. */
kono
parents:
diff changeset
33 #define GFC_STD_F95 (1<<3) /* New in F95. */
kono
parents:
diff changeset
34 #define GFC_STD_F95_DEL (1<<2) /* Deleted in F95. */
kono
parents:
diff changeset
35 #define GFC_STD_F95_OBS (1<<1) /* Obsolescent in F95. */
kono
parents:
diff changeset
36 #define GFC_STD_F77 (1<<0) /* Included in F77, but not deleted or
kono
parents:
diff changeset
37 obsolescent in later standards. */
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 /* Bitmasks for the various FPE that can be enabled. These need to be straight integers
kono
parents:
diff changeset
41 e.g., 8 instead of (1<<3), because they will be included in Fortran source. */
kono
parents:
diff changeset
42 #define GFC_FPE_INVALID 1
kono
parents:
diff changeset
43 #define GFC_FPE_DENORMAL 2
kono
parents:
diff changeset
44 #define GFC_FPE_ZERO 4
kono
parents:
diff changeset
45 #define GFC_FPE_OVERFLOW 8
kono
parents:
diff changeset
46 #define GFC_FPE_UNDERFLOW 16
kono
parents:
diff changeset
47 #define GFC_FPE_INEXACT 32
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 /* Defines for floating-point rounding modes. */
kono
parents:
diff changeset
50 #define GFC_FPE_DOWNWARD 1
kono
parents:
diff changeset
51 #define GFC_FPE_TONEAREST 2
kono
parents:
diff changeset
52 #define GFC_FPE_TOWARDZERO 3
kono
parents:
diff changeset
53 #define GFC_FPE_UPWARD 4
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 /* Size of the buffer required to store FPU state for any target.
kono
parents:
diff changeset
56 In particular, this has to be larger than fenv_t on all glibc targets.
kono
parents:
diff changeset
57 Currently, the winner is x86_64 with 32 bytes. */
kono
parents:
diff changeset
58 #define GFC_FPE_STATE_BUFFER_SIZE 32
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 /* Bitmasks for the various runtime checks that can be enabled. */
kono
parents:
diff changeset
61 #define GFC_RTCHECK_BOUNDS (1<<0)
kono
parents:
diff changeset
62 #define GFC_RTCHECK_ARRAY_TEMPS (1<<1)
kono
parents:
diff changeset
63 #define GFC_RTCHECK_RECURSION (1<<2)
kono
parents:
diff changeset
64 #define GFC_RTCHECK_DO (1<<3)
kono
parents:
diff changeset
65 #define GFC_RTCHECK_POINTER (1<<4)
kono
parents:
diff changeset
66 #define GFC_RTCHECK_MEM (1<<5)
kono
parents:
diff changeset
67 #define GFC_RTCHECK_ALL (GFC_RTCHECK_BOUNDS | GFC_RTCHECK_ARRAY_TEMPS \
kono
parents:
diff changeset
68 | GFC_RTCHECK_RECURSION | GFC_RTCHECK_DO \
kono
parents:
diff changeset
69 | GFC_RTCHECK_POINTER | GFC_RTCHECK_MEM)
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 /* Special unit numbers used to convey certain conditions. Numbers -4
kono
parents:
diff changeset
72 thru -9 available. NEWUNIT values start at -10. */
kono
parents:
diff changeset
73 #define GFC_INTERNAL_UNIT -1 /* KIND=1 Internal Unit. */
kono
parents:
diff changeset
74 #define GFC_INTERNAL_UNIT4 -2 /* KIND=4 Internal Unit. */
kono
parents:
diff changeset
75 #define GFC_INVALID_UNIT -3
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 /* Possible values for the CONVERT I/O specifier. */
kono
parents:
diff changeset
78 /* Keep in sync with GFC_FLAG_CONVERT_* in gcc/flags.h. */
kono
parents:
diff changeset
79 typedef enum
kono
parents:
diff changeset
80 {
kono
parents:
diff changeset
81 GFC_CONVERT_NONE = -1,
kono
parents:
diff changeset
82 GFC_CONVERT_NATIVE = 0,
kono
parents:
diff changeset
83 GFC_CONVERT_SWAP,
kono
parents:
diff changeset
84 GFC_CONVERT_BIG,
kono
parents:
diff changeset
85 GFC_CONVERT_LITTLE
kono
parents:
diff changeset
86 }
kono
parents:
diff changeset
87 unit_convert;
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 /* Runtime errors. */
kono
parents:
diff changeset
91 typedef enum
kono
parents:
diff changeset
92 {
kono
parents:
diff changeset
93 LIBERROR_FIRST = -3, /* Marker for the first error. */
kono
parents:
diff changeset
94 LIBERROR_EOR = -2, /* End of record, must be negative. */
kono
parents:
diff changeset
95 LIBERROR_END = -1, /* End of file, must be negative. */
kono
parents:
diff changeset
96 LIBERROR_OK = 0, /* Indicates success, must be zero. */
kono
parents:
diff changeset
97 LIBERROR_OS = 5000, /* OS error, more info in errno. */
kono
parents:
diff changeset
98 LIBERROR_OPTION_CONFLICT,
kono
parents:
diff changeset
99 LIBERROR_BAD_OPTION,
kono
parents:
diff changeset
100 LIBERROR_MISSING_OPTION,
kono
parents:
diff changeset
101 LIBERROR_ALREADY_OPEN,
kono
parents:
diff changeset
102 LIBERROR_BAD_UNIT,
kono
parents:
diff changeset
103 LIBERROR_FORMAT,
kono
parents:
diff changeset
104 LIBERROR_BAD_ACTION,
kono
parents:
diff changeset
105 LIBERROR_ENDFILE,
kono
parents:
diff changeset
106 LIBERROR_BAD_US,
kono
parents:
diff changeset
107 LIBERROR_READ_VALUE,
kono
parents:
diff changeset
108 LIBERROR_READ_OVERFLOW,
kono
parents:
diff changeset
109 LIBERROR_INTERNAL,
kono
parents:
diff changeset
110 LIBERROR_INTERNAL_UNIT,
kono
parents:
diff changeset
111 LIBERROR_ALLOCATION,
kono
parents:
diff changeset
112 LIBERROR_DIRECT_EOR,
kono
parents:
diff changeset
113 LIBERROR_SHORT_RECORD,
kono
parents:
diff changeset
114 LIBERROR_CORRUPT_FILE,
kono
parents:
diff changeset
115 LIBERROR_INQUIRE_INTERNAL_UNIT, /* Must be different from STAT_STOPPED_IMAGE. */
kono
parents:
diff changeset
116 LIBERROR_LAST /* Not a real error, the last error # + 1. */
kono
parents:
diff changeset
117 }
kono
parents:
diff changeset
118 libgfortran_error_codes;
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 /* Must kept in sync with libgfortran/caf/libcaf.h. */
kono
parents:
diff changeset
121 typedef enum
kono
parents:
diff changeset
122 {
kono
parents:
diff changeset
123 GFC_STAT_UNLOCKED = 0,
kono
parents:
diff changeset
124 GFC_STAT_LOCKED,
kono
parents:
diff changeset
125 GFC_STAT_LOCKED_OTHER_IMAGE,
kono
parents:
diff changeset
126 GFC_STAT_STOPPED_IMAGE = 6000, /* See LIBERROR_INQUIRE_INTERNAL_UNIT above. */
kono
parents:
diff changeset
127 GFC_STAT_FAILED_IMAGE = 6001
kono
parents:
diff changeset
128 }
kono
parents:
diff changeset
129 libgfortran_stat_codes;
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 typedef enum
kono
parents:
diff changeset
132 {
kono
parents:
diff changeset
133 GFC_CAF_ATOMIC_ADD = 1,
kono
parents:
diff changeset
134 GFC_CAF_ATOMIC_AND,
kono
parents:
diff changeset
135 GFC_CAF_ATOMIC_OR,
kono
parents:
diff changeset
136 GFC_CAF_ATOMIC_XOR
kono
parents:
diff changeset
137 } libcaf_atomic_codes;
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139
kono
parents:
diff changeset
140 /* For CO_REDUCE. */
kono
parents:
diff changeset
141 #define GFC_CAF_BYREF (1<<0)
kono
parents:
diff changeset
142 #define GFC_CAF_HIDDENLEN (1<<1)
kono
parents:
diff changeset
143 #define GFC_CAF_ARG_VALUE (1<<2)
kono
parents:
diff changeset
144 #define GFC_CAF_ARG_DESC (1<<3)
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 /* Default unit number for preconnected standard input and output. */
kono
parents:
diff changeset
148 #define GFC_STDIN_UNIT_NUMBER 5
kono
parents:
diff changeset
149 #define GFC_STDOUT_UNIT_NUMBER 6
kono
parents:
diff changeset
150 #define GFC_STDERR_UNIT_NUMBER 0
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 /* FIXME: Increase to 15 for Fortran 2008. Also needs changes to
kono
parents:
diff changeset
154 GFC_DTYPE_RANK_MASK. See PR 36825. */
kono
parents:
diff changeset
155 #define GFC_MAX_DIMENSIONS 7
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 #define GFC_DTYPE_RANK_MASK 0x07
kono
parents:
diff changeset
158 #define GFC_DTYPE_TYPE_SHIFT 3
kono
parents:
diff changeset
159 #define GFC_DTYPE_TYPE_MASK 0x38
kono
parents:
diff changeset
160 #define GFC_DTYPE_SIZE_SHIFT 6
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 /* Basic types. BT_VOID is used by ISO C Binding so funcs like c_f_pointer
kono
parents:
diff changeset
163 can take any arg with the pointer attribute as a param. These are also
kono
parents:
diff changeset
164 used in the run-time library for IO. */
kono
parents:
diff changeset
165 typedef enum
kono
parents:
diff changeset
166 { BT_UNKNOWN = 0, BT_INTEGER, BT_LOGICAL, BT_REAL, BT_COMPLEX,
kono
parents:
diff changeset
167 BT_DERIVED, BT_CHARACTER, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID,
kono
parents:
diff changeset
168 BT_ASSUMED, BT_UNION
kono
parents:
diff changeset
169 }
kono
parents:
diff changeset
170 bt;