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-2024 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
55/* CTF string table element (list node). */
56
57typedef struct GTY ((chain_next ("%h.cts_next"))) ctf_string
58{
59 const char * cts_str; /* CTF string. */
60 struct ctf_string * cts_next; /* A list node. */
62
63/* Internal representation of CTF string table. */
64
65typedef struct GTY (()) ctf_strtable
66{
67 ctf_string_t * ctstab_head; /* Head str ptr. */
68 ctf_string_t * ctstab_tail; /* Tail. new str appended to tail. */
69 int ctstab_num; /* Number of strings in the table. */
70 size_t ctstab_len; /* Size of string table in bytes. */
71 const char * ctstab_estr; /* Empty string "". */
73
74/* Encoding information for integers, floating-point values etc. The flags
75 field will contain values appropriate for the type defined in <ctf.h>. */
76
77typedef struct GTY (()) ctf_encoding
78{
79 unsigned int cte_format; /* Data format (CTF_INT_* or CTF_FP_* flags). */
80 unsigned int cte_offset; /* Offset of value in bits. */
81 unsigned int cte_bits; /* Size of storage in bits. */
83
84/* Array information for CTF generation. */
85
86typedef struct GTY (()) ctf_arinfo
87{
88 ctf_dtdef_ref ctr_contents; /* Type of array contents. */
89 ctf_dtdef_ref ctr_index; /* Type of array index. */
90 unsigned int ctr_nelems; /* Number of elements. */
92
93/* Function information for CTF generation. */
94
95typedef struct GTY (()) ctf_funcinfo
96{
97 ctf_dtdef_ref ctc_return; /* Function return type. */
98 unsigned int ctc_argc; /* Number of typed arguments to function. */
99 unsigned int ctc_flags; /* Function attributes (see below). */
101
102typedef struct GTY (()) ctf_sliceinfo
103{
104 ctf_dtdef_ref cts_type; /* Reference CTF type. */
105 unsigned short cts_offset; /* Offset in bits of the first bit. */
106 unsigned short cts_bits; /* Size in bits. */
108
109/* CTF type representation internal to the compiler. It closely reflects the
110 ctf_type_t type node in <ctf.h> except the GTY (()) tags. */
111
112typedef struct GTY (()) ctf_itype
113{
114 uint32_t ctti_name; /* Reference to name in string table. */
115 uint32_t ctti_info; /* Encoded kind, variant length (see below). */
116 union GTY ((desc ("0")))
118 uint32_t GTY ((tag ("0"))) _size;/* Size of entire type in bytes. */
119 uint32_t GTY ((tag ("1"))) _type;/* Reference to another type. */
120 } _u;
121 uint32_t ctti_lsizehi; /* High 32 bits of type size in bytes. */
122 uint32_t ctti_lsizelo; /* Low 32 bits of type size in bytes. */
125#define ctti_size _u._size
126#define ctti_type _u._type
127
128/* Function arguments end with varargs. */
130#define CTF_FUNC_VARARG 0x1
131
132/* Struct/union/enum member definition for CTF generation. */
134typedef struct GTY ((chain_next ("%h.dmd_next"))) ctf_dmdef
136 const char * dmd_name; /* Name of this member. */
137 ctf_dtdef_ref dmd_type; /* Type of this member (for sou). */
138 uint32_t dmd_name_offset; /* Offset of the name in str table. */
139 uint64_t dmd_offset; /* Offset of this member in bits (for sou). */
140 HOST_WIDE_INT dmd_value; /* Value of this member (for enum). */
141 struct ctf_dmdef * dmd_next; /* A list node. */
144#define ctf_dmd_list_next(elem) ((ctf_dmdef_t *)((elem)->dmd_next))
145
146/* Function Argument. */
148typedef struct GTY (()) ctf_func_arg
150 ctf_dtdef_ref farg_type; /* Type of the argument. */
151 const char * farg_name; /* Name of the argument. */
152 uint32_t farg_name_offset; /* Offset of the name in str table. */
153 struct ctf_func_arg * farg_next;/* A list node. */
156#define ctf_farg_list_next(elem) ((ctf_func_arg_t *)((elem)->farg_next))
157
158/* Type definition for CTF generation. */
160struct GTY ((for_user)) ctf_dtdef
162 dw_die_ref dtd_key; /* Type key for hashing. */
163 const char * dtd_name; /* Name associated with definition (if any). */
164 ctf_id_t dtd_type; /* Type identifier for this definition. */
165 ctf_dtdef_ref ref_type; /* Type referred to by this type (if any). */
166 ctf_itype_t dtd_data; /* Type node. */
167 uint32_t linkage; /* Used in function types. 0=local, 1=global. */
168
169 /* Whether this type was added from a global function. */
170 BOOL_BITFIELD from_global_func : 1;
171 /* Enum signedness. */
172 BOOL_BITFIELD dtd_enum_unsigned : 1;
173 /* Lots of spare bits. */
174
175 union GTY ((desc ("ctf_dtu_d_union_selector (&%1)")))
177 /* struct, union, or enum. */
178 ctf_dmdef_t * GTY ((tag ("CTF_DTU_D_MEMBERS"))) dtu_members;
179 /* array. */
180 ctf_arinfo_t GTY ((tag ("CTF_DTU_D_ARRAY"))) dtu_arr;
181 /* integer or float. */
183 /* function. */
184 ctf_func_arg_t * GTY ((tag ("CTF_DTU_D_ARGUMENTS"))) dtu_argv;
185 /* slice. */
186 ctf_sliceinfo_t GTY ((tag ("CTF_DTU_D_SLICE"))) dtu_slice;
187 } dtd_u;
189
190#define ctf_type_id(dtd) ((uint32_t) dtd->dtd_type)
191
192/* Variable definition for CTF generation. */
193
194struct GTY ((for_user)) ctf_dvdef
196 dw_die_ref dvd_key; /* DWARF DIE corresponding to the variable. */
197 const char * dvd_name; /* Name associated with variable. */
198 uint32_t dvd_name_offset; /* Offset of the name in str table. */
199 unsigned int dvd_visibility; /* External visibility. 0=static,1=global. */
200 ctf_dtdef_ref dvd_type; /* Type of variable. */
201 ctf_id_t dvd_id; /* ID of this variable. Only used for BTF. */
204typedef struct ctf_dvdef ctf_dvdef_t;
205typedef ctf_dvdef_t * ctf_dvdef_ref;
206
207/* Location information for CTF Types and CTF Variables. */
208
209typedef struct GTY (()) ctf_srcloc
211 const char * ctsloc_file;
212 unsigned int ctsloc_line;
213 unsigned int ctsloc_col;
215
217
218/* Helper enum and api for the GTY machinery to work on union dtu_d. */
226};
227
230
231struct ctfc_dtd_hasher : ggc_ptr_hash <ctf_dtdef_t>
232{
234
235 static hashval_t hash (ctf_dtdef_ref);
236 static bool equal (ctf_dtdef_ref, ctf_dtdef_ref);
237};
239inline hashval_t
241{
242 return htab_hash_pointer (dtd->dtd_key);
243}
245inline bool
247{
248 return (dtd->dtd_key == dtd2->dtd_key);
250
251struct ctfc_dvd_hasher : ggc_ptr_hash <ctf_dvdef_t>
252{
254
255 static hashval_t hash (ctf_dvdef_ref);
256 static bool equal (ctf_dvdef_ref, ctf_dvdef_ref);
257};
259inline hashval_t
261{
262 return htab_hash_pointer (dvd->dvd_key);
263}
265inline bool
267{
268 return (dvd->dvd_key == dvd2->dvd_key);
269}
270
271/* CTF container structure.
272 It is the context passed around when generating ctf debug info. There is
273 one container per translation unit. */
274
275typedef struct GTY (()) ctf_container
277 /* CTF Preamble. */
278 unsigned short ctfc_magic;
279 unsigned char ctfc_version;
280 unsigned char ctfc_flags;
281 uint32_t ctfc_cuname_offset;
283 /* CTF types. */
284 hash_table <ctfc_dtd_hasher> * GTY (()) ctfc_types;
285 /* CTF variables. */
286 hash_table <ctfc_dvd_hasher> * GTY (()) ctfc_vars;
287 /* CTF variables to be ignored. */
288 hash_table <ctfc_dvd_hasher> * GTY (()) ctfc_ignore_vars;
290 /* CTF string table. */
291 ctf_strtable_t ctfc_strtable;
292 /* Auxilliary string table. At this time, used for keeping func arg names
293 for BTF. */
294 ctf_strtable_t ctfc_aux_strtable;
296 uint64_t ctfc_num_types;
297 uint64_t ctfc_num_stypes;
298 uint64_t ctfc_num_global_funcs;
299 uint64_t ctfc_num_global_objts;
300
301 /* Number of vlen bytes - the variable length portion after ctf_type_t and
302 ctf_stype_t in the CTF section. This is used to calculate the offsets in
303 the CTF header. */
304 uint64_t ctfc_num_vlen_bytes;
306 /* Next CTF type id to assign. */
307 ctf_id_t ctfc_nextid;
308
309 /* Specify an explicit length of 0 so that the GC marking routines steer
310 clear of marking the CTF vars and CTF types twice. These lists below do
311 not own the pointed to objects, they simply hold references to them. */
312
313 /* List of pre-processed CTF Variables. CTF requires that the variables
314 appear in the sorted order of their names. */
315 ctf_dvdef_t ** GTY ((length ("0"))) ctfc_vars_list;
316 /* Count of pre-processed CTF Variables in the list. */
317 uint64_t ctfc_vars_list_count;
318 /* List of pre-processed CTF types. CTF requires that a shared type must
319 appear before the type that uses it. For the compiler, this means types
320 are emitted in sorted order of their type IDs. */
321 ctf_dtdef_t ** GTY ((length ("0"))) ctfc_types_list;
322 /* List of CTF function types for global functions. The order of global
323 function entries in the CTF funcinfo section is undefined by the
324 compiler. */
325 ctf_dtdef_t ** GTY ((length ("0"))) ctfc_gfuncs_list;
326 /* List of CTF variables at global scope. The order of global object entries
327 in the CTF objinfo section is undefined by the compiler. */
328 ctf_dvdef_t ** GTY ((length ("0"))) ctfc_gobjts_list;
329
330 /* Following members are for debugging only. They do not add functional
331 value to the task of CTF creation. These can be cleaned up once CTF
332 generation stabilizes. */
333
334 /* Keep a count of the number of bytes dumped in asm for debugging
335 purposes. */
336 uint64_t ctfc_numbytes_asm;
337 /* Total length of all strings in CTF. */
338 size_t ctfc_strlen;
339 /* Total length of all strings in aux string table. */
340 size_t ctfc_aux_strlen;
341
343
344/* Markers for which string table from the CTF container to use. */
346#define CTF_STRTAB 0 /* CTF string table. */
347#define CTF_AUX_STRTAB 1 /* CTF auxilliary string table. */
348
350
351extern GTY (()) ctf_container_ref tu_ctfc;
352
354
355/* If the next ctf type id is still set to the init value, no ctf records to
356 report. */
358
359/* Get the total number of CTF types in the container. */
360
361extern unsigned int ctfc_get_num_ctf_types (ctf_container_ref);
362
363/* Get the total number of CTF variables in the container. */
364
365extern unsigned int ctfc_get_num_ctf_vars (ctf_container_ref);
366
367/* Get reference to the CTF string table or the CTF auxilliary
368 string table. */
369
371
372extern void init_ctf_strtable (ctf_strtable_t *);
373extern void ctfc_delete_strtab (ctf_strtable_t *);
374
375/* Get the length of the specified string table in the CTF container. */
376
377extern size_t ctfc_get_strtab_len (ctf_container_ref, int);
378
379/* Get the number of bytes to represent the variable length portion of all CTF
380 types in the CTF container. */
381
383
384/* The compiler demarcates whether types are visible at top-level scope or not.
385 The only example so far of a type not visible at top-level scope is slices.
386 CTF_ADD_NONROOT is used to indicate the latter. */
387#define CTF_ADD_NONROOT 0 /* CTF type only visible in nested scope. */
388#define CTF_ADD_ROOT 1 /* CTF type visible at top-level scope. */
389
390/* These APIs allow to initialize and finalize the CTF machinery and
391 to add types to the CTF container associated to the current
392 translation unit. Used in dwarf2ctf.cc. */
393
394extern void ctf_init (void);
395extern void ctf_output (const char * filename);
396extern void ctf_finalize (void);
397
398extern void btf_early_finish (void);
399extern void btf_finish (void);
400extern void btf_finalize (void);
401
403
405
406extern void ctf_add_cuname (ctf_container_ref, const char *);
407
409 dw_die_ref die);
411 dw_die_ref die);
412extern bool ctf_dvd_ignore_lookup (const ctf_container_ref ctfc,
413 dw_die_ref die);
414
415extern const char * ctf_add_string (ctf_container_ref, const char *,
416 uint32_t *, int);
417
419 ctf_dtdef_ref, uint32_t, dw_die_ref);
420extern ctf_dtdef_ref ctf_add_enum (ctf_container_ref, uint32_t, const char *,
421 HOST_WIDE_INT, bool, dw_die_ref);
423 uint32_t, uint32_t, dw_die_ref);
424extern ctf_dtdef_ref ctf_add_float (ctf_container_ref, uint32_t, const char *,
425 const ctf_encoding_t *, dw_die_ref);
426extern ctf_dtdef_ref ctf_add_integer (ctf_container_ref, uint32_t, const char *,
427 const ctf_encoding_t *, dw_die_ref);
428extern ctf_dtdef_ref ctf_add_unknown (ctf_container_ref, uint32_t, const char *,
429 const ctf_encoding_t *, dw_die_ref);
433 const ctf_arinfo_t *, dw_die_ref);
434extern ctf_dtdef_ref ctf_add_forward (ctf_container_ref, uint32_t, const char *,
435 uint32_t, dw_die_ref);
436extern ctf_dtdef_ref ctf_add_typedef (ctf_container_ref, uint32_t, const char *,
439 const char *, const ctf_funcinfo_t *,
440 dw_die_ref, bool, int);
441extern ctf_dtdef_ref ctf_add_sou (ctf_container_ref, uint32_t, const char *,
442 uint32_t, size_t, dw_die_ref);
443
444extern int ctf_add_enumerator (ctf_container_ref, ctf_dtdef_ref, const char *,
445 HOST_WIDE_INT, dw_die_ref);
446extern int ctf_add_member_offset (ctf_container_ref, dw_die_ref, const char *,
447 ctf_dtdef_ref, uint64_t);
449 const char *, ctf_dtdef_ref);
450extern int ctf_add_variable (ctf_container_ref, const char *, ctf_dtdef_ref,
451 dw_die_ref, unsigned int, dw_die_ref);
452
454
455/* Callback and traversal function for BTF_KIND_FUNC records. Used by BPF
456 target for BPF CO-RE implementation. */
457
458typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *);
460extern void btf_mark_type_used (tree);
461
462/* CTF section does not emit location information; at this time, location
463 information is needed for BTF CO-RE use-cases. */
464
467
468#endif /* GCC_CTFC_H */
bool traverse_btf_func_types(funcs_traverse_callback callback, void *data)
Definition btfout.cc:1684
void btf_early_finish(void)
Definition btfout.cc:1175
void btf_finalize(void)
Definition btfout.cc:1654
void btf_finish(void)
Definition btfout.cc:1612
void btf_mark_type_used(tree t)
Definition btfout.cc:1512
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:169
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:533
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:547
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:570
void ctfc_delete_strtab(ctf_strtable_t *strtab)
Definition ctfc.cc:971
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:465
int 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:695
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:771
void init_ctf_strtable(ctf_strtable_t *strtab)
Definition ctfc.cc:913
void ctf_init(void)
Definition ctfc.cc:1036
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:861
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:429
int ctf_add_function_arg(ctf_container_ref ctfc, dw_die_ref func, const char *name, ctf_dtdef_ref arg_dtd)
Definition ctfc.cc:739
int ctfc_get_dtd_srcloc(ctf_dtdef_ref dtd, ctf_srcloc_ref loc)
Definition ctfc.cc:882
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:136
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:519
const char * ctf_add_string(ctf_container_ref ctfc, const char *name, uint32_t *name_offset, int aux_str=CTF_STRTAB)
Definition ctfc.cc:318
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:526
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:654
ctf_dtdef_ref ctf_add_sou(ctf_container_ref ctfc, uint32_t flag, const char *name, uint32_t kind, size_t size, dw_die_ref die)
Definition ctfc.cc:800
ctf_dtdef_ref ctf_add_pointer(ctf_container_ref ctfc, uint32_t flag, ctf_dtdef_ref ref, dw_die_ref die)
Definition ctfc.cc:540
void ctfc_delete_container(ctf_container_ref ctfc)
Definition ctfc.cc:993
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:487
void ctf_add_cuname(ctf_container_ref ctfc, const char *filename)
Definition ctfc.cc:332
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:449
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:895
bool ctf_dvd_ignore_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:203
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:843
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:605
ctf_dvdef_ref ctf_dvd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:169
bool ctf_type_exists(ctf_container_ref, dw_die_ref, ctf_dtdef_ref *)
Definition ctfc.cc:861
ctf_dtdef_ref ctf_add_forward(ctf_container_ref, uint32_t, const char *, uint32_t, dw_die_ref)
Definition ctfc.cc:449
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
ctf_dtdef_ref ctf_add_sou(ctf_container_ref, uint32_t, const char *, uint32_t, size_t, dw_die_ref)
Definition ctfc.cc:800
void ctfc_delete_container(ctf_container_ref)
Definition ctfc.cc:993
ctf_container_t * ctf_container_ref
Definition ctfc.h:347
void ctf_add_cuname(ctf_container_ref, const char *)
Definition ctfc.cc:332
size_t ctfc_get_num_vlen_bytes(ctf_container_ref)
Definition ctfc.cc:82
ctf_dtu_d_union_enum
Definition ctfc.h:218
@ CTF_DTU_D_ARGUMENTS
Definition ctfc.h:222
@ CTF_DTU_D_SLICE
Definition ctfc.h:223
@ CTF_DTU_D_MEMBERS
Definition ctfc.h:219
@ CTF_DTU_D_ENCODING
Definition ctfc.h:221
@ CTF_DTU_D_ARRAY
Definition ctfc.h:220
ctf_dvdef_t * ctf_dvdef_ref
Definition ctfc.h:203
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:487
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:429
ctf_dtdef_ref ctf_add_integer(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:526
ctf_dtdef_ref ctf_lookup_tree_type(ctf_container_ref, const tree)
Definition ctfc.cc:843
void ctf_init(void)
Definition ctfc.cc:1036
ctf_container_ref ctf_get_tu_ctfc(void)
Definition ctfc.cc:33
void btf_early_finish(void)
Definition btfout.cc:1175
ctf_dtdef_ref ctf_add_array(ctf_container_ref, uint32_t, const ctf_arinfo_t *, dw_die_ref)
Definition ctfc.cc:547
bool(* funcs_traverse_callback)(ctf_dtdef_ref, void *)
Definition ctfc.h:456
struct ctf_encoding ctf_encoding_t
ctf_dtdef_t * ctf_dtdef_ref
Definition ctfc.h:53
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:605
ctf_dtdef_ref ctf_add_typedef(ctf_container_ref, uint32_t, const char *, ctf_dtdef_ref, dw_die_ref)
Definition ctfc.cc:465
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:540
int ctfc_get_dvd_srcloc(ctf_dvdef_ref, ctf_srcloc_ref)
Definition ctfc.cc:895
ctf_dtdef_ref ctf_add_unknown(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:533
void ctfc_delete_strtab(ctf_strtable_t *)
Definition ctfc.cc:971
void btf_finalize(void)
Definition btfout.cc:1654
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
const char * ctf_add_string(ctf_container_ref, const char *, uint32_t *, int)
Definition ctfc.cc:318
void btf_mark_type_used(tree)
Definition btfout.cc:1512
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:1684
ctf_srcloc_t * ctf_srcloc_ref
Definition ctfc.h:214
struct ctf_funcinfo ctf_funcinfo_t
unsigned int ctfc_get_num_ctf_vars(ctf_container_ref)
Definition ctfc.cc:56
int ctf_add_variable(ctf_container_ref, const char *, ctf_dtdef_ref, dw_die_ref, unsigned int, dw_die_ref)
Definition ctfc.cc:695
void btf_finish(void)
Definition btfout.cc:1612
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:771
void init_ctf_strtable(ctf_strtable_t *)
Definition ctfc.cc:913
ctf_dtdef_ref ctf_add_enum(ctf_container_ref, uint32_t, const char *, HOST_WIDE_INT, bool, dw_die_ref)
Definition ctfc.cc:570
int ctfc_get_dtd_srcloc(ctf_dtdef_ref, ctf_srcloc_ref)
Definition ctfc.cc:882
struct ctf_srcloc ctf_srcloc_t
int ctf_add_function_arg(ctf_container_ref, dw_die_ref, const char *, ctf_dtdef_ref)
Definition ctfc.cc:739
struct ctf_arinfo ctf_arinfo_t
ctf_container_ref tu_ctfc
Definition ctfc.cc:30
bool ctf_dvd_ignore_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:203
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:654
ctf_dtdef_ref ctf_dtd_lookup(const ctf_container_ref ctfc, dw_die_ref die)
Definition ctfc.cc:136
ctf_dtdef_ref ctf_add_float(ctf_container_ref, uint32_t, const char *, const ctf_encoding_t *, dw_die_ref)
Definition ctfc.cc:519
Definition ctfc.h:87
unsigned int ctr_nelems
Definition ctfc.h:90
ctf_dtdef_ref ctr_contents
Definition ctfc.h:88
ctf_dtdef_ref ctr_index
Definition ctfc.h:89
Definition ctfc.h:274
hash_table< ctfc_dtd_hasher > * ctfc_types
Definition ctfc.h:282
size_t ctfc_strlen
Definition ctfc.h:336
ctf_dtdef_t ** ctfc_types_list
Definition ctfc.h:319
unsigned char ctfc_flags
Definition ctfc.h:278
unsigned short ctfc_magic
Definition ctfc.h:276
hash_table< ctfc_dvd_hasher > * ctfc_vars
Definition ctfc.h:284
uint64_t ctfc_num_vlen_bytes
Definition ctfc.h:302
uint64_t ctfc_num_stypes
Definition ctfc.h:295
ctf_id_t ctfc_nextid
Definition ctfc.h:305
hash_table< ctfc_dvd_hasher > * ctfc_ignore_vars
Definition ctfc.h:286
uint64_t ctfc_num_types
Definition ctfc.h:294
uint64_t ctfc_vars_list_count
Definition ctfc.h:315
ctf_strtable_t ctfc_strtable
Definition ctfc.h:289
uint64_t ctfc_num_global_funcs
Definition ctfc.h:296
uint32_t ctfc_cuname_offset
Definition ctfc.h:279
size_t ctfc_aux_strlen
Definition ctfc.h:338
ctf_dvdef_t ** ctfc_vars_list
Definition ctfc.h:313
ctf_dvdef_t ** ctfc_gobjts_list
Definition ctfc.h:326
uint64_t ctfc_numbytes_asm
Definition ctfc.h:334
ctf_dtdef_t ** ctfc_gfuncs_list
Definition ctfc.h:323
ctf_strtable_t ctfc_aux_strtable
Definition ctfc.h:292
uint64_t ctfc_num_global_objts
Definition ctfc.h:297
unsigned char ctfc_version
Definition ctfc.h:277
Definition ctfc.h:134
HOST_WIDE_INT dmd_value
Definition ctfc.h:139
struct ctf_dmdef * dmd_next
Definition ctfc.h:140
uint32_t dmd_name_offset
Definition ctfc.h:137
const char * dmd_name
Definition ctfc.h:135
ctf_dtdef_ref dmd_type
Definition ctfc.h:136
uint64_t dmd_offset
Definition ctfc.h:138
Definition ctfc.h:160
BOOL_BITFIELD from_global_func
Definition ctfc.h:169
ctf_func_arg_t * dtu_argv
Definition ctfc.h:182
BOOL_BITFIELD dtd_enum_unsigned
Definition ctfc.h:171
ctf_sliceinfo_t dtu_slice
Definition ctfc.h:184
ctf_dtdef_ref ref_type
Definition ctfc.h:164
union ctf_dtdef::@13 dtd_u
ctf_itype_t dtd_data
Definition ctfc.h:165
ctf_dmdef_t * dtu_members
Definition ctfc.h:176
uint32_t linkage
Definition ctfc.h:166
ctf_arinfo_t dtu_arr
Definition ctfc.h:178
dw_die_ref dtd_key
Definition ctfc.h:161
ctf_id_t dtd_type
Definition ctfc.h:163
const char * dtd_name
Definition ctfc.h:162
ctf_encoding_t dtu_enc
Definition ctfc.h:180
Definition ctfc.h:193
unsigned int dvd_visibility
Definition ctfc.h:197
uint32_t dvd_name_offset
Definition ctfc.h:196
const char * dvd_name
Definition ctfc.h:195
ctf_dtdef_ref dvd_type
Definition ctfc.h:198
ctf_id_t dvd_id
Definition ctfc.h:199
dw_die_ref dvd_key
Definition ctfc.h:194
Definition ctfc.h:78
unsigned int cte_offset
Definition ctfc.h:80
unsigned int cte_bits
Definition ctfc.h:81
unsigned int cte_format
Definition ctfc.h:79
Definition ctfc.h:148
const char * farg_name
Definition ctfc.h:150
struct ctf_func_arg * farg_next
Definition ctfc.h:152
uint32_t farg_name_offset
Definition ctfc.h:151
ctf_dtdef_ref farg_type
Definition ctfc.h:149
Definition ctfc.h:96
ctf_dtdef_ref ctc_return
Definition ctfc.h:97
unsigned int ctc_flags
Definition ctfc.h:99
unsigned int ctc_argc
Definition ctfc.h:98
Definition ctfc.h:113
uint32_t ctti_lsizehi
Definition ctfc.h:120
uint32_t ctti_info
Definition ctfc.h:115
uint32_t _type
Definition ctfc.h:118
union ctf_itype::@12 _u
uint32_t ctti_lsizelo
Definition ctfc.h:121
uint32_t ctti_name
Definition ctfc.h:114
uint32_t _size
Definition ctfc.h:117
Definition ctfc.h:103
unsigned short cts_offset
Definition ctfc.h:105
unsigned short cts_bits
Definition ctfc.h:106
ctf_dtdef_ref cts_type
Definition ctfc.h:104
Definition ctfc.h:208
unsigned int ctsloc_line
Definition ctfc.h:210
unsigned int ctsloc_col
Definition ctfc.h:211
const char * ctsloc_file
Definition ctfc.h:209
Definition ctfc.h:58
struct ctf_string * cts_next
Definition ctfc.h:60
const char * cts_str
Definition ctfc.h:59
Definition ctfc.h:66
ctf_string_t * ctstab_head
Definition ctfc.h:67
int ctstab_num
Definition ctfc.h:69
size_t ctstab_len
Definition ctfc.h:70
ctf_string_t * ctstab_tail
Definition ctfc.h:68
const char * ctstab_estr
Definition ctfc.h:71
Definition ctfc.h:230
ctf_dtdef_ref compare_type
Definition ctfc.h:231
static bool equal(ctf_dtdef_ref, ctf_dtdef_ref)
Definition ctfc.h:244
static hashval_t hash(ctf_dtdef_ref)
Definition ctfc.h:238
Definition ctfc.h:250
ctf_dvdef_ref compare_type
Definition ctfc.h:251
static bool equal(ctf_dvdef_ref, ctf_dvdef_ref)
Definition ctfc.h:264
static hashval_t hash(ctf_dvdef_ref)
Definition ctfc.h:258
Definition dwarf2out.cc:3178
Definition hash-traits.h:321
#define BOOL_BITFIELD
Definition system.h:903
#define bool
Definition system.h:893