Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Dwarf.h
Go to the documentation of this file.
1//===-- llvm/BinaryFormat/Dwarf.h ---Dwarf Constants-------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// This file contains constants used for implementing Dwarf
11/// debug support.
12///
13/// For details on the Dwarf specfication see the latest DWARF Debugging
14/// Information Format standard document on http://www.dwarfstd.org. This
15/// file often includes support for non-released standard features.
16//
17//===----------------------------------------------------------------------===//
18
19#ifndef LLVM_BINARYFORMAT_DWARF_H
20#define LLVM_BINARYFORMAT_DWARF_H
21
22#include "llvm/Support/Compiler.h"
23#include "llvm/Support/DataTypes.h"
24#include "llvm/Support/ErrorHandling.h"
25#include "llvm/Support/Format.h"
26#include "llvm/Support/FormatVariadicDetails.h"
27#include "llvm/TargetParser/Triple.h"
28
29#include <limits>
30
31namespacellvm {
32classStringRef;
33
34namespacedwarf {
35
36//===----------------------------------------------------------------------===//
37// DWARF constants as gleaned from the DWARF Debugging Information Format V.5
38// reference manual http://www.dwarfstd.org/.
39//
40
41// Do not mix the following two enumerations sets. DW_TAG_invalid changes the
42// enumeration base type.
43
44enumLLVMConstants :uint32_t {
45 /// LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
46 /// \{
47DW_TAG_invalid = ~0U,///< Tag for invalid results.
48DW_VIRTUALITY_invalid = ~0U,///< Virtuality for invalid results.
49DW_MACINFO_invalid = ~0U,///< Macinfo type for invalid results.
50 /// \}
51
52 /// Special values for an initial length field.
53 /// \{
54DW_LENGTH_lo_reserved = 0xfffffff0,///< Lower bound of the reserved range.
55DW_LENGTH_DWARF64 = 0xffffffff,///< Indicator of 64-bit DWARF format.
56DW_LENGTH_hi_reserved = 0xffffffff,///< Upper bound of the reserved range.
57 /// \}
58
59 /// Other constants.
60 /// \{
61DWARF_VERSION = 4,///< Default dwarf version we output.
62DW_PUBTYPES_VERSION = 2,///< Section version number for .debug_pubtypes.
63DW_PUBNAMES_VERSION = 2,///< Section version number for .debug_pubnames.
64DW_ARANGES_VERSION = 2,///< Section version number for .debug_aranges.
65 /// \}
66
67 /// Identifiers we use to distinguish vendor extensions.
68 /// \{
69DWARF_VENDOR_DWARF = 0,///< Defined in v2 or later of the DWARF standard.
70DWARF_VENDOR_APPLE = 1,
71DWARF_VENDOR_BORLAND = 2,
72DWARF_VENDOR_GNU = 3,
73DWARF_VENDOR_GOOGLE = 4,
74DWARF_VENDOR_LLVM = 5,
75DWARF_VENDOR_MIPS = 6,
76DWARF_VENDOR_WASM = 7,
77DWARF_VENDOR_ALTIUM,
78DWARF_VENDOR_COMPAQ,
79DWARF_VENDOR_GHS,
80DWARF_VENDOR_GO,
81DWARF_VENDOR_HP,
82DWARF_VENDOR_IBM,
83DWARF_VENDOR_INTEL,
84DWARF_VENDOR_PGI,
85DWARF_VENDOR_SUN,
86DWARF_VENDOR_UPC,
87 ///\}
88};
89
90/// Constants that define the DWARF format as 32 or 64 bit.
91enumDwarfFormat :uint8_t {DWARF32,DWARF64 };
92
93/// Special ID values that distinguish a CIE from a FDE in DWARF CFI.
94/// Not inside an enum because a 64-bit value is needed.
95/// @{
96constuint32_tDW_CIE_ID = UINT32_MAX;
97constuint64_tDW64_CIE_ID =UINT64_MAX;
98/// @}
99
100/// Identifier of an invalid DIE offset in the .debug_info section.
101constuint32_tDW_INVALID_OFFSET = UINT32_MAX;
102
103enumTag :uint16_t {
104#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) DW_TAG_##NAME = ID,
105#include "llvm/BinaryFormat/Dwarf.def"
106DW_TAG_lo_user = 0x4080,
107DW_TAG_hi_user = 0xffff,
108DW_TAG_user_base = 0x1000///< Recommended base for user tags.
109};
110
111inlineboolisType(TagT) {
112switch (T) {
113default:
114returnfalse;
115#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
116 case DW_TAG_##NAME: \
117 return (KIND == DW_KIND_TYPE);
118#include "llvm/BinaryFormat/Dwarf.def"
119 }
120}
121
122/// Attributes.
123enumAttribute :uint16_t {
124#define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID,
125#include "llvm/BinaryFormat/Dwarf.def"
126DW_AT_lo_user = 0x2000,
127DW_AT_hi_user = 0x3fff,
128};
129
130enumForm :uint16_t {
131#define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID,
132#include "llvm/BinaryFormat/Dwarf.def"
133DW_FORM_lo_user = 0x1f00,///< Not specified by DWARF.
134};
135
136enumLocationAtom {
137#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \
138 DW_OP_##NAME = ID,
139#include "llvm/BinaryFormat/Dwarf.def"
140DW_OP_lo_user = 0xe0,
141DW_OP_hi_user = 0xff,
142DW_OP_LLVM_fragment = 0x1000,///< Only used in LLVM metadata.
143DW_OP_LLVM_convert = 0x1001,///< Only used in LLVM metadata.
144DW_OP_LLVM_tag_offset = 0x1002,///< Only used in LLVM metadata.
145DW_OP_LLVM_entry_value = 0x1003,///< Only used in LLVM metadata.
146DW_OP_LLVM_implicit_pointer = 0x1004,///< Only used in LLVM metadata.
147DW_OP_LLVM_arg = 0x1005,///< Only used in LLVM metadata.
148DW_OP_LLVM_extract_bits_sext = 0x1006,///< Only used in LLVM metadata.
149DW_OP_LLVM_extract_bits_zext = 0x1007,///< Only used in LLVM metadata.
150};
151
152enumLlvmUserLocationAtom {
153#define HANDLE_DW_OP_LLVM_USEROP(ID, NAME) DW_OP_LLVM_##NAME = ID,
154#include "llvm/BinaryFormat/Dwarf.def"
155};
156
157enumTypeKind :uint8_t {
158#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID,
159#include "llvm/BinaryFormat/Dwarf.def"
160DW_ATE_lo_user = 0x80,
161DW_ATE_hi_user = 0xff
162};
163
164enumDecimalSignEncoding {
165// Decimal sign attribute values
166DW_DS_unsigned = 0x01,
167DW_DS_leading_overpunch = 0x02,
168DW_DS_trailing_overpunch = 0x03,
169DW_DS_leading_separate = 0x04,
170DW_DS_trailing_separate = 0x05
171};
172
173enumEndianityEncoding {
174// Endianity attribute values
175#define HANDLE_DW_END(ID, NAME) DW_END_##NAME = ID,
176#include "llvm/BinaryFormat/Dwarf.def"
177DW_END_lo_user = 0x40,
178DW_END_hi_user = 0xff
179};
180
181enumAccessAttribute {
182// Accessibility codes
183DW_ACCESS_public = 0x01,
184DW_ACCESS_protected = 0x02,
185DW_ACCESS_private = 0x03
186};
187
188enumVisibilityAttribute {
189// Visibility codes
190DW_VIS_local = 0x01,
191DW_VIS_exported = 0x02,
192DW_VIS_qualified = 0x03
193};
194
195enumVirtualityAttribute {
196#define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,
197#include "llvm/BinaryFormat/Dwarf.def"
198DW_VIRTUALITY_max = 0x02
199};
200
201enumDefaultedMemberAttribute {
202#define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID,
203#include "llvm/BinaryFormat/Dwarf.def"
204DW_DEFAULTED_max = 0x02
205};
206
207enumSourceLanguage {
208#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
209 DW_LANG_##NAME = ID,
210#include "llvm/BinaryFormat/Dwarf.def"
211DW_LANG_lo_user = 0x8000,
212DW_LANG_hi_user = 0xffff
213};
214
215enumSourceLanguageName :uint16_t {
216#define HANDLE_DW_LNAME(ID, NAME, DESC, LOWER_BOUND) DW_LNAME_##NAME = ID,
217#include "llvm/BinaryFormat/Dwarf.def"
218};
219
220/// Convert a DWARF 6 pair of language name and version to a DWARF 5 DW_LANG.
221/// If the version number doesn't exactly match a known version it is
222/// rounded up to the next-highest known version number.
223inline std::optional<SourceLanguage>toDW_LANG(SourceLanguageNamename,
224uint32_t version) {
225switch (name) {
226case DW_LNAME_Ada:// YYYY
227if (version <= 1983)
228return DW_LANG_Ada83;
229if (version <= 1995)
230return DW_LANG_Ada95;
231if (version <= 2005)
232return DW_LANG_Ada2005;
233if (version <= 2012)
234return DW_LANG_Ada2012;
235return {};
236case DW_LNAME_BLISS:
237return DW_LANG_BLISS;
238case DW_LNAME_C:// YYYYMM, K&R 000000
239if (version == 0)
240return DW_LANG_C;
241if (version <= 198912)
242return DW_LANG_C89;
243if (version <= 199901)
244return DW_LANG_C99;
245if (version <= 201112)
246return DW_LANG_C11;
247if (version <= 201710)
248return DW_LANG_C17;
249return {};
250case DW_LNAME_C_plus_plus:// YYYYMM
251if (version == 0)
252return DW_LANG_C_plus_plus;
253if (version <= 199711)
254return DW_LANG_C_plus_plus;
255if (version <= 200310)
256return DW_LANG_C_plus_plus_03;
257if (version <= 201103)
258return DW_LANG_C_plus_plus_11;
259if (version <= 201402)
260return DW_LANG_C_plus_plus_14;
261if (version <= 201703)
262return DW_LANG_C_plus_plus_17;
263if (version <= 202002)
264return DW_LANG_C_plus_plus_20;
265return {};
266case DW_LNAME_Cobol:// YYYY
267if (version <= 1974)
268return DW_LANG_Cobol74;
269if (version <= 1985)
270return DW_LANG_Cobol85;
271return {};
272case DW_LNAME_Crystal:
273return DW_LANG_Crystal;
274case DW_LNAME_D:
275return DW_LANG_D;
276case DW_LNAME_Dylan:
277return DW_LANG_Dylan;
278case DW_LNAME_Fortran:// YYYY
279if (version <= 1977)
280return DW_LANG_Fortran77;
281if (version <= 1990)
282return DW_LANG_Fortran90;
283if (version <= 1995)
284return DW_LANG_Fortran95;
285if (version <= 2003)
286return DW_LANG_Fortran03;
287if (version <= 2008)
288return DW_LANG_Fortran08;
289if (version <= 2018)
290return DW_LANG_Fortran18;
291return {};
292case DW_LNAME_Go:
293return DW_LANG_Go;
294case DW_LNAME_Haskell:
295return DW_LANG_Haskell;
296// case DW_LNAME_HIP:
297// return DW_LANG_HIP;
298case DW_LNAME_Java:
299return DW_LANG_Java;
300case DW_LNAME_Julia:
301return DW_LANG_Julia;
302case DW_LNAME_Kotlin:
303return DW_LANG_Kotlin;
304case DW_LNAME_Modula2:
305return DW_LANG_Modula2;
306case DW_LNAME_Modula3:
307return DW_LANG_Modula3;
308case DW_LNAME_ObjC:
309return DW_LANG_ObjC;
310case DW_LNAME_ObjC_plus_plus:
311return DW_LANG_ObjC_plus_plus;
312case DW_LNAME_OCaml:
313return DW_LANG_OCaml;
314case DW_LNAME_OpenCL_C:
315return DW_LANG_OpenCL;
316case DW_LNAME_Pascal:
317return DW_LANG_Pascal83;
318case DW_LNAME_PLI:
319return DW_LANG_PLI;
320case DW_LNAME_Python:
321return DW_LANG_Python;
322case DW_LNAME_RenderScript:
323return DW_LANG_RenderScript;
324case DW_LNAME_Rust:
325return DW_LANG_Rust;
326case DW_LNAME_Swift:
327return DW_LANG_Swift;
328case DW_LNAME_UPC:
329return DW_LANG_UPC;
330case DW_LNAME_Zig:
331return DW_LANG_Zig;
332case DW_LNAME_Assembly:
333return DW_LANG_Assembly;
334case DW_LNAME_C_sharp:
335return DW_LANG_C_sharp;
336case DW_LNAME_Mojo:
337return DW_LANG_Mojo;
338case DW_LNAME_GLSL:
339return DW_LANG_GLSL;
340case DW_LNAME_GLSL_ES:
341return DW_LANG_GLSL_ES;
342case DW_LNAME_HLSL:
343return DW_LANG_HLSL;
344case DW_LNAME_OpenCL_CPP:
345return DW_LANG_OpenCL_CPP;
346case DW_LNAME_CPP_for_OpenCL:
347return {};
348case DW_LNAME_SYCL:
349return DW_LANG_SYCL;
350case DW_LNAME_Ruby:
351return DW_LANG_Ruby;
352case DW_LNAME_Move:
353return DW_LANG_Move;
354case DW_LNAME_Hylo:
355return DW_LANG_Hylo;
356case DW_LNAME_Metal:
357return DW_LANG_Metal;
358 }
359return {};
360}
361
362/// Convert a DWARF 5 DW_LANG to a DWARF 6 pair of language name and version.
363inline std::optional<std::pair<SourceLanguageName, uint32_t>>
364toDW_LNAME(SourceLanguage language) {
365switch (language) {
366case DW_LANG_Ada83:
367return {{DW_LNAME_Ada, 1983}};
368case DW_LANG_Ada95:
369return {{DW_LNAME_Ada, 1995}};
370case DW_LANG_Ada2005:
371return {{DW_LNAME_Ada, 2005}};
372case DW_LANG_Ada2012:
373return {{DW_LNAME_Ada, 2012}};
374case DW_LANG_BLISS:
375return {{DW_LNAME_BLISS, 0}};
376case DW_LANG_C:
377return {{DW_LNAME_C, 0}};
378case DW_LANG_C89:
379return {{DW_LNAME_C, 198912}};
380case DW_LANG_C99:
381return {{DW_LNAME_C, 199901}};
382case DW_LANG_C11:
383return {{DW_LNAME_C, 201112}};
384case DW_LANG_C17:
385return {{DW_LNAME_C, 201712}};
386case DW_LANG_C_plus_plus:
387return {{DW_LNAME_C_plus_plus, 0}};
388case DW_LANG_C_plus_plus_03:
389return {{DW_LNAME_C_plus_plus, 200310}};
390case DW_LANG_C_plus_plus_11:
391return {{DW_LNAME_C_plus_plus, 201103}};
392case DW_LANG_C_plus_plus_14:
393return {{DW_LNAME_C_plus_plus, 201402}};
394case DW_LANG_C_plus_plus_17:
395return {{DW_LNAME_C_plus_plus, 201703}};
396case DW_LANG_C_plus_plus_20:
397return {{DW_LNAME_C_plus_plus, 202002}};
398case DW_LANG_Cobol74:
399return {{DW_LNAME_Cobol, 1974}};
400case DW_LANG_Cobol85:
401return {{DW_LNAME_Cobol, 1985}};
402case DW_LANG_Crystal:
403return {{DW_LNAME_Crystal, 0}};
404case DW_LANG_D:
405return {{DW_LNAME_D, 0}};
406case DW_LANG_Dylan:
407return {{DW_LNAME_Dylan, 0}};
408case DW_LANG_Fortran77:
409return {{DW_LNAME_Fortran, 1977}};
410case DW_LANG_Fortran90:
411return {{DW_LNAME_Fortran, 1990}};
412case DW_LANG_Fortran95:
413return {{DW_LNAME_Fortran, 1995}};
414case DW_LANG_Fortran03:
415return {{DW_LNAME_Fortran, 2003}};
416case DW_LANG_Fortran08:
417return {{DW_LNAME_Fortran, 2008}};
418case DW_LANG_Fortran18:
419return {{DW_LNAME_Fortran, 2018}};
420case DW_LANG_Go:
421return {{DW_LNAME_Go, 0}};
422case DW_LANG_Haskell:
423return {{DW_LNAME_Haskell, 0}};
424case DW_LANG_HIP:
425return {};// return {{DW_LNAME_HIP, 0}};
426case DW_LANG_Java:
427return {{DW_LNAME_Java, 0}};
428case DW_LANG_Julia:
429return {{DW_LNAME_Julia, 0}};
430case DW_LANG_Kotlin:
431return {{DW_LNAME_Kotlin, 0}};
432case DW_LANG_Modula2:
433return {{DW_LNAME_Modula2, 0}};
434case DW_LANG_Modula3:
435return {{DW_LNAME_Modula3, 0}};
436case DW_LANG_ObjC:
437return {{DW_LNAME_ObjC, 0}};
438case DW_LANG_ObjC_plus_plus:
439return {{DW_LNAME_ObjC_plus_plus, 0}};
440case DW_LANG_OCaml:
441return {{DW_LNAME_OCaml, 0}};
442case DW_LANG_OpenCL:
443return {{DW_LNAME_OpenCL_C, 0}};
444case DW_LANG_Pascal83:
445return {{DW_LNAME_Pascal, 1983}};
446case DW_LANG_PLI:
447return {{DW_LNAME_PLI, 0}};
448case DW_LANG_Python:
449return {{DW_LNAME_Python, 0}};
450case DW_LANG_RenderScript:
451case DW_LANG_GOOGLE_RenderScript:
452return {{DW_LNAME_RenderScript, 0}};
453case DW_LANG_Rust:
454return {{DW_LNAME_Rust, 0}};
455case DW_LANG_Swift:
456return {{DW_LNAME_Swift, 0}};
457case DW_LANG_UPC:
458return {{DW_LNAME_UPC, 0}};
459case DW_LANG_Zig:
460return {{DW_LNAME_Zig, 0}};
461case DW_LANG_Assembly:
462case DW_LANG_Mips_Assembler:
463return {{DW_LNAME_Assembly, 0}};
464case DW_LANG_C_sharp:
465return {{DW_LNAME_C_sharp, 0}};
466case DW_LANG_Mojo:
467return {{DW_LNAME_Mojo, 0}};
468case DW_LANG_GLSL:
469return {{DW_LNAME_GLSL, 0}};
470case DW_LANG_GLSL_ES:
471return {{DW_LNAME_GLSL_ES, 0}};
472case DW_LANG_HLSL:
473return {{DW_LNAME_HLSL, 0}};
474case DW_LANG_OpenCL_CPP:
475return {{DW_LNAME_OpenCL_CPP, 0}};
476case DW_LANG_SYCL:
477return {{DW_LNAME_SYCL, 0}};
478case DW_LANG_Ruby:
479return {{DW_LNAME_Ruby, 0}};
480case DW_LANG_Move:
481return {{DW_LNAME_Move, 0}};
482case DW_LANG_Hylo:
483return {{DW_LNAME_Hylo, 0}};
484case DW_LANG_Metal:
485return {{DW_LNAME_Metal, 0}};
486case DW_LANG_BORLAND_Delphi:
487case DW_LANG_CPP_for_OpenCL:
488caseDW_LANG_lo_user:
489caseDW_LANG_hi_user:
490return {};
491 }
492return {};
493}
494
495llvm::StringRefLanguageDescription(SourceLanguageNamename);
496
497inlineboolisCPlusPlus(SourceLanguage S) {
498bool result =false;
499// Deliberately enumerate all the language options so we get a warning when
500// new language options are added (-Wswitch) that'll hopefully help keep this
501// switch up-to-date when new C++ versions are added.
502switch (S) {
503case DW_LANG_C_plus_plus:
504case DW_LANG_C_plus_plus_03:
505case DW_LANG_C_plus_plus_11:
506case DW_LANG_C_plus_plus_14:
507case DW_LANG_C_plus_plus_17:
508case DW_LANG_C_plus_plus_20:
509 result =true;
510break;
511case DW_LANG_C89:
512case DW_LANG_C:
513case DW_LANG_Ada83:
514case DW_LANG_Cobol74:
515case DW_LANG_Cobol85:
516case DW_LANG_Fortran77:
517case DW_LANG_Fortran90:
518case DW_LANG_Pascal83:
519case DW_LANG_Modula2:
520case DW_LANG_Java:
521case DW_LANG_C99:
522case DW_LANG_Ada95:
523case DW_LANG_Fortran95:
524case DW_LANG_PLI:
525case DW_LANG_ObjC:
526case DW_LANG_ObjC_plus_plus:
527case DW_LANG_UPC:
528case DW_LANG_D:
529case DW_LANG_Python:
530case DW_LANG_OpenCL:
531case DW_LANG_Go:
532case DW_LANG_Modula3:
533case DW_LANG_Haskell:
534case DW_LANG_OCaml:
535case DW_LANG_Rust:
536case DW_LANG_C11:
537case DW_LANG_Swift:
538case DW_LANG_Julia:
539case DW_LANG_Dylan:
540case DW_LANG_Fortran03:
541case DW_LANG_Fortran08:
542case DW_LANG_RenderScript:
543case DW_LANG_BLISS:
544case DW_LANG_Mips_Assembler:
545case DW_LANG_GOOGLE_RenderScript:
546case DW_LANG_BORLAND_Delphi:
547caseDW_LANG_lo_user:
548caseDW_LANG_hi_user:
549case DW_LANG_Kotlin:
550case DW_LANG_Zig:
551case DW_LANG_Crystal:
552case DW_LANG_C17:
553case DW_LANG_Fortran18:
554case DW_LANG_Ada2005:
555case DW_LANG_Ada2012:
556case DW_LANG_HIP:
557case DW_LANG_Assembly:
558case DW_LANG_C_sharp:
559case DW_LANG_Mojo:
560case DW_LANG_GLSL:
561case DW_LANG_GLSL_ES:
562case DW_LANG_HLSL:
563case DW_LANG_OpenCL_CPP:
564case DW_LANG_CPP_for_OpenCL:
565case DW_LANG_SYCL:
566case DW_LANG_Ruby:
567case DW_LANG_Move:
568case DW_LANG_Hylo:
569case DW_LANG_Metal:
570 result =false;
571break;
572 }
573
574return result;
575}
576
577inlineboolisFortran(SourceLanguage S) {
578bool result =false;
579// Deliberately enumerate all the language options so we get a warning when
580// new language options are added (-Wswitch) that'll hopefully help keep this
581// switch up-to-date when new Fortran versions are added.
582switch (S) {
583case DW_LANG_Fortran77:
584case DW_LANG_Fortran90:
585case DW_LANG_Fortran95:
586case DW_LANG_Fortran03:
587case DW_LANG_Fortran08:
588case DW_LANG_Fortran18:
589 result =true;
590break;
591case DW_LANG_C89:
592case DW_LANG_C:
593case DW_LANG_Ada83:
594case DW_LANG_C_plus_plus:
595case DW_LANG_Cobol74:
596case DW_LANG_Cobol85:
597case DW_LANG_Pascal83:
598case DW_LANG_Modula2:
599case DW_LANG_Java:
600case DW_LANG_C99:
601case DW_LANG_Ada95:
602case DW_LANG_PLI:
603case DW_LANG_ObjC:
604case DW_LANG_ObjC_plus_plus:
605case DW_LANG_UPC:
606case DW_LANG_D:
607case DW_LANG_Python:
608case DW_LANG_OpenCL:
609case DW_LANG_Go:
610case DW_LANG_Modula3:
611case DW_LANG_Haskell:
612case DW_LANG_C_plus_plus_03:
613case DW_LANG_C_plus_plus_11:
614case DW_LANG_OCaml:
615case DW_LANG_Rust:
616case DW_LANG_C11:
617case DW_LANG_Swift:
618case DW_LANG_Julia:
619case DW_LANG_Dylan:
620case DW_LANG_C_plus_plus_14:
621case DW_LANG_RenderScript:
622case DW_LANG_BLISS:
623case DW_LANG_Mips_Assembler:
624case DW_LANG_GOOGLE_RenderScript:
625case DW_LANG_BORLAND_Delphi:
626caseDW_LANG_lo_user:
627caseDW_LANG_hi_user:
628case DW_LANG_Kotlin:
629case DW_LANG_Zig:
630case DW_LANG_Crystal:
631case DW_LANG_C_plus_plus_17:
632case DW_LANG_C_plus_plus_20:
633case DW_LANG_C17:
634case DW_LANG_Ada2005:
635case DW_LANG_Ada2012:
636case DW_LANG_HIP:
637case DW_LANG_Assembly:
638case DW_LANG_C_sharp:
639case DW_LANG_Mojo:
640case DW_LANG_GLSL:
641case DW_LANG_GLSL_ES:
642case DW_LANG_HLSL:
643case DW_LANG_OpenCL_CPP:
644case DW_LANG_CPP_for_OpenCL:
645case DW_LANG_SYCL:
646case DW_LANG_Ruby:
647case DW_LANG_Move:
648case DW_LANG_Hylo:
649case DW_LANG_Metal:
650 result =false;
651break;
652 }
653
654return result;
655}
656
657inlineboolisC(SourceLanguage S) {
658// Deliberately enumerate all the language options so we get a warning when
659// new language options are added (-Wswitch) that'll hopefully help keep this
660// switch up-to-date when new C++ versions are added.
661switch (S) {
662case DW_LANG_C11:
663case DW_LANG_C17:
664case DW_LANG_C89:
665case DW_LANG_C99:
666case DW_LANG_C:
667case DW_LANG_ObjC:
668returntrue;
669case DW_LANG_C_plus_plus:
670case DW_LANG_C_plus_plus_03:
671case DW_LANG_C_plus_plus_11:
672case DW_LANG_C_plus_plus_14:
673case DW_LANG_C_plus_plus_17:
674case DW_LANG_C_plus_plus_20:
675case DW_LANG_Ada83:
676case DW_LANG_Cobol74:
677case DW_LANG_Cobol85:
678case DW_LANG_Fortran77:
679case DW_LANG_Fortran90:
680case DW_LANG_Pascal83:
681case DW_LANG_Modula2:
682case DW_LANG_Java:
683case DW_LANG_Ada95:
684case DW_LANG_Fortran95:
685case DW_LANG_PLI:
686case DW_LANG_ObjC_plus_plus:
687case DW_LANG_UPC:
688case DW_LANG_D:
689case DW_LANG_Python:
690case DW_LANG_OpenCL:
691case DW_LANG_Go:
692case DW_LANG_Modula3:
693case DW_LANG_Haskell:
694case DW_LANG_OCaml:
695case DW_LANG_Rust:
696case DW_LANG_Swift:
697case DW_LANG_Julia:
698case DW_LANG_Dylan:
699case DW_LANG_Fortran03:
700case DW_LANG_Fortran08:
701case DW_LANG_RenderScript:
702case DW_LANG_BLISS:
703case DW_LANG_Mips_Assembler:
704case DW_LANG_GOOGLE_RenderScript:
705case DW_LANG_BORLAND_Delphi:
706caseDW_LANG_lo_user:
707caseDW_LANG_hi_user:
708case DW_LANG_Kotlin:
709case DW_LANG_Zig:
710case DW_LANG_Crystal:
711case DW_LANG_Fortran18:
712case DW_LANG_Ada2005:
713case DW_LANG_Ada2012:
714case DW_LANG_HIP:
715case DW_LANG_Assembly:
716case DW_LANG_C_sharp:
717case DW_LANG_Mojo:
718case DW_LANG_GLSL:
719case DW_LANG_GLSL_ES:
720case DW_LANG_HLSL:
721case DW_LANG_OpenCL_CPP:
722case DW_LANG_CPP_for_OpenCL:
723case DW_LANG_SYCL:
724case DW_LANG_Ruby:
725case DW_LANG_Move:
726case DW_LANG_Hylo:
727case DW_LANG_Metal:
728returnfalse;
729 }
730llvm_unreachable("Unknown language kind.");
731}
732
733inlineTypeKindgetArrayIndexTypeEncoding(SourceLanguage S) {
734returnisFortran(S) ? DW_ATE_signed : DW_ATE_unsigned;
735}
736
737enumCaseSensitivity {
738// Identifier case codes
739DW_ID_case_sensitive = 0x00,
740DW_ID_up_case = 0x01,
741DW_ID_down_case = 0x02,
742DW_ID_case_insensitive = 0x03
743};
744
745enumCallingConvention {
746// Calling convention codes
747#define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID,
748#include "llvm/BinaryFormat/Dwarf.def"
749DW_CC_lo_user = 0x40,
750DW_CC_hi_user = 0xff
751};
752
753enumInlineAttribute {
754// Inline codes
755DW_INL_not_inlined = 0x00,
756DW_INL_inlined = 0x01,
757DW_INL_declared_not_inlined = 0x02,
758DW_INL_declared_inlined = 0x03
759};
760
761enumArrayDimensionOrdering {
762// Array ordering
763DW_ORD_row_major = 0x00,
764DW_ORD_col_major = 0x01
765};
766
767enumDiscriminantList {
768// Discriminant descriptor values
769DW_DSC_label = 0x00,
770DW_DSC_range = 0x01
771};
772
773/// Line Number Standard Opcode Encodings.
774enumLineNumberOps :uint8_t {
775#define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID,
776#include "llvm/BinaryFormat/Dwarf.def"
777};
778
779/// Line Number Extended Opcode Encodings.
780enumLineNumberExtendedOps {
781#define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID,
782#include "llvm/BinaryFormat/Dwarf.def"
783DW_LNE_lo_user = 0x80,
784DW_LNE_hi_user = 0xff
785};
786
787enumLineNumberEntryFormat {
788#define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID,
789#include "llvm/BinaryFormat/Dwarf.def"
790DW_LNCT_lo_user = 0x2000,
791DW_LNCT_hi_user = 0x3fff,
792};
793
794enumMacinfoRecordType {
795// Macinfo Type Encodings
796DW_MACINFO_define = 0x01,
797DW_MACINFO_undef = 0x02,
798DW_MACINFO_start_file = 0x03,
799DW_MACINFO_end_file = 0x04,
800DW_MACINFO_vendor_ext = 0xff
801};
802
803/// DWARF v5 macro information entry type encodings.
804enumMacroEntryType {
805#define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID,
806#include "llvm/BinaryFormat/Dwarf.def"
807DW_MACRO_lo_user = 0xe0,
808DW_MACRO_hi_user = 0xff
809};
810
811/// GNU .debug_macro macro information entry type encodings.
812enumGnuMacroEntryType {
813#define HANDLE_DW_MACRO_GNU(ID, NAME) DW_MACRO_GNU_##NAME = ID,
814#include "llvm/BinaryFormat/Dwarf.def"
815DW_MACRO_GNU_lo_user = 0xe0,
816DW_MACRO_GNU_hi_user = 0xff
817};
818
819/// DWARF v5 range list entry encoding values.
820enumRnglistEntries {
821#define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
822#include "llvm/BinaryFormat/Dwarf.def"
823};
824
825/// DWARF v5 loc list entry encoding values.
826enumLoclistEntries {
827#define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID,
828#include "llvm/BinaryFormat/Dwarf.def"
829};
830
831/// Call frame instruction encodings.
832enumCallFrameInfo {
833#define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
834#define HANDLE_DW_CFA_PRED(ID, NAME, ARCH) DW_CFA_##NAME = ID,
835#include "llvm/BinaryFormat/Dwarf.def"
836DW_CFA_extended = 0x00,
837
838DW_CFA_lo_user = 0x1c,
839DW_CFA_hi_user = 0x3f
840};
841
842enumConstants {
843// Children flag
844DW_CHILDREN_no = 0x00,
845DW_CHILDREN_yes = 0x01,
846
847DW_EH_PE_absptr = 0x00,
848DW_EH_PE_omit = 0xff,
849DW_EH_PE_uleb128 = 0x01,
850DW_EH_PE_udata2 = 0x02,
851DW_EH_PE_udata4 = 0x03,
852DW_EH_PE_udata8 = 0x04,
853DW_EH_PE_sleb128 = 0x09,
854DW_EH_PE_sdata2 = 0x0A,
855DW_EH_PE_sdata4 = 0x0B,
856DW_EH_PE_sdata8 = 0x0C,
857DW_EH_PE_signed = 0x08,
858DW_EH_PE_pcrel = 0x10,
859DW_EH_PE_textrel = 0x20,
860DW_EH_PE_datarel = 0x30,
861DW_EH_PE_funcrel = 0x40,
862DW_EH_PE_aligned = 0x50,
863DW_EH_PE_indirect = 0x80
864};
865
866/// Constants for the DW_APPLE_PROPERTY_attributes attribute.
867/// Keep this list in sync with clang's DeclObjCCommon.h
868/// ObjCPropertyAttribute::Kind!
869enumApplePropertyAttributes {
870#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID,
871#include "llvm/BinaryFormat/Dwarf.def"
872};
873
874/// Constants for unit types in DWARF v5.
875enumUnitType :unsignedchar {
876#define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID,
877#include "llvm/BinaryFormat/Dwarf.def"
878DW_UT_lo_user = 0x80,
879DW_UT_hi_user = 0xff
880};
881
882enumIndex {
883#define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID,
884#include "llvm/BinaryFormat/Dwarf.def"
885DW_IDX_lo_user = 0x2000,
886DW_IDX_hi_user = 0x3fff
887};
888
889inlineboolisUnitType(uint8_tUnitType) {
890switch (UnitType) {
891case DW_UT_compile:
892case DW_UT_type:
893case DW_UT_partial:
894case DW_UT_skeleton:
895case DW_UT_split_compile:
896case DW_UT_split_type:
897returntrue;
898default:
899returnfalse;
900 }
901}
902
903inlineboolisUnitType(dwarf::TagT) {
904switch (T) {
905case DW_TAG_compile_unit:
906case DW_TAG_type_unit:
907case DW_TAG_partial_unit:
908case DW_TAG_skeleton_unit:
909returntrue;
910default:
911returnfalse;
912 }
913}
914
915// Constants for the DWARF v5 Accelerator Table Proposal
916enumAcceleratorTable {
917// Data layout descriptors.
918DW_ATOM_null = 0u,/// Marker as the end of a list of atoms.
919DW_ATOM_die_offset = 1u,// DIE offset in the debug_info section.
920DW_ATOM_cu_offset = 2u,// Offset of the compile unit header that contains the
921// item in question.
922DW_ATOM_die_tag = 3u,// A tag entry.
923DW_ATOM_type_flags = 4u,// Set of flags for a type.
924
925DW_ATOM_type_type_flags = 5u,// Dsymutil type extension.
926DW_ATOM_qual_name_hash = 6u,// Dsymutil qualified hash extension.
927
928// DW_ATOM_type_flags values.
929
930// Always set for C++, only set for ObjC if this is the @implementation for a
931// class.
932DW_FLAG_type_implementation = 2u,
933
934// Hash functions.
935
936// Daniel J. Bernstein hash.
937DW_hash_function_djb = 0u
938};
939
940// Return a suggested bucket count for the DWARF v5 Accelerator Table.
941inlineuint32_tgetDebugNamesBucketCount(uint32_t UniqueHashCount) {
942if (UniqueHashCount > 1024)
943return UniqueHashCount / 4;
944if (UniqueHashCount > 16)
945return UniqueHashCount / 2;
946return std::max<uint32_t>(UniqueHashCount, 1);
947}
948
949// Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
950enumGDBIndexEntryKind {
951GIEK_NONE,
952GIEK_TYPE,
953GIEK_VARIABLE,
954GIEK_FUNCTION,
955GIEK_OTHER,
956GIEK_UNUSED5,
957GIEK_UNUSED6,
958GIEK_UNUSED7
959};
960
961enumGDBIndexEntryLinkage {GIEL_EXTERNAL,GIEL_STATIC };
962
963/// \defgroup DwarfConstantsDumping Dwarf constants dumping functions
964///
965/// All these functions map their argument's value back to the
966/// corresponding enumerator name or return an empty StringRef if the value
967/// isn't known.
968///
969/// @{
970StringRefTagString(unsignedTag);
971StringRefChildrenString(unsigned Children);
972StringRefAttributeString(unsignedAttribute);
973StringRefFormEncodingString(unsigned Encoding);
974StringRefOperationEncodingString(unsigned Encoding);
975StringRefSubOperationEncodingString(unsigned OpEncoding,
976unsigned SubOpEncoding);
977StringRefAttributeEncodingString(unsigned Encoding);
978StringRefDecimalSignString(unsigned Sign);
979StringRefEndianityString(unsignedEndian);
980StringRefAccessibilityString(unsignedAccess);
981StringRefDefaultedMemberString(unsigned DefaultedEncodings);
982StringRefVisibilityString(unsigned Visibility);
983StringRefVirtualityString(unsigned Virtuality);
984StringRefLanguageString(unsigned Language);
985StringRefCaseString(unsigned Case);
986StringRefConventionString(unsigned Convention);
987StringRefInlineCodeString(unsigned Code);
988StringRefArrayOrderString(unsigned Order);
989StringRefLNStandardString(unsigned Standard);
990StringRefLNExtendedString(unsigned Encoding);
991StringRefMacinfoString(unsigned Encoding);
992StringRefMacroString(unsigned Encoding);
993StringRefGnuMacroString(unsigned Encoding);
994StringRefRangeListEncodingString(unsigned Encoding);
995StringRefLocListEncodingString(unsigned Encoding);
996StringRefCallFrameString(unsigned Encoding,Triple::ArchType Arch);
997StringRefApplePropertyString(unsigned);
998StringRefUnitTypeString(unsigned);
999StringRefAtomTypeString(unsigned Atom);
1000StringRefGDBIndexEntryKindString(GDBIndexEntryKind Kind);
1001StringRefGDBIndexEntryLinkageString(GDBIndexEntryLinkageLinkage);
1002StringRefIndexString(unsignedIdx);
1003StringRefFormatString(DwarfFormatFormat);
1004StringRefFormatString(bool IsDWARF64);
1005StringRefRLEString(unsigned RLE);
1006/// @}
1007
1008/// \defgroup DwarfConstantsParsing Dwarf constants parsing functions
1009///
1010/// These functions map their strings back to the corresponding enumeration
1011/// value or return 0 if there is none, except for these exceptions:
1012///
1013/// \li \a getTag() returns \a DW_TAG_invalid on invalid input.
1014/// \li \a getVirtuality() returns \a DW_VIRTUALITY_invalid on invalid input.
1015/// \li \a getMacinfo() returns \a DW_MACINFO_invalid on invalid input.
1016///
1017/// @{
1018unsignedgetTag(StringRefTagString);
1019unsignedgetOperationEncoding(StringRefOperationEncodingString);
1020unsignedgetSubOperationEncoding(unsigned OpEncoding,
1021StringRefSubOperationEncodingString);
1022unsignedgetVirtuality(StringRefVirtualityString);
1023unsignedgetLanguage(StringRefLanguageString);
1024unsignedgetCallingConvention(StringRefLanguageString);
1025unsignedgetAttributeEncoding(StringRef EncodingString);
1026unsignedgetMacinfo(StringRefMacinfoString);
1027unsignedgetMacro(StringRefMacroString);
1028/// @}
1029
1030/// \defgroup DwarfConstantsVersioning Dwarf version for constants
1031///
1032/// For constants defined by DWARF, returns the DWARF version when the constant
1033/// was first defined. For vendor extensions, if there is a version-related
1034/// policy for when to emit it, returns a version number for that policy.
1035/// Otherwise returns 0.
1036///
1037/// @{
1038unsignedTagVersion(TagT);
1039unsignedAttributeVersion(AttributeA);
1040unsignedFormVersion(FormF);
1041unsignedOperationVersion(LocationAtom O);
1042unsignedAttributeEncodingVersion(TypeKindE);
1043unsignedLanguageVersion(SourceLanguage L);
1044/// @}
1045
1046/// \defgroup DwarfConstantsVendor Dwarf "vendor" for constants
1047///
1048/// These functions return an identifier describing "who" defined the constant,
1049/// either the DWARF standard itself or the vendor who defined the extension.
1050///
1051/// @{
1052unsignedTagVendor(TagT);
1053unsignedAttributeVendor(AttributeA);
1054unsignedFormVendor(FormF);
1055unsignedOperationVendor(LocationAtom O);
1056unsignedAttributeEncodingVendor(TypeKindE);
1057unsignedLanguageVendor(SourceLanguage L);
1058/// @}
1059
1060/// The number of operands for the given LocationAtom.
1061std::optional<unsigned>OperationOperands(LocationAtom O);
1062
1063/// The arity of the given LocationAtom. This is the number of elements on the
1064/// stack this operation operates on. Returns -1 if the arity is variable (e.g.
1065/// depending on the argument) or unknown.
1066std::optional<unsigned>OperationArity(LocationAtom O);
1067
1068std::optional<unsigned>LanguageLowerBound(SourceLanguage L);
1069
1070/// The size of a reference determined by the DWARF 32/64-bit format.
1071inlineuint8_tgetDwarfOffsetByteSize(DwarfFormatFormat) {
1072switch (Format) {
1073caseDwarfFormat::DWARF32:
1074return 4;
1075caseDwarfFormat::DWARF64:
1076return 8;
1077 }
1078llvm_unreachable("Invalid Format value");
1079}
1080
1081/// A helper struct providing information about the byte size of DW_FORM
1082/// values that vary in size depending on the DWARF version, address byte
1083/// size, or DWARF32/DWARF64.
1084structFormParams {
1085uint16_tVersion;
1086uint8_tAddrSize;
1087DwarfFormatFormat;
1088 /// True if DWARF v2 output generally uses relocations for references
1089 /// to other .debug_* sections.
1090boolDwarfUsesRelocationsAcrossSections =false;
1091
1092 /// The definition of the size of form DW_FORM_ref_addr depends on the
1093 /// version. In DWARF v2 it's the size of an address; after that, it's the
1094 /// size of a reference.
1095uint8_tgetRefAddrByteSize() const{
1096if (Version == 2)
1097returnAddrSize;
1098returngetDwarfOffsetByteSize();
1099 }
1100
1101 /// The size of a reference is determined by the DWARF 32/64-bit format.
1102uint8_tgetDwarfOffsetByteSize() const{
1103returndwarf::getDwarfOffsetByteSize(Format);
1104 }
1105
1106explicitoperatorbool() const{returnVersion &&AddrSize; }
1107};
1108
1109/// Get the byte size of the unit length field depending on the DWARF format.
1110inlineuint8_tgetUnitLengthFieldByteSize(DwarfFormatFormat) {
1111switch (Format) {
1112caseDwarfFormat::DWARF32:
1113return 4;
1114caseDwarfFormat::DWARF64:
1115return 12;
1116 }
1117llvm_unreachable("Invalid Format value");
1118}
1119
1120/// Get the fixed byte size for a given form.
1121///
1122/// If the form has a fixed byte size, then an Optional with a value will be
1123/// returned. If the form is always encoded using a variable length storage
1124/// format (ULEB or SLEB numbers or blocks) then std::nullopt will be returned.
1125///
1126/// \param Form DWARF form to get the fixed byte size for.
1127/// \param Params DWARF parameters to help interpret forms.
1128/// \returns std::optional<uint8_t> value with the fixed byte size or
1129/// std::nullopt if \p Form doesn't have a fixed byte size.
1130std::optional<uint8_t>getFixedFormByteSize(dwarf::FormForm,
1131 FormParams Params);
1132
1133/// Tells whether the specified form is defined in the specified version,
1134/// or is an extension if extensions are allowed.
1135boolisValidFormForVersion(FormF,unsignedVersion,bool ExtensionsOk =true);
1136
1137/// Returns the symbolic string representing Val when used as a value
1138/// for attribute Attr.
1139StringRefAttributeValueString(uint16_t Attr,unsigned Val);
1140
1141/// Returns the symbolic string representing Val when used as a value
1142/// for atom Atom.
1143StringRefAtomValueString(uint16_t Atom,unsigned Val);
1144
1145/// Describes an entry of the various gnu_pub* debug sections.
1146///
1147/// The gnu_pub* kind looks like:
1148///
1149/// 0-3 reserved
1150/// 4-6 symbol kind
1151/// 7 0 == global, 1 == static
1152///
1153/// A gdb_index descriptor includes the above kind, shifted 24 bits up with the
1154/// offset of the cu within the debug_info section stored in those 24 bits.
1155structPubIndexEntryDescriptor {
1156GDBIndexEntryKindKind;
1157GDBIndexEntryLinkageLinkage;
1158PubIndexEntryDescriptor(GDBIndexEntryKindKind,GDBIndexEntryLinkageLinkage)
1159 :Kind(Kind),Linkage(Linkage) {}
1160/* implicit */PubIndexEntryDescriptor(GDBIndexEntryKindKind)
1161 :Kind(Kind),Linkage(GIEL_EXTERNAL) {}
1162explicitPubIndexEntryDescriptor(uint8_tValue)
1163 :Kind(
1164 static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >> KIND_OFFSET)),
1165Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>
1166 LINKAGE_OFFSET)) {}
1167uint8_ttoBits() const{
1168returnKind << KIND_OFFSET |Linkage << LINKAGE_OFFSET;
1169 }
1170
1171private:
1172enum {
1173 KIND_OFFSET = 4,
1174 KIND_MASK = 7 << KIND_OFFSET,
1175 LINKAGE_OFFSET = 7,
1176 LINKAGE_MASK = 1 << LINKAGE_OFFSET
1177 };
1178};
1179
1180template <typename Enum>structEnumTraits :public std::false_type {};
1181
1182template <>structEnumTraits<Attribute> :public std::true_type {
1183staticconstexprcharType[3] ="AT";
1184staticconstexprStringRef (*StringFn)(unsigned) = &AttributeString;
1185};
1186
1187template <>structEnumTraits<Form> :public std::true_type {
1188staticconstexprcharType[5] ="FORM";
1189staticconstexprStringRef (*StringFn)(unsigned) = &FormEncodingString;
1190};
1191
1192template <>structEnumTraits<Index> :public std::true_type {
1193staticconstexprcharType[4] ="IDX";
1194staticconstexprStringRef (*StringFn)(unsigned) = &IndexString;
1195};
1196
1197template <>structEnumTraits<Tag> :public std::true_type {
1198staticconstexprcharType[4] ="TAG";
1199staticconstexprStringRef (*StringFn)(unsigned) = &TagString;
1200};
1201
1202template <>structEnumTraits<LineNumberOps> :public std::true_type {
1203staticconstexprcharType[4] ="LNS";
1204staticconstexprStringRef (*StringFn)(unsigned) = &LNStandardString;
1205};
1206
1207template <>structEnumTraits<LocationAtom> :public std::true_type {
1208staticconstexprcharType[3] ="OP";
1209staticconstexprStringRef (*StringFn)(unsigned) = &OperationEncodingString;
1210};
1211
1212inlineuint64_tcomputeTombstoneAddress(uint8_t AddressByteSize) {
1213return std::numeric_limits<uint64_t>::max() >> (8 - AddressByteSize) * 8;
1214}
1215
1216}// End of namespace dwarf
1217
1218/// Dwarf constants format_provider
1219///
1220/// Specialization of the format_provider template for dwarf enums. Unlike the
1221/// dumping functions above, these format unknown enumerator values as
1222/// DW_TYPE_unknown_1234 (e.g. DW_TAG_unknown_ffff).
1223template <typename Enum>
1224structformat_provider<Enum,std::enable_if_t<dwarf::EnumTraits<Enum>::value>> {
1225staticvoidformat(const Enum &E,raw_ostream &OS,StringRef Style) {
1226StringRef Str =dwarf::EnumTraits<Enum>::StringFn(E);
1227if (Str.empty()) {
1228OS <<"DW_" <<dwarf::EnumTraits<Enum>::Type <<"_unknown_"
1229 <<llvm::format("%x",E);
1230 }else
1231OS << Str;
1232 }
1233};
1234}// End of namespace llvm
1235
1236#endif
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Compiler.h
Linkage
DXIL Finalize Linkage
Definition:DXILFinalizeLinkage.cpp:58
Access
DXIL Resource Access
Definition:DXILResourceAccess.cpp:296
Idx
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Definition:DeadArgumentElimination.cpp:353
FormatVariadicDetails.h
Format.h
F
#define F(x, y, z)
Definition:MD5.cpp:55
name
static const char * name
Definition:SMEABIPass.cpp:46
SourceLanguage
SourceLanguage
Definition:SPIRVEmitNonSemanticDI.cpp:77
Endian
endianness Endian
Definition:SampleProfWriter.cpp:52
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
Triple.h
T
bool
llvm::Attribute
Definition:Attributes.h:67
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Triple::ArchType
ArchType
Definition:Triple.h:46
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:raw_ostream.h:52
uint16_t
uint32_t
uint64_t
uint8_t
unsigned
llvm::dwarf::LNExtendedString
StringRef LNExtendedString(unsigned Encoding)
Definition:Dwarf.cpp:523
llvm::dwarf::RangeListEncodingString
StringRef RangeListEncodingString(unsigned Encoding)
Definition:Dwarf.cpp:591
llvm::dwarf::CaseString
StringRef CaseString(unsigned Case)
Definition:Dwarf.cpp:456
llvm::dwarf::VisibilityString
StringRef VisibilityString(unsigned Visibility)
Definition:Dwarf.cpp:362
llvm::dwarf::GDBIndexEntryLinkageString
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
Definition:Dwarf.cpp:706
llvm::dwarf::AttributeString
StringRef AttributeString(unsigned Attribute)
Definition:Dwarf.cpp:72
llvm::dwarf::CallFrameString
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
Definition:Dwarf.cpp:613
llvm::dwarf::FormEncodingString
StringRef FormEncodingString(unsigned Encoding)
Definition:Dwarf.cpp:105
llvm::dwarf::ArrayOrderString
StringRef ArrayOrderString(unsigned Order)
Definition:Dwarf.cpp:502
llvm::dwarf::MacroString
StringRef MacroString(unsigned Encoding)
Definition:Dwarf.cpp:563
llvm::dwarf::LocListEncodingString
StringRef LocListEncodingString(unsigned Encoding)
Definition:Dwarf.cpp:602
llvm::dwarf::IndexString
StringRef IndexString(unsigned Idx)
Definition:Dwarf.cpp:760
llvm::dwarf::RLEString
StringRef RLEString(unsigned RLE)
Definition:Dwarf.cpp:882
llvm::dwarf::SubOperationEncodingString
StringRef SubOperationEncodingString(unsigned OpEncoding, unsigned SubOpEncoding)
Definition:Dwarf.cpp:202
llvm::dwarf::LanguageString
StringRef LanguageString(unsigned Language)
Definition:Dwarf.cpp:393
llvm::dwarf::DecimalSignString
StringRef DecimalSignString(unsigned Sign)
Definition:Dwarf.cpp:304
llvm::dwarf::VirtualityString
StringRef VirtualityString(unsigned Virtuality)
Definition:Dwarf.cpp:374
llvm::dwarf::AttributeEncodingString
StringRef AttributeEncodingString(unsigned Encoding)
Definition:Dwarf.cpp:263
llvm::dwarf::ChildrenString
StringRef ChildrenString(unsigned Children)
Definition:Dwarf.cpp:62
llvm::dwarf::ApplePropertyString
StringRef ApplePropertyString(unsigned)
Definition:Dwarf.cpp:642
llvm::dwarf::AtomTypeString
StringRef AtomTypeString(unsigned Atom)
Definition:Dwarf.cpp:664
llvm::dwarf::FormatString
StringRef FormatString(DwarfFormat Format)
Definition:Dwarf.cpp:868
llvm::dwarf::GnuMacroString
StringRef GnuMacroString(unsigned Encoding)
Definition:Dwarf.cpp:574
llvm::dwarf::EndianityString
StringRef EndianityString(unsigned Endian)
Definition:Dwarf.cpp:320
llvm::dwarf::ConventionString
StringRef ConventionString(unsigned Convention)
Definition:Dwarf.cpp:470
llvm::dwarf::MacinfoString
StringRef MacinfoString(unsigned Encoding)
Definition:Dwarf.cpp:534
llvm::dwarf::OperationEncodingString
StringRef OperationEncodingString(unsigned Encoding)
Definition:Dwarf.cpp:138
llvm::dwarf::UnitTypeString
StringRef UnitTypeString(unsigned)
Definition:Dwarf.cpp:653
llvm::dwarf::InlineCodeString
StringRef InlineCodeString(unsigned Code)
Definition:Dwarf.cpp:488
llvm::dwarf::GDBIndexEntryKindString
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
Definition:Dwarf.cpp:683
llvm::dwarf::TagString
StringRef TagString(unsigned Tag)
Definition:Dwarf.cpp:21
llvm::dwarf::LNStandardString
StringRef LNStandardString(unsigned Standard)
Definition:Dwarf.cpp:512
llvm::dwarf::AccessibilityString
StringRef AccessibilityString(unsigned Access)
Definition:Dwarf.cpp:336
llvm::dwarf::DefaultedMemberString
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
Definition:Dwarf.cpp:349
llvm::dwarf::getSubOperationEncoding
unsigned getSubOperationEncoding(unsigned OpEncoding, StringRef SubOperationEncodingString)
Definition:Dwarf.cpp:209
llvm::dwarf::getOperationEncoding
unsigned getOperationEncoding(StringRef OperationEncodingString)
Definition:Dwarf.cpp:165
llvm::dwarf::getAttributeEncoding
unsigned getAttributeEncoding(StringRef EncodingString)
Definition:Dwarf.cpp:274
llvm::dwarf::getTag
unsigned getTag(StringRef TagString)
Definition:Dwarf.cpp:32
llvm::dwarf::getCallingConvention
unsigned getCallingConvention(StringRef LanguageString)
Definition:Dwarf.cpp:481
llvm::dwarf::getLanguage
unsigned getLanguage(StringRef LanguageString)
Definition:Dwarf.cpp:404
llvm::dwarf::getVirtuality
unsigned getVirtuality(StringRef VirtualityString)
Definition:Dwarf.cpp:385
llvm::dwarf::getMacro
unsigned getMacro(StringRef MacroString)
Definition:Dwarf.cpp:585
llvm::dwarf::getMacinfo
unsigned getMacinfo(StringRef MacinfoString)
Definition:Dwarf.cpp:553
llvm::dwarf::AttributeEncodingVendor
unsigned AttributeEncodingVendor(TypeKind E)
Definition:Dwarf.cpp:293
llvm::dwarf::FormVendor
unsigned FormVendor(Form F)
Definition:Dwarf.cpp:127
llvm::dwarf::AttributeVendor
unsigned AttributeVendor(Attribute A)
Definition:Dwarf.cpp:94
llvm::dwarf::OperationVendor
unsigned OperationVendor(LocationAtom O)
Definition:Dwarf.cpp:252
llvm::dwarf::TagVendor
unsigned TagVendor(Tag T)
Definition:Dwarf.cpp:51
llvm::dwarf::LanguageVendor
unsigned LanguageVendor(SourceLanguage L)
Definition:Dwarf.cpp:423
llvm::dwarf::OperationVersion
unsigned OperationVersion(LocationAtom O)
Definition:Dwarf.cpp:215
llvm::dwarf::AttributeVersion
unsigned AttributeVersion(Attribute A)
Definition:Dwarf.cpp:83
llvm::dwarf::LanguageVersion
unsigned LanguageVersion(SourceLanguage L)
Definition:Dwarf.cpp:412
llvm::dwarf::AttributeEncodingVersion
unsigned AttributeEncodingVersion(TypeKind E)
Definition:Dwarf.cpp:282
llvm::dwarf::TagVersion
unsigned TagVersion(Tag T)
Definition:Dwarf.cpp:40
llvm::dwarf::FormVersion
unsigned FormVersion(Form F)
Definition:Dwarf.cpp:116
UINT64_MAX
#define UINT64_MAX
Definition:DataTypes.h:77
DataTypes.h
ErrorHandling.h
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:ErrorHandling.h:143
llvm::dwarf::InlineAttribute
InlineAttribute
Definition:Dwarf.h:753
llvm::dwarf::DW_INL_not_inlined
@ DW_INL_not_inlined
Definition:Dwarf.h:755
llvm::dwarf::DW_INL_declared_not_inlined
@ DW_INL_declared_not_inlined
Definition:Dwarf.h:757
llvm::dwarf::DW_INL_inlined
@ DW_INL_inlined
Definition:Dwarf.h:756
llvm::dwarf::DW_INL_declared_inlined
@ DW_INL_declared_inlined
Definition:Dwarf.h:758
llvm::dwarf::DW_CIE_ID
const uint32_t DW_CIE_ID
Special ID values that distinguish a CIE from a FDE in DWARF CFI.
Definition:Dwarf.h:96
llvm::dwarf::getUnitLengthFieldByteSize
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
Definition:Dwarf.h:1110
llvm::dwarf::AccessAttribute
AccessAttribute
Definition:Dwarf.h:181
llvm::dwarf::DW_ACCESS_private
@ DW_ACCESS_private
Definition:Dwarf.h:185
llvm::dwarf::DW_ACCESS_protected
@ DW_ACCESS_protected
Definition:Dwarf.h:184
llvm::dwarf::DW_ACCESS_public
@ DW_ACCESS_public
Definition:Dwarf.h:183
llvm::dwarf::MacroEntryType
MacroEntryType
DWARF v5 macro information entry type encodings.
Definition:Dwarf.h:804
llvm::dwarf::DW_MACRO_lo_user
@ DW_MACRO_lo_user
Definition:Dwarf.h:807
llvm::dwarf::DW_MACRO_hi_user
@ DW_MACRO_hi_user
Definition:Dwarf.h:808
llvm::dwarf::Attribute
Attribute
Attributes.
Definition:Dwarf.h:123
llvm::dwarf::DW_AT_hi_user
@ DW_AT_hi_user
Definition:Dwarf.h:127
llvm::dwarf::DW_AT_lo_user
@ DW_AT_lo_user
Definition:Dwarf.h:126
llvm::dwarf::LanguageLowerBound
std::optional< unsigned > LanguageLowerBound(SourceLanguage L)
Definition:Dwarf.cpp:435
llvm::dwarf::LineNumberEntryFormat
LineNumberEntryFormat
Definition:Dwarf.h:787
llvm::dwarf::DW_LNCT_lo_user
@ DW_LNCT_lo_user
Definition:Dwarf.h:790
llvm::dwarf::DW_LNCT_hi_user
@ DW_LNCT_hi_user
Definition:Dwarf.h:791
llvm::dwarf::AtomValueString
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
Definition:Dwarf.cpp:749
llvm::dwarf::DefaultedMemberAttribute
DefaultedMemberAttribute
Definition:Dwarf.h:201
llvm::dwarf::DW_DEFAULTED_max
@ DW_DEFAULTED_max
Definition:Dwarf.h:204
llvm::dwarf::SourceLanguageName
SourceLanguageName
Definition:Dwarf.h:215
llvm::dwarf::DW64_CIE_ID
const uint64_t DW64_CIE_ID
Definition:Dwarf.h:97
llvm::dwarf::OperationArity
std::optional< unsigned > OperationArity(LocationAtom O)
The arity of the given LocationAtom.
Definition:Dwarf.cpp:239
llvm::dwarf::VisibilityAttribute
VisibilityAttribute
Definition:Dwarf.h:188
llvm::dwarf::DW_VIS_local
@ DW_VIS_local
Definition:Dwarf.h:190
llvm::dwarf::DW_VIS_exported
@ DW_VIS_exported
Definition:Dwarf.h:191
llvm::dwarf::DW_VIS_qualified
@ DW_VIS_qualified
Definition:Dwarf.h:192
llvm::dwarf::LlvmUserLocationAtom
LlvmUserLocationAtom
Definition:Dwarf.h:152
llvm::dwarf::ArrayDimensionOrdering
ArrayDimensionOrdering
Definition:Dwarf.h:761
llvm::dwarf::DW_ORD_row_major
@ DW_ORD_row_major
Definition:Dwarf.h:763
llvm::dwarf::DW_ORD_col_major
@ DW_ORD_col_major
Definition:Dwarf.h:764
llvm::dwarf::CallingConvention
CallingConvention
Definition:Dwarf.h:745
llvm::dwarf::DW_CC_lo_user
@ DW_CC_lo_user
Definition:Dwarf.h:749
llvm::dwarf::DW_CC_hi_user
@ DW_CC_hi_user
Definition:Dwarf.h:750
llvm::dwarf::LineNumberOps
LineNumberOps
Line Number Standard Opcode Encodings.
Definition:Dwarf.h:774
llvm::dwarf::TypeKind
TypeKind
Definition:Dwarf.h:157
llvm::dwarf::DW_ATE_hi_user
@ DW_ATE_hi_user
Definition:Dwarf.h:161
llvm::dwarf::DW_ATE_lo_user
@ DW_ATE_lo_user
Definition:Dwarf.h:160
llvm::dwarf::ApplePropertyAttributes
ApplePropertyAttributes
Constants for the DW_APPLE_PROPERTY_attributes attribute.
Definition:Dwarf.h:869
llvm::dwarf::LoclistEntries
LoclistEntries
DWARF v5 loc list entry encoding values.
Definition:Dwarf.h:826
llvm::dwarf::isFortran
bool isFortran(SourceLanguage S)
Definition:Dwarf.h:577
llvm::dwarf::isUnitType
bool isUnitType(uint8_t UnitType)
Definition:Dwarf.h:889
llvm::dwarf::Index
Index
Definition:Dwarf.h:882
llvm::dwarf::DW_IDX_lo_user
@ DW_IDX_lo_user
Definition:Dwarf.h:885
llvm::dwarf::DW_IDX_hi_user
@ DW_IDX_hi_user
Definition:Dwarf.h:886
llvm::dwarf::GnuMacroEntryType
GnuMacroEntryType
GNU .debug_macro macro information entry type encodings.
Definition:Dwarf.h:812
llvm::dwarf::DW_MACRO_GNU_lo_user
@ DW_MACRO_GNU_lo_user
Definition:Dwarf.h:815
llvm::dwarf::DW_MACRO_GNU_hi_user
@ DW_MACRO_GNU_hi_user
Definition:Dwarf.h:816
llvm::dwarf::UnitType
UnitType
Constants for unit types in DWARF v5.
Definition:Dwarf.h:875
llvm::dwarf::DW_UT_lo_user
@ DW_UT_lo_user
Definition:Dwarf.h:878
llvm::dwarf::DW_UT_hi_user
@ DW_UT_hi_user
Definition:Dwarf.h:879
llvm::dwarf::Form
Form
Definition:Dwarf.h:130
llvm::dwarf::DW_FORM_lo_user
@ DW_FORM_lo_user
Not specified by DWARF.
Definition:Dwarf.h:133
llvm::dwarf::EndianityEncoding
EndianityEncoding
Definition:Dwarf.h:173
llvm::dwarf::DW_END_lo_user
@ DW_END_lo_user
Definition:Dwarf.h:177
llvm::dwarf::DW_END_hi_user
@ DW_END_hi_user
Definition:Dwarf.h:178
llvm::dwarf::isType
bool isType(Tag T)
Definition:Dwarf.h:111
llvm::dwarf::LocationAtom
LocationAtom
Definition:Dwarf.h:136
llvm::dwarf::DW_OP_LLVM_entry_value
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
Definition:Dwarf.h:145
llvm::dwarf::DW_OP_LLVM_implicit_pointer
@ DW_OP_LLVM_implicit_pointer
Only used in LLVM metadata.
Definition:Dwarf.h:146
llvm::dwarf::DW_OP_LLVM_extract_bits_zext
@ DW_OP_LLVM_extract_bits_zext
Only used in LLVM metadata.
Definition:Dwarf.h:149
llvm::dwarf::DW_OP_lo_user
@ DW_OP_lo_user
Definition:Dwarf.h:140
llvm::dwarf::DW_OP_hi_user
@ DW_OP_hi_user
Definition:Dwarf.h:141
llvm::dwarf::DW_OP_LLVM_tag_offset
@ DW_OP_LLVM_tag_offset
Only used in LLVM metadata.
Definition:Dwarf.h:144
llvm::dwarf::DW_OP_LLVM_fragment
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
Definition:Dwarf.h:142
llvm::dwarf::DW_OP_LLVM_arg
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
Definition:Dwarf.h:147
llvm::dwarf::DW_OP_LLVM_convert
@ DW_OP_LLVM_convert
Only used in LLVM metadata.
Definition:Dwarf.h:143
llvm::dwarf::DW_OP_LLVM_extract_bits_sext
@ DW_OP_LLVM_extract_bits_sext
Only used in LLVM metadata.
Definition:Dwarf.h:148
llvm::dwarf::SourceLanguage
SourceLanguage
Definition:Dwarf.h:207
llvm::dwarf::DW_LANG_lo_user
@ DW_LANG_lo_user
Definition:Dwarf.h:211
llvm::dwarf::DW_LANG_hi_user
@ DW_LANG_hi_user
Definition:Dwarf.h:212
llvm::dwarf::CaseSensitivity
CaseSensitivity
Definition:Dwarf.h:737
llvm::dwarf::DW_ID_down_case
@ DW_ID_down_case
Definition:Dwarf.h:741
llvm::dwarf::DW_ID_case_insensitive
@ DW_ID_case_insensitive
Definition:Dwarf.h:742
llvm::dwarf::DW_ID_case_sensitive
@ DW_ID_case_sensitive
Definition:Dwarf.h:739
llvm::dwarf::DW_ID_up_case
@ DW_ID_up_case
Definition:Dwarf.h:740
llvm::dwarf::DwarfFormat
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition:Dwarf.h:91
llvm::dwarf::DWARF64
@ DWARF64
Definition:Dwarf.h:91
llvm::dwarf::DWARF32
@ DWARF32
Definition:Dwarf.h:91
llvm::dwarf::isValidFormForVersion
bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk=true)
Tells whether the specified form is defined in the specified version, or is an extension if extension...
Definition:Dwarf.cpp:859
llvm::dwarf::toDW_LANG
std::optional< SourceLanguage > toDW_LANG(SourceLanguageName name, uint32_t version)
Convert a DWARF 6 pair of language name and version to a DWARF 5 DW_LANG.
Definition:Dwarf.h:223
llvm::dwarf::MacinfoRecordType
MacinfoRecordType
Definition:Dwarf.h:794
llvm::dwarf::DW_MACINFO_undef
@ DW_MACINFO_undef
Definition:Dwarf.h:797
llvm::dwarf::DW_MACINFO_start_file
@ DW_MACINFO_start_file
Definition:Dwarf.h:798
llvm::dwarf::DW_MACINFO_end_file
@ DW_MACINFO_end_file
Definition:Dwarf.h:799
llvm::dwarf::DW_MACINFO_define
@ DW_MACINFO_define
Definition:Dwarf.h:796
llvm::dwarf::DW_MACINFO_vendor_ext
@ DW_MACINFO_vendor_ext
Definition:Dwarf.h:800
llvm::dwarf::DW_INVALID_OFFSET
const uint32_t DW_INVALID_OFFSET
Identifier of an invalid DIE offset in the .debug_info section.
Definition:Dwarf.h:101
llvm::dwarf::RnglistEntries
RnglistEntries
DWARF v5 range list entry encoding values.
Definition:Dwarf.h:820
llvm::dwarf::getFixedFormByteSize
std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
Definition:Dwarf.cpp:771
llvm::dwarf::getDwarfOffsetByteSize
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
Definition:Dwarf.h:1071
llvm::dwarf::VirtualityAttribute
VirtualityAttribute
Definition:Dwarf.h:195
llvm::dwarf::DW_VIRTUALITY_max
@ DW_VIRTUALITY_max
Definition:Dwarf.h:198
llvm::dwarf::GDBIndexEntryKind
GDBIndexEntryKind
Definition:Dwarf.h:950
llvm::dwarf::GIEK_NONE
@ GIEK_NONE
Definition:Dwarf.h:951
llvm::dwarf::GIEK_UNUSED7
@ GIEK_UNUSED7
Definition:Dwarf.h:958
llvm::dwarf::GIEK_TYPE
@ GIEK_TYPE
Definition:Dwarf.h:952
llvm::dwarf::GIEK_UNUSED6
@ GIEK_UNUSED6
Definition:Dwarf.h:957
llvm::dwarf::GIEK_OTHER
@ GIEK_OTHER
Definition:Dwarf.h:955
llvm::dwarf::GIEK_FUNCTION
@ GIEK_FUNCTION
Definition:Dwarf.h:954
llvm::dwarf::GIEK_UNUSED5
@ GIEK_UNUSED5
Definition:Dwarf.h:956
llvm::dwarf::GIEK_VARIABLE
@ GIEK_VARIABLE
Definition:Dwarf.h:953
llvm::dwarf::LineNumberExtendedOps
LineNumberExtendedOps
Line Number Extended Opcode Encodings.
Definition:Dwarf.h:780
llvm::dwarf::DW_LNE_hi_user
@ DW_LNE_hi_user
Definition:Dwarf.h:784
llvm::dwarf::DW_LNE_lo_user
@ DW_LNE_lo_user
Definition:Dwarf.h:783
llvm::dwarf::isCPlusPlus
bool isCPlusPlus(SourceLanguage S)
Definition:Dwarf.h:497
llvm::dwarf::Constants
Constants
Definition:Dwarf.h:842
llvm::dwarf::DW_EH_PE_textrel
@ DW_EH_PE_textrel
Definition:Dwarf.h:859
llvm::dwarf::DW_CHILDREN_no
@ DW_CHILDREN_no
Definition:Dwarf.h:844
llvm::dwarf::DW_EH_PE_datarel
@ DW_EH_PE_datarel
Definition:Dwarf.h:860
llvm::dwarf::DW_EH_PE_pcrel
@ DW_EH_PE_pcrel
Definition:Dwarf.h:858
llvm::dwarf::DW_EH_PE_signed
@ DW_EH_PE_signed
Definition:Dwarf.h:857
llvm::dwarf::DW_CHILDREN_yes
@ DW_CHILDREN_yes
Definition:Dwarf.h:845
llvm::dwarf::DW_EH_PE_sdata4
@ DW_EH_PE_sdata4
Definition:Dwarf.h:855
llvm::dwarf::DW_EH_PE_funcrel
@ DW_EH_PE_funcrel
Definition:Dwarf.h:861
llvm::dwarf::DW_EH_PE_aligned
@ DW_EH_PE_aligned
Definition:Dwarf.h:862
llvm::dwarf::DW_EH_PE_udata2
@ DW_EH_PE_udata2
Definition:Dwarf.h:850
llvm::dwarf::DW_EH_PE_sdata8
@ DW_EH_PE_sdata8
Definition:Dwarf.h:856
llvm::dwarf::DW_EH_PE_absptr
@ DW_EH_PE_absptr
Definition:Dwarf.h:847
llvm::dwarf::DW_EH_PE_sdata2
@ DW_EH_PE_sdata2
Definition:Dwarf.h:854
llvm::dwarf::DW_EH_PE_udata4
@ DW_EH_PE_udata4
Definition:Dwarf.h:851
llvm::dwarf::DW_EH_PE_udata8
@ DW_EH_PE_udata8
Definition:Dwarf.h:852
llvm::dwarf::DW_EH_PE_uleb128
@ DW_EH_PE_uleb128
Definition:Dwarf.h:849
llvm::dwarf::DW_EH_PE_indirect
@ DW_EH_PE_indirect
Definition:Dwarf.h:863
llvm::dwarf::DW_EH_PE_sleb128
@ DW_EH_PE_sleb128
Definition:Dwarf.h:853
llvm::dwarf::DW_EH_PE_omit
@ DW_EH_PE_omit
Definition:Dwarf.h:848
llvm::dwarf::getArrayIndexTypeEncoding
TypeKind getArrayIndexTypeEncoding(SourceLanguage S)
Definition:Dwarf.h:733
llvm::dwarf::AttributeValueString
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
Definition:Dwarf.cpp:716
llvm::dwarf::DiscriminantList
DiscriminantList
Definition:Dwarf.h:767
llvm::dwarf::DW_DSC_range
@ DW_DSC_range
Definition:Dwarf.h:770
llvm::dwarf::DW_DSC_label
@ DW_DSC_label
Definition:Dwarf.h:769
llvm::dwarf::OperationOperands
std::optional< unsigned > OperationOperands(LocationAtom O)
The number of operands for the given LocationAtom.
Definition:Dwarf.cpp:226
llvm::dwarf::Tag
Tag
Definition:Dwarf.h:103
llvm::dwarf::DW_TAG_user_base
@ DW_TAG_user_base
Recommended base for user tags.
Definition:Dwarf.h:108
llvm::dwarf::DW_TAG_hi_user
@ DW_TAG_hi_user
Definition:Dwarf.h:107
llvm::dwarf::DW_TAG_lo_user
@ DW_TAG_lo_user
Definition:Dwarf.h:106
llvm::dwarf::CallFrameInfo
CallFrameInfo
Call frame instruction encodings.
Definition:Dwarf.h:832
llvm::dwarf::DW_CFA_hi_user
@ DW_CFA_hi_user
Definition:Dwarf.h:839
llvm::dwarf::DW_CFA_extended
@ DW_CFA_extended
Definition:Dwarf.h:836
llvm::dwarf::DW_CFA_lo_user
@ DW_CFA_lo_user
Definition:Dwarf.h:838
llvm::dwarf::DecimalSignEncoding
DecimalSignEncoding
Definition:Dwarf.h:164
llvm::dwarf::DW_DS_leading_separate
@ DW_DS_leading_separate
Definition:Dwarf.h:169
llvm::dwarf::DW_DS_trailing_separate
@ DW_DS_trailing_separate
Definition:Dwarf.h:170
llvm::dwarf::DW_DS_trailing_overpunch
@ DW_DS_trailing_overpunch
Definition:Dwarf.h:168
llvm::dwarf::DW_DS_leading_overpunch
@ DW_DS_leading_overpunch
Definition:Dwarf.h:167
llvm::dwarf::DW_DS_unsigned
@ DW_DS_unsigned
Definition:Dwarf.h:166
llvm::dwarf::getDebugNamesBucketCount
uint32_t getDebugNamesBucketCount(uint32_t UniqueHashCount)
Definition:Dwarf.h:941
llvm::dwarf::computeTombstoneAddress
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
Definition:Dwarf.h:1212
llvm::dwarf::LanguageDescription
llvm::StringRef LanguageDescription(SourceLanguageName name)
Definition:Dwarf.cpp:446
llvm::dwarf::AcceleratorTable
AcceleratorTable
Definition:Dwarf.h:916
llvm::dwarf::DW_ATOM_type_flags
@ DW_ATOM_type_flags
Definition:Dwarf.h:923
llvm::dwarf::DW_ATOM_null
@ DW_ATOM_null
Definition:Dwarf.h:918
llvm::dwarf::DW_ATOM_die_tag
@ DW_ATOM_die_tag
Definition:Dwarf.h:922
llvm::dwarf::DW_FLAG_type_implementation
@ DW_FLAG_type_implementation
Definition:Dwarf.h:932
llvm::dwarf::DW_ATOM_qual_name_hash
@ DW_ATOM_qual_name_hash
Definition:Dwarf.h:926
llvm::dwarf::DW_ATOM_die_offset
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
Definition:Dwarf.h:919
llvm::dwarf::DW_ATOM_type_type_flags
@ DW_ATOM_type_type_flags
Definition:Dwarf.h:925
llvm::dwarf::DW_ATOM_cu_offset
@ DW_ATOM_cu_offset
Definition:Dwarf.h:920
llvm::dwarf::DW_hash_function_djb
@ DW_hash_function_djb
Definition:Dwarf.h:937
llvm::dwarf::isC
bool isC(SourceLanguage S)
Definition:Dwarf.h:657
llvm::dwarf::LLVMConstants
LLVMConstants
Definition:Dwarf.h:44
llvm::dwarf::DWARF_VENDOR_COMPAQ
@ DWARF_VENDOR_COMPAQ
Definition:Dwarf.h:78
llvm::dwarf::DWARF_VENDOR_LLVM
@ DWARF_VENDOR_LLVM
Definition:Dwarf.h:74
llvm::dwarf::DWARF_VENDOR_WASM
@ DWARF_VENDOR_WASM
Definition:Dwarf.h:76
llvm::dwarf::DW_ARANGES_VERSION
@ DW_ARANGES_VERSION
Section version number for .debug_aranges.
Definition:Dwarf.h:64
llvm::dwarf::DW_PUBNAMES_VERSION
@ DW_PUBNAMES_VERSION
Section version number for .debug_pubnames.
Definition:Dwarf.h:63
llvm::dwarf::DWARF_VENDOR_APPLE
@ DWARF_VENDOR_APPLE
Definition:Dwarf.h:70
llvm::dwarf::DWARF_VERSION
@ DWARF_VERSION
Other constants.
Definition:Dwarf.h:61
llvm::dwarf::DWARF_VENDOR_ALTIUM
@ DWARF_VENDOR_ALTIUM
Definition:Dwarf.h:77
llvm::dwarf::DWARF_VENDOR_IBM
@ DWARF_VENDOR_IBM
Definition:Dwarf.h:82
llvm::dwarf::DWARF_VENDOR_GO
@ DWARF_VENDOR_GO
Definition:Dwarf.h:80
llvm::dwarf::DWARF_VENDOR_SUN
@ DWARF_VENDOR_SUN
Definition:Dwarf.h:85
llvm::dwarf::DW_TAG_invalid
@ DW_TAG_invalid
LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
Definition:Dwarf.h:47
llvm::dwarf::DWARF_VENDOR_PGI
@ DWARF_VENDOR_PGI
Definition:Dwarf.h:84
llvm::dwarf::DWARF_VENDOR_HP
@ DWARF_VENDOR_HP
Definition:Dwarf.h:81
llvm::dwarf::DWARF_VENDOR_INTEL
@ DWARF_VENDOR_INTEL
Definition:Dwarf.h:83
llvm::dwarf::DW_LENGTH_lo_reserved
@ DW_LENGTH_lo_reserved
Special values for an initial length field.
Definition:Dwarf.h:54
llvm::dwarf::DW_MACINFO_invalid
@ DW_MACINFO_invalid
Macinfo type for invalid results.
Definition:Dwarf.h:49
llvm::dwarf::DWARF_VENDOR_UPC
@ DWARF_VENDOR_UPC
Definition:Dwarf.h:86
llvm::dwarf::DWARF_VENDOR_GNU
@ DWARF_VENDOR_GNU
Definition:Dwarf.h:72
llvm::dwarf::DW_VIRTUALITY_invalid
@ DW_VIRTUALITY_invalid
Virtuality for invalid results.
Definition:Dwarf.h:48
llvm::dwarf::DW_LENGTH_hi_reserved
@ DW_LENGTH_hi_reserved
Upper bound of the reserved range.
Definition:Dwarf.h:56
llvm::dwarf::DWARF_VENDOR_GOOGLE
@ DWARF_VENDOR_GOOGLE
Definition:Dwarf.h:73
llvm::dwarf::DWARF_VENDOR_BORLAND
@ DWARF_VENDOR_BORLAND
Definition:Dwarf.h:71
llvm::dwarf::DWARF_VENDOR_GHS
@ DWARF_VENDOR_GHS
Definition:Dwarf.h:79
llvm::dwarf::DWARF_VENDOR_MIPS
@ DWARF_VENDOR_MIPS
Definition:Dwarf.h:75
llvm::dwarf::DW_PUBTYPES_VERSION
@ DW_PUBTYPES_VERSION
Section version number for .debug_pubtypes.
Definition:Dwarf.h:62
llvm::dwarf::DW_LENGTH_DWARF64
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
Definition:Dwarf.h:55
llvm::dwarf::DWARF_VENDOR_DWARF
@ DWARF_VENDOR_DWARF
Identifiers we use to distinguish vendor extensions.
Definition:Dwarf.h:69
llvm::dwarf::GDBIndexEntryLinkage
GDBIndexEntryLinkage
Definition:Dwarf.h:961
llvm::dwarf::GIEL_EXTERNAL
@ GIEL_EXTERNAL
Definition:Dwarf.h:961
llvm::dwarf::GIEL_STATIC
@ GIEL_STATIC
Definition:Dwarf.h:961
llvm::dwarf::toDW_LNAME
std::optional< std::pair< SourceLanguageName, uint32_t > > toDW_LNAME(SourceLanguage language)
Convert a DWARF 5 DW_LANG to a DWARF 6 pair of language name and version.
Definition:Dwarf.h:364
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::format
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition:Format.h:125
llvm::ReplacementType::Format
@ Format
llvm::Version
@ Version
Definition:PGOCtxProfWriter.h:22
std
Implement std::hash so that hash_code can be used in STL containers.
Definition:BitVector.h:858
llvm::dwarf::EnumTraits
Definition:Dwarf.h:1180
llvm::dwarf::FormParams
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition:Dwarf.h:1084
llvm::dwarf::FormParams::DwarfUsesRelocationsAcrossSections
bool DwarfUsesRelocationsAcrossSections
True if DWARF v2 output generally uses relocations for references to other .debug_* sections.
Definition:Dwarf.h:1090
llvm::dwarf::FormParams::Format
DwarfFormat Format
Definition:Dwarf.h:1087
llvm::dwarf::FormParams::getDwarfOffsetByteSize
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
Definition:Dwarf.h:1102
llvm::dwarf::FormParams::getRefAddrByteSize
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
Definition:Dwarf.h:1095
llvm::dwarf::FormParams::AddrSize
uint8_t AddrSize
Definition:Dwarf.h:1086
llvm::dwarf::FormParams::Version
uint16_t Version
Definition:Dwarf.h:1085
llvm::dwarf::PubIndexEntryDescriptor
Describes an entry of the various gnu_pub* debug sections.
Definition:Dwarf.h:1155
llvm::dwarf::PubIndexEntryDescriptor::PubIndexEntryDescriptor
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
Definition:Dwarf.h:1158
llvm::dwarf::PubIndexEntryDescriptor::PubIndexEntryDescriptor
PubIndexEntryDescriptor(uint8_t Value)
Definition:Dwarf.h:1162
llvm::dwarf::PubIndexEntryDescriptor::PubIndexEntryDescriptor
PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
Definition:Dwarf.h:1160
llvm::dwarf::PubIndexEntryDescriptor::Linkage
GDBIndexEntryLinkage Linkage
Definition:Dwarf.h:1157
llvm::dwarf::PubIndexEntryDescriptor::Kind
GDBIndexEntryKind Kind
Definition:Dwarf.h:1156
llvm::dwarf::PubIndexEntryDescriptor::toBits
uint8_t toBits() const
Definition:Dwarf.h:1167
llvm::format_provider< Enum, std::enable_if_t< dwarf::EnumTraits< Enum >::value > >::format
static void format(const Enum &E, raw_ostream &OS, StringRef Style)
Definition:Dwarf.h:1225
llvm::format_provider
Definition:FormatVariadicDetails.h:19

Generated on Thu Jul 17 2025 09:32:35 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp