GCC Middle and Back End API Reference
coretypes.h
Go to the documentation of this file.
1/* GCC core type declarations.
2 Copyright (C) 2002-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16Under Section 7 of GPL version 3, you are granted additional
17permissions described in the GCC Runtime Library Exception, version
183.1, as published by the Free Software Foundation.
19
20You should have received a copy of the GNU General Public License and
21a copy of the GCC Runtime Library Exception along with this program;
22see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23<http://www.gnu.org/licenses/>. */
24
25/* Provide forward declarations of core types which are referred to by
26 most of the compiler. This allows header files to use these types
27 (e.g. in function prototypes) without concern for whether the full
28 definitions are visible. Some other declarations that need to be
29 universally visible are here, too.
30
31 In the context of tconfig.h, most of these have special definitions
32 which prevent them from being used except in further type
33 declarations. This is a kludge; the right thing is to avoid
34 including the "tm.h" header set in the context of tconfig.h, but
35 we're not there yet. */
36
37#ifndef GCC_CORETYPES_H
38#define GCC_CORETYPES_H
39
40#ifndef GTY
41#define GTY(x) /* nothing - marker for gengtype */
42#endif
43
44#ifndef USED_FOR_TARGET
45
46typedef int64_t gcov_type;
47typedef uint64_t gcov_type_unsigned;
48
49struct bitmap_obstack;
50class bitmap_head;
51typedef class bitmap_head *bitmap;
52typedef const class bitmap_head *const_bitmap;
54typedef struct simple_bitmap_def *sbitmap;
55typedef const struct simple_bitmap_def *const_sbitmap;
56struct rtx_def;
57typedef struct rtx_def *rtx;
58typedef const struct rtx_def *const_rtx;
59class scalar_mode;
60class scalar_int_mode;
62class complex_mode;
63class fixed_size_mode;
64template<typename> class opt_mode;
68template<typename> struct pod_mode;
72
73/* Subclasses of rtx_def, using indentation to show the class
74 hierarchy, along with the relevant invariant.
75 Where possible, keep this list in the same order as in rtl.def. */
76struct rtx_def;
77 struct rtx_expr_list; /* GET_CODE (X) == EXPR_LIST */
78 struct rtx_insn_list; /* GET_CODE (X) == INSN_LIST */
79 struct rtx_sequence; /* GET_CODE (X) == SEQUENCE */
80 struct rtx_insn;
81 struct rtx_debug_insn; /* DEBUG_INSN_P (X) */
82 struct rtx_nonjump_insn; /* NONJUMP_INSN_P (X) */
83 struct rtx_jump_insn; /* JUMP_P (X) */
84 struct rtx_call_insn; /* CALL_P (X) */
85 struct rtx_jump_table_data; /* JUMP_TABLE_DATA_P (X) */
86 struct rtx_barrier; /* BARRIER_P (X) */
87 struct rtx_code_label; /* LABEL_P (X) */
88 struct rtx_note; /* NOTE_P (X) */
89
90struct rtvec_def;
91typedef struct rtvec_def *rtvec;
92typedef const struct rtvec_def *const_rtvec;
93struct hwivec_def;
94typedef struct hwivec_def *hwivec;
95typedef const struct hwivec_def *const_hwivec;
96union tree_node;
97typedef union tree_node *tree;
98typedef const union tree_node *const_tree;
99struct gimple;
102class code_helper;
103enum tree_index : unsigned;
104
105/* Forward declare rtx_code, so that we can use it in target hooks without
106 needing to pull in rtl.h. */
107enum rtx_code : unsigned;
108/* Forward declare tree_code, so that we can use it in target hooks without
109 needing to pull in tree-core.h. */
110enum tree_code : unsigned;
111
112/* Forward decls for leaf gimple subclasses (for individual gimple codes).
113 Keep this in the same order as the corresponding codes in gimple.def. */
114
115struct gcond;
116struct gdebug;
117struct ggoto;
118struct glabel;
119struct gswitch;
120struct gassign;
121struct gasm;
122struct gcall;
123struct gtransaction;
124struct greturn;
125struct gbind;
126struct gcatch;
127struct geh_filter;
128struct geh_mnt;
129struct geh_else;
130struct gresx;
131struct geh_dispatch;
132struct gphi;
133struct gtry;
134struct gomp_atomic_load;
135struct gomp_atomic_store;
136struct gomp_continue;
137struct gomp_critical;
138struct gomp_ordered;
139struct gomp_for;
140struct gomp_parallel;
141struct gomp_task;
142struct gomp_sections;
143struct gomp_single;
144struct gomp_target;
145struct gomp_teams;
146
147/* Forward declaration of CFI's and DWARF's types. */
148struct dw_cfi_node;
149using dw_cfi_ref = struct dw_cfi_node *;
150enum dw_cfi_oprnd_type: int;
151enum dwarf_call_frame_info: int;
152
153/* Subclasses of toplevel_node, using indentation to show the class
154 hierarchy. */
155
156struct toplevel_node;
157 struct asm_node;
158 struct symtab_node;
159 struct cgraph_node;
160 struct varpool_node;
161struct cgraph_edge;
162
163union section;
164typedef union section section;
165struct gcc_options;
166struct cl_target_option;
167struct cl_optimization;
168struct cl_option;
169struct cl_decoded_option;
170struct cl_option_handlers;
171class rich_location;
172namespace diagnostics {
173 class context;
174 class text_sink;
175} // namespace diagnostics
176class pretty_printer;
178typedef const char * (*diagnostic_input_charset_callback)(const char *);
179namespace pp_markup { class element; }
181
182template<typename T> struct array_traits;
183
184/* Provides a read-only bitmap view of a single integer bitmask or an
185 array of integer bitmasks, or of a wrapper around such bitmasks. */
186template<typename T, typename Traits = array_traits<T>,
187 bool has_constant_size = Traits::has_constant_size>
189
190/* Address space number for named address space support. */
191typedef unsigned char addr_space_t;
192
193/* The value of addr_space_t that represents the generic address space. */
194#define ADDR_SPACE_GENERIC 0
195#define ADDR_SPACE_GENERIC_P(AS) ((AS) == ADDR_SPACE_GENERIC)
196
197/* The major intermediate representations of GCC. */
203
204/* Provide forward struct declaration so that we don't have to include
205 all of cpplib.h whenever a random prototype includes a pointer.
206 Note that the cpp_reader and cpp_token typedefs remain part of
207 cpplib.h. */
208
209struct cpp_reader;
210struct cpp_token;
211
212/* The thread-local storage model associated with a given VAR_DECL
213 or SYMBOL_REF. This isn't used much, but both trees and RTL refer
214 to it, so it's here. */
224
225/* Types of trampoline implementation. */
230
231/* Types of ABI for an offload compiler. */
237
238/* Types of profile update methods. */
244
245/* Type of profile reproducibility methods. */
251
252/* Type of -fstack-protector-*. */
259
260/* Types of unwind/exception handling info that can be generated.
261 Note that a UI_TARGET (or larger) setting is considered to be
262 incompatible with -freorder-blocks-and-partition. */
263
272
273/* Callgraph node profile representation. */
275 /* This function most likely won't be executed at all.
276 (set only when profile feedback is available or via function attribute). */
278 /* For functions that are known to be executed once (i.e. constructors, destructors
279 and main function. */
281 /* The default value. */
283 /* Optimize this function hard
284 (set only when profile feedback is available or via function attribute). */
286};
287
288/* Ways of optimizing code. */
290 /* Prioritize speed over size. */
292
293 /* Only do things that are good for both size and speed. */
295
296 /* Prioritize size over speed. */
298};
299
300/* Enumerates a padding direction. */
302 /* No padding is required. */
304
305 /* Insert padding above the data, i.e. at higher memory addresses
306 when dealing with memory, and at the most significant end when
307 dealing with registers. */
309
310 /* Insert padding below the data, i.e. at lower memory addresses
311 when dealing with memory, and at the least significant end when
312 dealing with registers. */
314};
315
316/* Possible initialization status of a variable. When requested
317 by the user, this information is tracked and recorded in the DWARF
318 debug information, along with the variable's location. */
325
326/* Kind of artificial, compiler-generated lookup table. Type of the
327 second argument of TARGET_ADDR_SPACE_FOR_ARTIFICIAL_RODATA resp.
328 targetm.addr_space.for_artificial_rodata. */
330{
331 /* Generated by tree-switch-conversion.cc: Lowered GIMPLE_SWITCH expressions
332 to something more efficient than a jump table. */
334
335 /* Generated by gimple-crc-optimization.cc: CRC optimization. */
337};
338
339/* The type of an alias set. Code currently assumes that variables of
340 this type can take the values 0 (the alias set which aliases
341 everything) and -1 (sometimes indicating that the alias set is
342 unknown, sometimes indicating a memory barrier) and -2 (indicating
343 that the alias set should be set to a unique value but has not been
344 set yet). */
345typedef int alias_set_type;
346
347class edge_def;
348typedef class edge_def *edge;
349typedef const class edge_def *const_edge;
350struct basic_block_def;
352typedef const struct basic_block_def *const_basic_block;
353
354#if !defined (GENERATOR_FILE)
355# define OBSTACK_CHUNK_SIZE memory_block_pool::block_size
356# define obstack_chunk_alloc mempool_obstack_chunk_alloc
357# define obstack_chunk_free mempool_obstack_chunk_free
358#else
359# define OBSTACK_CHUNK_SIZE 0
360# define obstack_chunk_alloc xmalloc
361# define obstack_chunk_free free
362#endif
363
364#define gcc_obstack_init(OBSTACK) \
365 obstack_specify_allocation ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
366 obstack_chunk_alloc, \
367 obstack_chunk_free)
368
369/* enum reg_class is target specific, so it should not appear in
370 target-independent code or interfaces, like the target hook declarations
371 in target.h. */
372typedef int reg_class_t;
373
374class rtl_opt_pass;
375
376namespace gcc {
377 class context;
378}
379
380typedef std::pair <tree, tree> tree_pair;
381typedef std::pair <const char *, int> string_int_pair;
382
383/* Define a name->value mapping. */
384template <typename ValueType>
386{
387 const char *const name; /* the name of the value */
388 const ValueType value; /* the value of the name */
389};
390
391#else
392
393struct _dont_use_rtx_here_;
394struct _dont_use_rtvec_here_;
395struct _dont_use_rtx_insn_here_;
396union _dont_use_tree_here_;
397#define rtx struct _dont_use_rtx_here_ *
398#define const_rtx struct _dont_use_rtx_here_ *
399#define rtvec struct _dont_use_rtvec_here *
400#define const_rtvec struct _dont_use_rtvec_here *
401#define rtx_insn struct _dont_use_rtx_insn_here_
402#define tree union _dont_use_tree_here_ *
403#define const_tree union _dont_use_tree_here_ *
404
405typedef struct scalar_mode scalar_mode;
406typedef struct scalar_int_mode scalar_int_mode;
408typedef struct complex_mode complex_mode;
409
410#endif
411
412/* Classes of functions that compiler needs to check
413 whether they are present at the runtime or not. */
423
424/* Enumerate visibility settings. This is deliberately ordered from most
425 to least visibility. */
433
434/* enums used by the targetm.excess_precision hook. */
435
444
452
453/* Level of size optimization. */
454
456{
457 /* Do not optimize for size. */
459 /* Optimize for size but not at extreme performance costs. */
461 /* Optimize for size as much as possible. */
463};
464
465/* Support for user-provided GGC and PCH markers. The first parameter
466 is a pointer to a pointer, the second either NULL if the pointer to
467 pointer points into a GC object or the actual pointer address if
468 the first argument points to a temporary and the third a cookie. */
469typedef void (*gt_pointer_operator) (void *, void *, void *);
470
471#if !defined (HAVE_UCHAR)
472typedef unsigned char uchar;
473#endif
474
475/* Most source files will require the following headers. */
476#if !defined (USED_FOR_TARGET)
477#include "insn-modes.h"
478#include "signop.h"
479#include "wide-int.h"
480#include "wide-int-print.h"
481
482/* On targets that don't need polynomial offsets, target-specific code
483 should be able to treat poly_int like a normal constant, with a
484 conversion operator going from the former to the latter. We also
485 allow this for gencondmd.cc for all targets, so that we can treat
486 machine_modes as enums without causing build failures. */
487#if (defined (IN_TARGET_CODE) \
488 && (defined (USE_ENUM_MODES) || NUM_POLY_INT_COEFFS == 1))
489#define POLY_INT_CONVERSION 1
490#else
491#define POLY_INT_CONVERSION 0
492#endif
493
494#include "poly-int.h"
495#include "poly-int-types.h"
496#include "insn-modes-inline.h"
497#include "machmode.h"
498#include "double-int.h"
499#include "align.h"
500/* Most host source files will require the following headers. */
501#if !defined (GENERATOR_FILE)
502#include "iterator-utils.h"
503#include "real.h"
504#include "fixed-value.h"
505#include "hash-table.h"
506#include "hash-set.h"
507#include "input.h"
508#include "is-a.h"
509#include "memory-block.h"
510#include "dumpfile.h"
511#endif
512#endif /* GENERATOR_FILE && !USED_FOR_TARGET */
513
514#endif /* coretypes.h */
Definition bitmap.h:330
Definition coretypes.h:188
Definition cgraph.h:1872
Definition tree.h:82
Definition machmode.h:543
Definition event-id.h:39
Definition basic-block.h:26
Definition machmode.h:833
Definition machmode.h:263
Definition pretty-print-markup.h:66
Definition pretty-print.h:241
Definition tree-pass.h:127
Definition machmode.h:465
Definition machmode.h:437
Definition machmode.h:493
struct basic_block_def * basic_block
Definition coretypes.h:351
struct rtx_def * rtx
Definition coretypes.h:57
opt_mode< scalar_float_mode > opt_scalar_float_mode
Definition coretypes.h:67
unwind_info_type
Definition coretypes.h:265
@ UI_SJLJ
Definition coretypes.h:267
@ UI_DWARF2
Definition coretypes.h:268
@ UI_SEH
Definition coretypes.h:269
@ UI_NONE
Definition coretypes.h:266
@ UI_TARGET
Definition coretypes.h:270
unsigned char addr_space_t
Definition coretypes.h:191
struct dw_cfi_node * dw_cfi_ref
Definition coretypes.h:149
var_init_status
Definition coretypes.h:320
@ VAR_INIT_STATUS_UNKNOWN
Definition coretypes.h:321
@ VAR_INIT_STATUS_UNINITIALIZED
Definition coretypes.h:322
@ VAR_INIT_STATUS_INITIALIZED
Definition coretypes.h:323
optimize_size_level
Definition coretypes.h:456
@ OPTIMIZE_SIZE_BALANCED
Definition coretypes.h:460
@ OPTIMIZE_SIZE_NO
Definition coretypes.h:458
@ OPTIMIZE_SIZE_MAX
Definition coretypes.h:462
class edge_def * edge
Definition coretypes.h:348
gimple * gimple_seq
Definition coretypes.h:100
offload_abi
Definition coretypes.h:232
@ OFFLOAD_ABI_UNSET
Definition coretypes.h:233
@ OFFLOAD_ABI_LP64
Definition coretypes.h:234
@ OFFLOAD_ABI_ILP32
Definition coretypes.h:235
pod_mode< scalar_mode > scalar_mode_pod
Definition coretypes.h:69
ir_type
Definition coretypes.h:198
@ IR_RTL_CFGRTL
Definition coretypes.h:200
@ IR_RTL_CFGLAYOUT
Definition coretypes.h:201
@ IR_GIMPLE
Definition coretypes.h:199
const struct rtvec_def * const_rtvec
Definition coretypes.h:92
tls_model
Definition coretypes.h:215
@ TLS_MODEL_NONE
Definition coretypes.h:216
@ TLS_MODEL_LOCAL_DYNAMIC
Definition coretypes.h:220
@ TLS_MODEL_LOCAL_EXEC
Definition coretypes.h:222
@ TLS_MODEL_INITIAL_EXEC
Definition coretypes.h:221
@ TLS_MODEL_EMULATED
Definition coretypes.h:217
@ TLS_MODEL_REAL
Definition coretypes.h:218
@ TLS_MODEL_GLOBAL_DYNAMIC
Definition coretypes.h:219
pod_mode< scalar_int_mode > scalar_int_mode_pod
Definition coretypes.h:70
stack_protector
Definition coretypes.h:253
@ SPCT_FLAG_STRONG
Definition coretypes.h:256
@ SPCT_FLAG_DEFAULT
Definition coretypes.h:254
@ SPCT_FLAG_ALL
Definition coretypes.h:255
@ SPCT_FLAG_EXPLICIT
Definition coretypes.h:257
unsigned char uchar
Definition coretypes.h:472
const struct rtx_def * const_rtx
Definition coretypes.h:58
std::pair< const char *, int > string_int_pair
Definition coretypes.h:381
function_class
Definition coretypes.h:414
@ function_c99_math_complex
Definition coretypes.h:417
@ function_c23_misc
Definition coretypes.h:420
@ function_sincos
Definition coretypes.h:418
@ function_c94
Definition coretypes.h:415
@ function_c11_misc
Definition coretypes.h:419
@ function_c2y_misc
Definition coretypes.h:421
@ function_c99_misc
Definition coretypes.h:416
uint64_t gcov_type_unsigned
Definition coretypes.h:47
symbol_visibility
Definition coretypes.h:427
@ VISIBILITY_HIDDEN
Definition coretypes.h:430
@ VISIBILITY_DEFAULT
Definition coretypes.h:428
@ VISIBILITY_INTERNAL
Definition coretypes.h:431
@ VISIBILITY_PROTECTED
Definition coretypes.h:429
artificial_rodata
Definition coretypes.h:330
@ ARTIFICIAL_RODATA_CSWITCH
Definition coretypes.h:333
@ ARTIFICIAL_RODATA_CRC
Definition coretypes.h:336
excess_precision_type
Definition coretypes.h:446
@ EXCESS_PRECISION_TYPE_STANDARD
Definition coretypes.h:448
@ EXCESS_PRECISION_TYPE_IMPLICIT
Definition coretypes.h:447
@ EXCESS_PRECISION_TYPE_FAST
Definition coretypes.h:449
@ EXCESS_PRECISION_TYPE_FLOAT16
Definition coretypes.h:450
struct hwivec_def * hwivec
Definition coretypes.h:94
struct simple_bitmap_def * sbitmap
Definition coretypes.h:54
std::pair< tree, tree > tree_pair
Definition coretypes.h:380
const class edge_def * const_edge
Definition coretypes.h:349
trampoline_impl
Definition coretypes.h:226
@ TRAMPOLINE_IMPL_STACK
Definition coretypes.h:227
@ TRAMPOLINE_IMPL_HEAP
Definition coretypes.h:228
profile_reproducibility
Definition coretypes.h:246
@ PROFILE_REPRODUCIBILITY_PARALLEL_RUNS
Definition coretypes.h:248
@ PROFILE_REPRODUCIBILITY_MULTITHREADED
Definition coretypes.h:249
@ PROFILE_REPRODUCIBILITY_SERIAL
Definition coretypes.h:247
pp_markup::element pp_element
Definition coretypes.h:180
pod_mode< fixed_size_mode > fixed_size_mode_pod
Definition coretypes.h:71
const struct simple_bitmap_def * const_sbitmap
Definition coretypes.h:55
opt_mode< scalar_int_mode > opt_scalar_int_mode
Definition coretypes.h:66
node_frequency
Definition coretypes.h:274
@ NODE_FREQUENCY_HOT
Definition coretypes.h:285
@ NODE_FREQUENCY_NORMAL
Definition coretypes.h:282
@ NODE_FREQUENCY_UNLIKELY_EXECUTED
Definition coretypes.h:277
@ NODE_FREQUENCY_EXECUTED_ONCE
Definition coretypes.h:280
pad_direction
Definition coretypes.h:301
@ PAD_DOWNWARD
Definition coretypes.h:313
@ PAD_NONE
Definition coretypes.h:303
@ PAD_UPWARD
Definition coretypes.h:308
const class bitmap_head * const_bitmap
Definition coretypes.h:52
profile_update
Definition coretypes.h:239
@ PROFILE_UPDATE_ATOMIC
Definition coretypes.h:241
@ PROFILE_UPDATE_SINGLE
Definition coretypes.h:240
@ PROFILE_UPDATE_PREFER_ATOMIC
Definition coretypes.h:242
flt_eval_method
Definition coretypes.h:437
@ FLT_EVAL_METHOD_PROMOTE_TO_FLOAT
Definition coretypes.h:439
@ FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16
Definition coretypes.h:442
@ FLT_EVAL_METHOD_PROMOTE_TO_LONG_DOUBLE
Definition coretypes.h:441
@ FLT_EVAL_METHOD_UNPREDICTABLE
Definition coretypes.h:438
@ FLT_EVAL_METHOD_PROMOTE_TO_DOUBLE
Definition coretypes.h:440
int reg_class_t
Definition coretypes.h:372
const struct basic_block_def * const_basic_block
Definition coretypes.h:352
const union tree_node * const_tree
Definition coretypes.h:98
const struct hwivec_def * const_hwivec
Definition coretypes.h:95
void(* gt_pointer_operator)(void *, void *, void *)
Definition coretypes.h:469
class bitmap_head * bitmap
Definition coretypes.h:51
int64_t gcov_type
Definition coretypes.h:46
opt_mode< scalar_mode > opt_scalar_mode
Definition coretypes.h:65
union tree_node * tree
Definition coretypes.h:97
optimization_type
Definition coretypes.h:289
@ OPTIMIZE_FOR_BOTH
Definition coretypes.h:294
@ OPTIMIZE_FOR_SPEED
Definition coretypes.h:291
@ OPTIMIZE_FOR_SIZE
Definition coretypes.h:297
int alias_set_type
Definition coretypes.h:345
struct rtvec_def * rtvec
Definition coretypes.h:91
dw_cfi_oprnd_type
Definition dwarf2out.h:40
tree_code
Definition genmatch.cc:1002
Definition cfghooks.h:26
Definition channels.h:26
Definition coretypes.h:179
rtx_code
Definition rtl.h:48
Definition array-traits.h:35
Definition cgraph.h:2371
Definition basic-block.h:117
Definition bitmap.h:296
Definition cgraph.h:920
Definition opts.h:251
Definition opts.h:326
Definition opts.h:70
Definition dwarf2out.h:57
Definition gimple.h:552
Definition gimple.h:910
Definition gimple.h:392
Definition gimple.h:355
Definition gimple.h:415
Definition gimple.h:864
Definition gimple.h:874
Definition gimple.h:497
Definition gimple.h:444
Definition gimple.h:429
Definition gimple.h:454
Definition gimple.h:883
Definition gimple-iterator.h:26
Definition gimple.h:224
Definition gimple.h:892
Definition gimple.h:766
Definition gimple.h:786
Definition gimple.h:714
Definition gimple.h:576
Definition gimple.h:608
Definition gimple.h:749
Definition gimple.h:657
Definition gimple.h:696
Definition gimple.h:737
Definition gimple.h:664
Definition gimple.h:675
Definition gimple.h:743
Definition gimple.h:464
Definition gimple.h:491
Definition gimple.h:920
Definition gimple.h:901
Definition gimple.h:840
Definition gimple.h:506
Definition rtl.h:283
Definition coretypes.h:386
const char *const name
Definition coretypes.h:387
const ValueType value
Definition coretypes.h:388
Definition machmode.h:355
Definition rtl.h:739
Definition rtl.h:671
Definition rtl.h:632
Definition rtl.h:682
Definition rtl.h:583
Definition rtl.h:312
Definition rtl.h:462
Definition rtl.h:483
Definition rtl.h:549
Definition rtl.h:605
Definition rtl.h:645
Definition rtl.h:594
Definition rtl.h:693
Definition rtl.h:516
Definition sbitmap.h:87
Definition cgraph.h:133
Definition cgraph.h:110
Definition cgraph.h:2235
tree_index
Definition tree-core.h:704
Definition output.h:517