GCC Middle and Back End API Reference
ctfc.h
Go to the documentation of this file.
1/* ctfc.h - Declarations and definitions related to the CTF container.
2 Copyright (C) 2019-2025 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
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20/* This file defines the data structures and functions used by the compiler
21 to generate the CTF debug info. The definitions below are compiler internal
22 representations and closely reflect the CTF format requirements in <ctf.h>.
23
24 The contents of the CTF container are used eventually for emission of both
25 CTF (ctfout.cc) and BTF debug info (btfout.cc), as the two type debug formats
26 are close cousins. */
27
28#ifndef GCC_CTFC_H
29#define GCC_CTFC_H 1
30
31#include "config.h"
32#include "system.h"
33#include "tree.h"
34#include "fold-const.h"
35#include "dwarf2ctf.h"
36#include "ctf.h"
37#include "btf.h"
38
39/* Invalid CTF type ID definition. */
40
41#define CTF_NULL_TYPEID 0
42
43/* Value to start generating the CTF type ID from. */
44
45#define CTF_INIT_TYPEID 1
46
47/* CTF type ID. */
48
49typedef uint64_t ctf_id_t;
50
51struct ctf_dtdef;
52typedef struct ctf_dtdef ctf_dtdef_t;
54
55struct ctf_dvdef;
56typedef struct ctf_dvdef ctf_dvdef_t;
58
59/* CTF string table element (list node). */
60
61typedef struct GTY ((chain_next ("%h.cts_next"))) ctf_string
62{
63 const char * cts_str; /* CTF string. */
64 struct ctf_string * cts_next; /* A list node. */
66
67/* Internal representation of CTF string table. */
68
69typedef struct GTY (()) ctf_strtable
70{
71 ctf_string_t * ctstab_head; /* Head str ptr. */
72 ctf_string_t * ctstab_tail; /* Tail. new str appended to tail. */
73 int ctstab_num; /* Number of strings in the table. */
74 size_t ctstab_len; /* Size of string table in bytes. */
75 const char * ctstab_estr; /* Empty string "". */
77
78/* Encoding information for integers, floating-point values etc. The flags
79 field will contain values appropriate for the type defined in <ctf.h>. */
80
81typedef struct GTY (()) ctf_encoding
82{
83 unsigned int cte_format; /* Data format (CTF_INT_* or CTF_FP_* flags). */
84 unsigned int cte_offset; /* Offset of value in bits. */
85 unsigned int cte_bits; /* Size of storage in bits. */
87
88/* Array information for CTF generation. */
89
90typedef struct GTY (()) ctf_arinfo
91{
92 ctf_dtdef_ref ctr_contents; /* Type of array contents. */
93 ctf_dtdef_ref ctr_index; /* Type of array index. */
94 unsigned int ctr_nelems; /* Number of elements. */
96
97/* Function information for CTF generation. */
98
99typedef struct GTY (()) ctf_funcinfo
100{
101 ctf_dtdef_ref ctc_return; /* Function return type. */
102 unsigned int ctc_argc; /* Number of typed arguments to function. */
103 unsigned int ctc_flags; /* Function attributes (see below). */
105
106typedef struct GTY (()) ctf_sliceinfo
107{
108 ctf_dtdef_ref cts_type; /* Reference CTF type. */
109 unsigned short cts_offset; /* Offset in bits of the first bit. */
110 unsigned short cts_bits; /* Size in bits. */
112
113/* CTF type representation internal to the compiler. It closely reflects the
114 ctf_type_t type node in <ctf.h> except the GTY (()) tags. */
115
116typedef struct GTY (()) ctf_itype
117{
118 uint32_t ctti_name; /* Reference to name in string table. */
119 uint32_t ctti_info; /* Encoded kind, variant length (see below). */
120 union GTY ((desc ("0")))
122 uint32_t GTY ((tag ("0"))) _size;/* Size of entire type in bytes. */
123 uint32_t GTY ((tag ("1"))) _type;/* Reference to another type. */
124 } _u;
125 uint32_t ctti_lsizehi; /* High 32 bits of type size in bytes. */
126 uint32_t ctti_lsizelo; /* Low 32 bits of type size in bytes. */
129#define ctti_size _u._size
130#define ctti_type _u._type
131
132/* Function arguments end with varargs. */
134#define CTF_FUNC_VARARG 0x1
135
136/* Struct/union/enum member definition for CTF generation. */
138typedef struct GTY ((chain_next ("%h.dmd_next"))) ctf_dmdef
140 const char * dmd_name; /* Name of this member. */
141 ctf_dtdef_ref dmd_type; /* Type of this member (for sou). */
142 uint32_t dmd_name_offset; /* Offset of the name in str table. */
143 uint64_t dmd_offset; /* Offset of this member in bits (for sou). */
144 HOST_WIDE_INT dmd_value; /* Value of this member (for enum). */
145 struct ctf_dmdef * dmd_next; /* A list node. */
148#define ctf_dmd_list_next(elem) ((ctf_dmdef_t *)((elem)->dmd_next))
149
150/* Function Argument. */
152typedef struct GTY (()) ctf_func_arg
154 ctf_dtdef_ref farg_type; /* Type of the argument. */
155 const char * farg_name; /* Name of the argument. */
156 uint32_t farg_name_offset; /* Offset of the name in str table. */
157 struct ctf_func_arg * farg_next;/* A list node. */
160#define ctf_farg_list_next(elem) ((ctf_func_arg_t *)((elem)->farg_next))
161
162/* Declaration Tag.
163 May be used to annotate struct/union members, variable declarations,
164 function declarations, and function arguments. */
166typedef struct GTY (()) ctf_decl_tag
168 uint32_t component_idx; /* Index of component to which tag applies. */
169 ctf_dvdef_ref ref_var; /* Non-null iff this tag applies to a variable. */
171
172/* Type definition for CTF generation. */
174struct GTY ((for_user)) ctf_dtdef
176 dw_die_ref dtd_key; /* Type key for hashing. */
177 const char * dtd_name; /* Name associated with definition (if any). */
178 ctf_id_t dtd_type; /* Type identifier for this definition. */
179 ctf_dtdef_ref ref_type; /* Type referred to by this type (if any). */
180 ctf_itype_t dtd_data; /* Type node. */
181 uint32_t linkage; /* Used in function types. 0=local, 1=global. */
182
183 /* Whether this type was added from a global function. */
185 /* Enum signedness. */
187 /* Lots of spare bits. */
188
189 union GTY ((desc ("ctf_dtu_d_union_selector (&%1)")))
191 /* struct, union, or enum. */
192 ctf_dmdef_t * GTY ((tag ("CTF_DTU_D_MEMBERS"))) dtu_members;
193 /* array. */
194 ctf_arinfo_t GTY ((tag ("CTF_DTU_D_ARRAY"))) dtu_arr;
195 /* integer or float. */
196 ctf_encoding_t GTY ((tag ("CTF_DTU_D_ENCODING"))) dtu_enc;
197 /* function. */
198 ctf_func_arg_t * GTY ((tag ("CTF_DTU_D_ARGUMENTS"))) dtu_argv;
199 /* slice. */
200 ctf_sliceinfo_t GTY ((tag ("CTF_DTU_D_SLICE"))) dtu_slice;
201 /* decl tag. */
202 ctf_decl_tag_t GTY ((tag ("CTF_DTU_D_TAG"))) dtu_tag;
203 } dtd_u;
205
206#define ctf_type_id(dtd) ((uint32_t) dtd->dtd_type)
207
208/* Variable definition for CTF generation. */
209
210struct GTY ((for_user)) ctf_dvdef
212 dw_die_ref dvd_key; /* DWARF DIE corresponding to the variable. */
213 const char * dvd_name; /* Name associated with variable. */
214 uint32_t dvd_name_offset; /* Offset of the name in str table. */
215 unsigned int dvd_visibility; /* External visibility. 0=static,1=global. */
216 ctf_dtdef_ref dvd_type; /* Type of variable. */
217 ctf_id_t dvd_id; /* ID of this variable. Only used for BTF. */
218};
219
220/* Location information for CTF Types and CTF Variables. */
221
222typedef struct GTY (()) ctf_srcloc
224 const char * ctsloc_file;
225 unsigned int ctsloc_line;
226 unsigned int ctsloc_col;
228
230
231/* Helper enum and api for the GTY machinery to work on union dtu_d. */
240};
241
244
245struct ctfc_dtd_hasher : ggc_ptr_hash <ctf_dtdef_t>
246{
248
249 static hashval_t hash (ctf_dtdef_ref);
250 static bool equal (ctf_dtdef_ref, ctf_dtdef_ref);
251};
253inline hashval_t
255{
256 return htab_hash_pointer (dtd->dtd_key);
257}
259inline bool
261{
262 return (dtd->dtd_key == dtd2->dtd_key);
264
265struct ctfc_dvd_hasher : ggc_ptr_hash <ctf_dvdef_t>
266{
268
269 static hashval_t hash (ctf_dvdef_ref);
270 static bool equal (ctf_dvdef_ref, ctf_dvdef_ref);
271};
273inline hashval_t
275{
276 return htab_hash_pointer (dvd->dvd_key);
277}
279inline bool
281{
282 return (dvd->dvd_key == dvd2->dvd_key);
283}
284
285/* CTF container structure.
286 It is the context passed around when generating ctf debug info. There is
287 one container per translation unit. */
288
289typedef struct GTY (()) ctf_container
291 /* CTF Preamble. */
292 unsigned short ctfc_magic;
293 unsigned char ctfc_version;
294 unsigned char ctfc_flags;
295 uint32_t ctfc_cuname_offset;
297 /* CTF types. */
298 hash_table <ctfc_dtd_hasher> * GTY (()) ctfc_types;
299 /* CTF variables. */
301 /* CTF variables to be ignored. */
303
304 /* BTF type and decl tags. Not yet represented in CTF. These tags also
305 uniquely have a one-to-many relation with DIEs, meaning a single DIE
306 may translate to multiple CTF/BTF records. For both of these reasons,
307 they cannot be stored in the regular types table. */
309 /* Type tags logically form part of the type chain similar to cv-quals.
310 Therefore references to types need to know if the referred-to type has
311 any type tags, and if so to refer to the outermost type tag. This map
312 maps a type to the outermost type tag created for it, if any. */
315 /* CTF string table. */
317 /* Auxilliary string table. At this time, used for keeping func arg names
318 for BTF. */
323 uint64_t ctfc_num_global_funcs;
324 uint64_t ctfc_num_global_objts;
325
326 /* Number of vlen bytes - the variable length portion after ctf_type_t and
327 ctf_stype_t in the CTF section. This is used to calculate the offsets in
328 the CTF header. */
329 uint64_t ctfc_num_vlen_bytes;
331 /* Next CTF type id to assign. */
333
334 /* Specify an explicit length of 0 so that the GC marking routines steer
335 clear of marking the CTF vars and CTF types twice. These lists below do
336 not own the pointed to objects, they simply hold references to them. */
337
338 /* List of pre-processed CTF Variables. CTF requires that the variables
339 appear in the sorted order of their names. */
340 ctf_dvdef_t ** GTY ((length ("0"))) ctfc_vars_list;
341 /* Count of pre-processed CTF Variables in the list. */
342 uint64_t ctfc_vars_list_count;
343 /* List of pre-processed CTF types. CTF requires that a shared type must
344 appear before the type that uses it. For the compiler, this means types
345 are emitted in sorted order of their type IDs. */
346 ctf_dtdef_t ** GTY ((length ("0"))) ctfc_types_list;
347 /* List of CTF function types for global functions. The order of global
348 function entries in the CTF funcinfo section is undefined by the
349 compiler. */
350 ctf_dtdef_t ** GTY ((length ("0"))) ctfc_gfuncs_list;
351 /* List of CTF variables at global scope. The order of global object entries
352 in the CTF objinfo section is undefined by the compiler. */
353 ctf_dvdef_t ** GTY ((length ("0"))) ctfc_gobjts_list;
354
355 /* Following members are for debugging only. They do not add functional
356 value to the task of CTF creation. These can be cleaned up once CTF
357 generation stabilizes. */
358
359 /* Keep a count of the number of bytes dumped in asm for debugging
360 purposes. */
362 /* Total length of all strings in CTF. */
364 /* Total length of all strings in aux string table. */
365 size_t ctfc_aux_strlen;
366
368
369/* Markers for which string table from the CTF container to use. */
371#define CTF_STRTAB 0 /* CTF string table. */
372#define CTF_AUX_STRTAB 1 /* CTF auxilliary string table. */
373
375
376extern GTY (()) ctf_container_ref tu_ctfc;
377
379
380/* If the next ctf type id is still set to the init value, no ctf records to
381 report. */
383
384/* Get the total number of CTF types in the container. */
385
386extern unsigned int ctfc_get_num_ctf_types (ctf_container_ref);
387
388/* Get the total number of CTF variables in the container. */
389
390extern unsigned int ctfc_get_num_ctf_vars (ctf_container_ref);
391
392/* Get reference to the CTF string table or the CTF auxilliary
393 string table. */
394
396
397extern void init_ctf_strtable (ctf_strtable_t *);
398extern void ctfc_delete_strtab (ctf_strtable_t *);
399
400/* Get the length of the specified string table in the CTF container. */
401
402extern size_t ctfc_get_strtab_len (ctf_container_ref, int);
403
404/* Get the number of bytes to represent the variable length portion of all CTF
405 types in the CTF container. */
406
408
409/* The compiler demarcates whether types are visible at top-level scope or not.
410 The only example so far of a type not visible at top-level scope is slices.
411 CTF_ADD_NONROOT is used to indicate the latter. */
412#define CTF_ADD_NONROOT 0 /* CTF type only visible in nested scope. */
413#define CTF_ADD_ROOT 1 /* CTF type visible at top-level scope. */
414
415/* These APIs allow to initialize and finalize the CTF machinery and
416 to add types to the CTF container associated to the current
417 translation unit. Used in dwarf2ctf.cc. */
418
419extern void ctf_init (void);
420extern void ctf_output (const char * filename);
421extern void ctf_finalize (void);
422
423extern void btf_early_finish (void);
424extern void btf_finish (void);
425extern void btf_finalize (void);
426
428
430
431extern void ctf_add_cuname (ctf_container_ref, const char *);
432
434 dw_die_ref die);
436 dw_die_ref die);
437extern bool ctf_dvd_ignore_lookup (const ctf_container_ref ctfc,
438 dw_die_ref die);
439
440extern const char * ctf_add_string (ctf_container_ref, const char *,
441 uint32_t *, int);
442
444 ctf_dtdef_ref, uint32_t, dw_die_ref);
445extern ctf_dtdef_ref ctf_add_enum (ctf_container_ref, uint32_t, const char *,
446 HOST_WIDE_INT, bool, dw_die_ref);
448 uint32_t, uint32_t, dw_die_ref);
449extern ctf_dtdef_ref ctf_add_float (ctf_container_ref, uint32_t, const char *,
450 const ctf_encoding_t *, dw_die_ref);
451extern ctf_dtdef_ref ctf_add_integer (ctf_container_ref, uint32_t, const char *,
452 const ctf_encoding_t *, dw_die_ref);
453extern ctf_dtdef_ref ctf_add_unknown (ctf_container_ref, uint32_t, const char *,
454 const ctf_encoding_t *, dw_die_ref);
458 const ctf_arinfo_t *, dw_die_ref);
459extern ctf_dtdef_ref ctf_add_forward (ctf_container_ref, uint32_t, const char *,
460 uint32_t, dw_die_ref);
461extern ctf_dtdef_ref ctf_add_typedef (ctf_container_ref, uint32_t, const char *,
464 const char *, const ctf_funcinfo_t *,
465 dw_die_ref, bool, int);
466extern ctf_dtdef_ref ctf_add_sou (ctf_container_ref, uint32_t, const char *,
467 uint32_t, unsigned HOST_WIDE_INT, dw_die_ref);
469 const char *, ctf_dtdef_ref);
471 const char *, ctf_dtdef_ref, uint32_t);
472extern int ctf_add_enumerator (ctf_container_ref, ctf_dtdef_ref, const char *,
473 HOST_WIDE_INT, dw_die_ref);
474extern int ctf_add_member_offset (ctf_container_ref, dw_die_ref, const char *,
475 ctf_dtdef_ref, uint64_t);
477 const char *, ctf_dtdef_ref);
479 ctf_dtdef_ref, dw_die_ref, unsigned int,
480 dw_die_ref);
481
483
484/* Callback and traversal function for BTF_KIND_FUNC records. Used by BPF
485 target for BPF CO-RE implementation. */
486
487typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *);
489extern void btf_mark_type_used (tree);
490
491/* CTF section does not emit location information; at this time, location
492 information is needed for BTF CO-RE use-cases. */
493
496
497extern uint32_t btf_dtd_kind (ctf_dtdef_ref dtd);
498
499#endif /* GCC_CTFC_H */
bool traverse_btf_func_types(funcs_traverse_callback callback, void *data)
Definition btfout.cc:1813
void btf_early_finish(void)
Definition btfout.cc:1235
uint32_t btf_dtd_kind(ctf_dtdef_ref dtd)
Definition btfout.cc:154
void btf_finalize(void)
Definition btfout.cc:1777
void btf_finish(void)
Definition btfout.cc:1728
void btf_mark_type_used(tree t)
Definition btfout.cc:1605
Definition hash-map.h:40
Definition hash-table.h:375
#define GTY(x)
Definition coretypes.h:41
union tree_node * tree
Definition coretypes.h:97
ctf_dvdef_ref ctf_dvd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:172
ctf_dtdef_ref ctf_add_unknown(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_encoding_t *ep, dw_die_ref die)
Definition ctfc.cc:598
ctf_dtdef_ref ctf_add_array(ctf_container_ref ctfc, uint32_t flag, const ctf_arinfo_t *arp, dw_die_ref die)
Definition ctfc.cc:612
unsigned int ctfc_get_num_ctf_types(ctf_container_ref ctfc)
Definition ctfc.cc:49
ctf_dtdef_ref ctf_add_enum(ctf_container_ref ctfc, uint32_t flag, const char *name, HOST_WIDE_INT size, bool eunsigned, dw_die_ref die)
Definition ctfc.cc:635
void ctfc_delete_strtab(ctf_strtable_t *strtab)
Definition ctfc.cc:1040
ctf_dtdef_ref ctf_add_typedef(ctf_container_ref ctfc, uint32_t flag, const char *name, ctf_dtdef_ref ref, dw_die_ref die)
Definition ctfc.cc:530
ctf_dtdef_ref ctf_add_function(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_funcinfo_t *ctc, dw_die_ref die, bool from_global_func, int linkage)
Definition ctfc.cc:836
ctf_dtdef_ref ctf_add_sou(ctf_container_ref ctfc, uint32_t flag, const char *name, uint32_t kind, unsigned HOST_WIDE_INT size, dw_die_ref die)
Definition ctfc.cc:865
void init_ctf_strtable(ctf_strtable_t *strtab)
Definition ctfc.cc:978
void ctf_init(void)
Definition ctfc.cc:1110
ctf_dvdef_ref ctf_add_variable(ctf_container_ref ctfc, const char *name, ctf_dtdef_ref ref, dw_die_ref die, unsigned int external_vis, dw_die_ref die_var_decl)
Definition ctfc.cc:760
ctf_container_ref ctf_get_tu_ctfc(void)
Definition ctfc.cc:33
bool ctf_type_exists(ctf_container_ref ctfc, dw_die_ref type, ctf_dtdef_ref *dtd)
Definition ctfc.cc:926
ctf_strtable_t * ctfc_get_strtab(ctf_container_ref ctfc, int aux)
Definition ctfc.cc:65
size_t ctfc_get_strtab_len(ctf_container_ref ctfc, int aux)
Definition ctfc.cc:73
ctf_dtdef_ref ctf_add_reftype(ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, uint32_t kind, dw_die_ref die)
Definition ctfc.cc:432
int ctf_add_function_arg(ctf_container_ref ctfc, dw_die_ref func, const char *name, ctf_dtdef_ref arg_dtd)
Definition ctfc.cc:804
int ctfc_get_dtd_srcloc(ctf_dtdef_ref dtd, ctf_srcloc_ref loc)
Definition ctfc.cc:947
size_t ctfc_get_num_vlen_bytes(ctf_container_ref ctfc)
Definition ctfc.cc:82
ctf_dtdef_ref ctf_dtd_lookup(const ctf_container_ref ctfc, const dw_die_ref type)
Definition ctfc.cc:139
ctf_dtdef_ref ctf_add_float(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_encoding_t *ep, dw_die_ref die)
Definition ctfc.cc:584
const char * ctf_add_string(ctf_container_ref ctfc, const char *name, uint32_t *name_offset, int aux_str=CTF_STRTAB)
Definition ctfc.cc:321
ctf_dtdef_ref ctf_add_integer(ctf_container_ref ctfc, uint32_t flag, const char *name, const ctf_encoding_t *ep, dw_die_ref die)
Definition ctfc.cc:591
int ctf_add_member_offset(ctf_container_ref ctfc, dw_die_ref sou, const char *name, ctf_dtdef_ref type, uint64_t bit_offset)
Definition ctfc.cc:719
ctf_dtdef_ref ctf_add_pointer(ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, dw_die_ref die)
Definition ctfc.cc:605
void ctfc_delete_container(ctf_container_ref ctfc)
Definition ctfc.cc:1062
bool ctfc_is_empty_container(ctf_container_ref ctfc)
Definition ctfc.cc:41
ctf_dtdef_ref ctf_add_slice(ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, uint32_t bit_offset, uint32_t bit_size, dw_die_ref die)
Definition ctfc.cc:552
void ctf_add_cuname(ctf_container_ref ctfc, const char *filename)
Definition ctfc.cc:335
ctf_dtdef_ref ctf_add_forward(ctf_container_ref ctfc, uint32_t flag, const char *name, uint32_t kind, dw_die_ref die)
Definition ctfc.cc:514
ctf_dtdef_ref ctf_add_decl_tag(ctf_container_ref ctfc, uint32_t flag, const char *value, ctf_dtdef_ref ref_dtd, uint32_t comp_idx)
Definition ctfc.cc:483
ctf_dtdef_ref ctf_add_type_tag(ctf_container_ref ctfc, uint32_t flag, const char *value, ctf_dtdef_ref ref_dtd)
Definition ctfc.cc:452
ctf_container_ref tu_ctfc
Definition ctfc.cc:30
int ctfc_get_dvd_srcloc(ctf_dvdef_ref dvd, ctf_srcloc_ref loc)
Definition ctfc.cc:960
bool ctf_dvd_ignore_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:206
unsigned int ctfc_get_num_ctf_vars(ctf_container_ref ctfc)
Definition ctfc.cc:56
ctf_dtdef_ref ctf_lookup_tree_type(ctf_container_ref ctfc, const tree type)
Definition ctfc.cc:908
enum ctf_dtu_d_union_enum ctf_dtu_d_union_selector(ctf_dtdef_ref ctftype)
Definition ctfc.cc:91
int ctf_add_enumerator(ctf_container_ref ctfc, ctf_dtdef_ref enum_dtd, const char *name, HOST_WIDE_INT value, dw_die_ref die)
Definition ctfc.cc:670
ctf_dvdef_ref ctf_dvd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:172
ctf_dtdef_ref ctf_add_decl_tag(ctf_container_ref, uint32_t, const char *, ctf_dtdef_ref, uint32_t)
Definition ctfc.cc:483
bool ctf_type_exists(ctf_container_ref, dw_die_ref, ctf_dtdef_ref *)
Definition ctfc.cc:926
ctf_dtdef_ref ctf_add_forward(ctf_container_ref, uint32_t, const char *, uint32_t, dw_die_ref)
Definition ctfc.cc:514
ctf_dvdef_ref ctf_add_variable(ctf_container_ref, const char *, ctf_dtdef_ref, dw_die_ref, unsigned int, dw_die_ref)
Definition ctfc.cc:760
struct ctf_dmdef ctf_dmdef_t
uint64_t ctf_id_t
Definition ctfc.h:49
struct ctf_itype ctf_itype_t
struct ctf_sliceinfo ctf_sliceinfo_t
void ctfc_delete_container(ctf_container_ref)
Definition ctfc.cc:1062
ctf_container_t * ctf_container_ref
Definition ctfc.h:372
void ctf_add_cuname(ctf_container_ref, const char *)
Definition ctfc.cc:335
size_t ctfc_get_num_vlen_bytes(ctf_container_ref)
Definition ctfc.cc:82
ctf_dtu_d_union_enum
Definition ctfc.h:231
@ CTF_DTU_D_TAG
Definition ctfc.h:237
@ CTF_DTU_D_ARGUMENTS
Definition ctfc.h:235
@ CTF_DTU_D_SLICE
Definition ctfc.h:236
@ CTF_DTU_D_MEMBERS
Definition ctfc.h:232
@ CTF_DTU_D_ENCODING
Definition ctfc.h:234
@ CTF_DTU_D_ARRAY
Definition ctfc.h:233
ctf_dvdef_t * ctf_dvdef_ref
Definition ctfc.h:57
struct ctf_strtable ctf_strtable_t
ctf_dtdef_ref ctf_add_slice(ctf_container_ref, uint32_t, ctf_dtdef_ref, uint32_t, uint32_t, dw_die_ref)
Definition ctfc.cc:552
unsigned int ctfc_get_num_ctf_types(ctf_container_ref)
Definition ctfc.cc:49
ctf_dtdef_ref ctf_add_reftype(ctf_container_ref, uint32_t, ctf_dtdef_ref, uint32_t, dw_die_ref)
Definition ctfc.cc:432
ctf_dtdef_ref ctf_add_integer(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:591
ctf_dtdef_ref ctf_lookup_tree_type(ctf_container_ref, const tree)
Definition ctfc.cc:908
struct ctf_dvdef ctf_dvdef_t
Definition ctfc.h:56
void ctf_init(void)
Definition ctfc.cc:1110
ctf_container_ref ctf_get_tu_ctfc(void)
Definition ctfc.cc:33
void btf_early_finish(void)
Definition btfout.cc:1235
ctf_dtdef_ref ctf_add_array(ctf_container_ref, uint32_t, const ctf_arinfo_t *, dw_die_ref)
Definition ctfc.cc:612
bool(* funcs_traverse_callback)(ctf_dtdef_ref, void *)
Definition ctfc.h:485
struct ctf_encoding ctf_encoding_t
ctf_dtdef_ref ctf_add_type_tag(ctf_container_ref, uint32_t, const char *, ctf_dtdef_ref)
Definition ctfc.cc:452
ctf_dtdef_t * ctf_dtdef_ref
Definition ctfc.h:53
uint32_t btf_dtd_kind(ctf_dtdef_ref dtd)
Definition btfout.cc:154
enum ctf_dtu_d_union_enum ctf_dtu_d_union_selector(ctf_dtdef_ref)
Definition ctfc.cc:91
int ctf_add_enumerator(ctf_container_ref, ctf_dtdef_ref, const char *, HOST_WIDE_INT, dw_die_ref)
Definition ctfc.cc:670
ctf_dtdef_ref ctf_add_typedef(ctf_container_ref, uint32_t, const char *, ctf_dtdef_ref, dw_die_ref)
Definition ctfc.cc:530
struct ctf_string ctf_string_t
ctf_dtdef_ref ctf_add_pointer(ctf_container_ref, uint32_t, ctf_dtdef_ref, dw_die_ref)
Definition ctfc.cc:605
int ctfc_get_dvd_srcloc(ctf_dvdef_ref, ctf_srcloc_ref)
Definition ctfc.cc:960
ctf_dtdef_ref ctf_add_unknown(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:598
void ctfc_delete_strtab(ctf_strtable_t *)
Definition ctfc.cc:1040
void btf_finalize(void)
Definition btfout.cc:1777
ctf_strtable_t * ctfc_get_strtab(ctf_container_ref, int)
Definition ctfc.cc:65
bool ctfc_is_empty_container(ctf_container_ref)
Definition ctfc.cc:41
struct ctf_decl_tag ctf_decl_tag_t
const char * ctf_add_string(ctf_container_ref, const char *, uint32_t *, int)
Definition ctfc.cc:321
void btf_mark_type_used(tree)
Definition btfout.cc:1605
struct ctf_func_arg ctf_func_arg_t
void ctf_output(const char *filename)
Definition ctfout.cc:803
bool traverse_btf_func_types(funcs_traverse_callback, void *)
Definition btfout.cc:1813
ctf_srcloc_t * ctf_srcloc_ref
Definition ctfc.h:227
struct ctf_funcinfo ctf_funcinfo_t
unsigned int ctfc_get_num_ctf_vars(ctf_container_ref)
Definition ctfc.cc:56
void btf_finish(void)
Definition btfout.cc:1728
size_t ctfc_get_strtab_len(ctf_container_ref, int)
Definition ctfc.cc:73
ctf_dtdef_ref ctf_add_function(ctf_container_ref, uint32_t, const char *, const ctf_funcinfo_t *, dw_die_ref, bool, int)
Definition ctfc.cc:836
void init_ctf_strtable(ctf_strtable_t *)
Definition ctfc.cc:978
ctf_dtdef_ref ctf_add_enum(ctf_container_ref, uint32_t, const char *, HOST_WIDE_INT, bool, dw_die_ref)
Definition ctfc.cc:635
int ctfc_get_dtd_srcloc(ctf_dtdef_ref, ctf_srcloc_ref)
Definition ctfc.cc:947
struct ctf_srcloc ctf_srcloc_t
ctf_dtdef_ref ctf_add_sou(ctf_container_ref, uint32_t, const char *, uint32_t, unsigned HOST_WIDE_INT, dw_die_ref)
Definition ctfc.cc:865
int ctf_add_function_arg(ctf_container_ref, dw_die_ref, const char *, ctf_dtdef_ref)
Definition ctfc.cc:804
struct ctf_arinfo ctf_arinfo_t
struct ctf_dtdef ctf_dtdef_t
Definition ctfc.h:52
bool ctf_dvd_ignore_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:206
struct ctf_container ctf_container_t
void ctf_finalize(void)
Definition ctfout.cc:837
int ctf_add_member_offset(ctf_container_ref, dw_die_ref, const char *, ctf_dtdef_ref, uint64_t)
Definition ctfc.cc:719
ctf_dtdef_ref ctf_dtd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:139
ctf_dtdef_ref ctf_add_float(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:584
struct die_struct * dw_die_ref
Definition dwarf2out.h:25
Definition ctfc.h:91
unsigned int ctr_nelems
Definition ctfc.h:94
ctf_dtdef_ref ctr_contents
Definition ctfc.h:92
ctf_dtdef_ref ctr_index
Definition ctfc.h:93
Definition ctfc.h:288
vec< ctf_dtdef_ref, va_gc > * ctfc_tags
Definition ctfc.h:306
hash_table< ctfc_dtd_hasher > * ctfc_types
Definition ctfc.h:296
size_t ctfc_strlen
Definition ctfc.h:361
ctf_dtdef_t ** ctfc_types_list
Definition ctfc.h:344
unsigned char ctfc_flags
Definition ctfc.h:292
unsigned short ctfc_magic
Definition ctfc.h:290
hash_table< ctfc_dvd_hasher > * ctfc_vars
Definition ctfc.h:298
uint64_t ctfc_num_vlen_bytes
Definition ctfc.h:327
uint64_t ctfc_num_stypes
Definition ctfc.h:320
ctf_id_t ctfc_nextid
Definition ctfc.h:330
hash_table< ctfc_dvd_hasher > * ctfc_ignore_vars
Definition ctfc.h:300
uint64_t ctfc_num_types
Definition ctfc.h:319
uint64_t ctfc_vars_list_count
Definition ctfc.h:340
ctf_strtable_t ctfc_strtable
Definition ctfc.h:314
uint64_t ctfc_num_global_funcs
Definition ctfc.h:321
uint32_t ctfc_cuname_offset
Definition ctfc.h:293
size_t ctfc_aux_strlen
Definition ctfc.h:363
ctf_dvdef_t ** ctfc_vars_list
Definition ctfc.h:338
ctf_dvdef_t ** ctfc_gobjts_list
Definition ctfc.h:351
uint64_t ctfc_numbytes_asm
Definition ctfc.h:359
ctf_dtdef_t ** ctfc_gfuncs_list
Definition ctfc.h:348
hash_map< ctf_dtdef_ref, ctf_dtdef_ref > * ctfc_type_tags_map
Definition ctfc.h:311
ctf_strtable_t ctfc_aux_strtable
Definition ctfc.h:317
uint64_t ctfc_num_global_objts
Definition ctfc.h:322
unsigned char ctfc_version
Definition ctfc.h:291
Definition ctfc.h:166
uint32_t component_idx
Definition ctfc.h:167
ctf_dvdef_ref ref_var
Definition ctfc.h:168
Definition ctfc.h:138
HOST_WIDE_INT dmd_value
Definition ctfc.h:143
struct ctf_dmdef * dmd_next
Definition ctfc.h:144
uint32_t dmd_name_offset
Definition ctfc.h:141
const char * dmd_name
Definition ctfc.h:139
ctf_dtdef_ref dmd_type
Definition ctfc.h:140
uint64_t dmd_offset
Definition ctfc.h:142
Definition ctfc.h:174
BOOL_BITFIELD from_global_func
Definition ctfc.h:183
ctf_func_arg_t * dtu_argv
Definition ctfc.h:196
BOOL_BITFIELD dtd_enum_unsigned
Definition ctfc.h:185
ctf_sliceinfo_t dtu_slice
Definition ctfc.h:198
ctf_dtdef_ref ref_type
Definition ctfc.h:178
ctf_itype_t dtd_data
Definition ctfc.h:179
union ctf_dtdef::@145205230242124377222321355231110264357130277370 dtd_u
ctf_dmdef_t * dtu_members
Definition ctfc.h:190
uint32_t linkage
Definition ctfc.h:180
ctf_arinfo_t dtu_arr
Definition ctfc.h:192
dw_die_ref dtd_key
Definition ctfc.h:175
ctf_id_t dtd_type
Definition ctfc.h:177
const char * dtd_name
Definition ctfc.h:176
ctf_decl_tag_t dtu_tag
Definition ctfc.h:200
ctf_encoding_t dtu_enc
Definition ctfc.h:194
Definition ctfc.h:209
unsigned int dvd_visibility
Definition ctfc.h:213
uint32_t dvd_name_offset
Definition ctfc.h:212
const char * dvd_name
Definition ctfc.h:211
ctf_dtdef_ref dvd_type
Definition ctfc.h:214
ctf_id_t dvd_id
Definition ctfc.h:215
dw_die_ref dvd_key
Definition ctfc.h:210
Definition ctfc.h:82
unsigned int cte_offset
Definition ctfc.h:84
unsigned int cte_bits
Definition ctfc.h:85
unsigned int cte_format
Definition ctfc.h:83
Definition ctfc.h:152
const char * farg_name
Definition ctfc.h:154
struct ctf_func_arg * farg_next
Definition ctfc.h:156
uint32_t farg_name_offset
Definition ctfc.h:155
ctf_dtdef_ref farg_type
Definition ctfc.h:153
Definition ctfc.h:100
ctf_dtdef_ref ctc_return
Definition ctfc.h:101
unsigned int ctc_flags
Definition ctfc.h:103
unsigned int ctc_argc
Definition ctfc.h:102
Definition ctfc.h:117
uint32_t ctti_lsizehi
Definition ctfc.h:124
uint32_t ctti_info
Definition ctfc.h:119
uint32_t _type
Definition ctfc.h:122
uint32_t ctti_lsizelo
Definition ctfc.h:125
uint32_t ctti_name
Definition ctfc.h:118
union ctf_itype::@323375332301132044054343014213354223324057360375 _u
uint32_t _size
Definition ctfc.h:121
Definition ctfc.h:107
unsigned short cts_offset
Definition ctfc.h:109
unsigned short cts_bits
Definition ctfc.h:110
ctf_dtdef_ref cts_type
Definition ctfc.h:108
Definition ctfc.h:221
unsigned int ctsloc_line
Definition ctfc.h:223
unsigned int ctsloc_col
Definition ctfc.h:224
const char * ctsloc_file
Definition ctfc.h:222
Definition ctfc.h:62
struct ctf_string * cts_next
Definition ctfc.h:64
const char * cts_str
Definition ctfc.h:63
Definition ctfc.h:70
ctf_string_t * ctstab_head
Definition ctfc.h:71
int ctstab_num
Definition ctfc.h:73
size_t ctstab_len
Definition ctfc.h:74
ctf_string_t * ctstab_tail
Definition ctfc.h:72
const char * ctstab_estr
Definition ctfc.h:75
Definition ctfc.h:244
ctf_dtdef_ref compare_type
Definition ctfc.h:245
static bool equal(ctf_dtdef_ref, ctf_dtdef_ref)
Definition ctfc.h:258
static hashval_t hash(ctf_dtdef_ref)
Definition ctfc.h:252
Definition ctfc.h:264
ctf_dvdef_ref compare_type
Definition ctfc.h:265
static bool equal(ctf_dvdef_ref, ctf_dvdef_ref)
Definition ctfc.h:278
static hashval_t hash(ctf_dvdef_ref)
Definition ctfc.h:272
Definition hash-traits.h:321
Definition vec.h:359
Definition vec.h:450
#define BOOL_BITFIELD
Definition system.h:896
#define bool
Definition system.h:886