LLVM  10.0.0
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/ADT/Optional.h"
23 #include "llvm/Support/Compiler.h"
24 #include "llvm/Support/DataTypes.h"
26 #include "llvm/Support/Format.h"
28 #include "llvm/ADT/Triple.h"
29 
30 namespace llvm {
31 class StringRef;
32 
33 namespace dwarf {
34 
35 //===----------------------------------------------------------------------===//
36 // DWARF constants as gleaned from the DWARF Debugging Information Format V.5
37 // reference manual http://www.dwarfstd.org/.
38 //
39 
40 // Do not mix the following two enumerations sets. DW_TAG_invalid changes the
41 // enumeration base type.
42 
44  // LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
45  DW_TAG_invalid = ~0U, // Tag for invalid results.
46  DW_VIRTUALITY_invalid = ~0U, // Virtuality for invalid results.
47  DW_MACINFO_invalid = ~0U, // Macinfo type for invalid results.
48 
49  // Special values for an initial length field.
50  DW_LENGTH_lo_reserved = 0xfffffff0, // Lower bound of the reserved range.
51  DW_LENGTH_DWARF64 = 0xffffffff, // Indicator of 64-bit DWARF format.
52  DW_LENGTH_hi_reserved = 0xffffffff, // Upper bound of the reserved range.
53 
54  // Other constants.
55  DWARF_VERSION = 4, // Default dwarf version we output.
56  DW_PUBTYPES_VERSION = 2, // Section version number for .debug_pubtypes.
57  DW_PUBNAMES_VERSION = 2, // Section version number for .debug_pubnames.
58  DW_ARANGES_VERSION = 2, // Section version number for .debug_aranges.
59  // Identifiers we use to distinguish vendor extensions.
60  DWARF_VENDOR_DWARF = 0, // Defined in v2 or later of the DWARF standard.
68 };
69 
70 /// Constants that define the DWARF format as 32 or 64 bit.
71 enum DwarfFormat : uint8_t { DWARF32, DWARF64 };
72 
73 /// Special ID values that distinguish a CIE from a FDE in DWARF CFI.
74 /// Not inside an enum because a 64-bit value is needed.
75 /// @{
76 const uint32_t DW_CIE_ID = UINT32_MAX;
77 const uint64_t DW64_CIE_ID = UINT64_MAX;
78 /// @}
79 
80 /// Identifier of an invalid DIE offset in the .debug_info section.
81 const uint32_t DW_INVALID_OFFSET = UINT32_MAX;
82 
83 enum Tag : uint16_t {
84 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) DW_TAG_##NAME = ID,
85 #include "llvm/BinaryFormat/Dwarf.def"
86  DW_TAG_lo_user = 0x4080,
87  DW_TAG_hi_user = 0xffff,
88  DW_TAG_user_base = 0x1000 ///< Recommended base for user tags.
89 };
90 
91 inline bool isType(Tag T) {
92  switch (T) {
93  default:
94  return false;
95 #define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) \
96  case DW_TAG_##NAME: \
97  return (KIND == DW_KIND_TYPE);
98 #include "llvm/BinaryFormat/Dwarf.def"
99  }
100 }
101 
102 /// Attributes.
104 #define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID,
105 #include "llvm/BinaryFormat/Dwarf.def"
106  DW_AT_lo_user = 0x2000,
107  DW_AT_hi_user = 0x3fff,
108 };
109 
110 enum Form : uint16_t {
111 #define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID,
112 #include "llvm/BinaryFormat/Dwarf.def"
113  DW_FORM_lo_user = 0x1f00, ///< Not specified by DWARF.
114 };
115 
117 #define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) DW_OP_##NAME = ID,
118 #include "llvm/BinaryFormat/Dwarf.def"
121  DW_OP_LLVM_fragment = 0x1000, ///< Only used in LLVM metadata.
122  DW_OP_LLVM_convert = 0x1001, ///< Only used in LLVM metadata.
123  DW_OP_LLVM_tag_offset = 0x1002, ///< Only used in LLVM metadata.
124  DW_OP_LLVM_entry_value = 0x1003, ///< Only used in LLVM metadata.
125 };
126 
127 enum TypeKind : uint8_t {
128 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID,
129 #include "llvm/BinaryFormat/Dwarf.def"
132 };
133 
135  // Decimal sign attribute values
141 };
142 
144  // Endianity attribute values
145 #define HANDLE_DW_END(ID, NAME) DW_END_##NAME = ID,
146 #include "llvm/BinaryFormat/Dwarf.def"
149 };
150 
152  // Accessibility codes
156 };
157 
159  // Visibility codes
160  DW_VIS_local = 0x01,
163 };
164 
166 #define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,
167 #include "llvm/BinaryFormat/Dwarf.def"
169 };
170 
172 #define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID,
173 #include "llvm/BinaryFormat/Dwarf.def"
175 };
176 
178 #define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
179  DW_LANG_##NAME = ID,
180 #include "llvm/BinaryFormat/Dwarf.def"
181  DW_LANG_lo_user = 0x8000,
183 };
184 
185 inline bool isCPlusPlus(SourceLanguage S) {
186  // Deliberately enumerate all the language options so we get a warning when
187  // new language options are added (-Wswitch) that'll hopefully help keep this
188  // switch up-to-date when new C++ versions are added.
189  switch (S) {
190  case DW_LANG_C_plus_plus:
191  case DW_LANG_C_plus_plus_03:
192  case DW_LANG_C_plus_plus_11:
193  case DW_LANG_C_plus_plus_14:
194  return true;
195  case DW_LANG_C89:
196  case DW_LANG_C:
197  case DW_LANG_Ada83:
198  case DW_LANG_Cobol74:
199  case DW_LANG_Cobol85:
200  case DW_LANG_Fortran77:
201  case DW_LANG_Fortran90:
202  case DW_LANG_Pascal83:
203  case DW_LANG_Modula2:
204  case DW_LANG_Java:
205  case DW_LANG_C99:
206  case DW_LANG_Ada95:
207  case DW_LANG_Fortran95:
208  case DW_LANG_PLI:
209  case DW_LANG_ObjC:
210  case DW_LANG_ObjC_plus_plus:
211  case DW_LANG_UPC:
212  case DW_LANG_D:
213  case DW_LANG_Python:
214  case DW_LANG_OpenCL:
215  case DW_LANG_Go:
216  case DW_LANG_Modula3:
217  case DW_LANG_Haskell:
218  case DW_LANG_OCaml:
219  case DW_LANG_Rust:
220  case DW_LANG_C11:
221  case DW_LANG_Swift:
222  case DW_LANG_Julia:
223  case DW_LANG_Dylan:
224  case DW_LANG_Fortran03:
225  case DW_LANG_Fortran08:
226  case DW_LANG_RenderScript:
227  case DW_LANG_BLISS:
228  case DW_LANG_Mips_Assembler:
229  case DW_LANG_GOOGLE_RenderScript:
230  case DW_LANG_BORLAND_Delphi:
231  case DW_LANG_lo_user:
232  case DW_LANG_hi_user:
233  return false;
234  }
235  llvm_unreachable("Invalid source language");
236 }
237 
239  // Identifier case codes
244 };
245 
247 // Calling convention codes
248 #define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID,
249 #include "llvm/BinaryFormat/Dwarf.def"
252 };
253 
255  // Inline codes
260 };
261 
263  // Array ordering
266 };
267 
269  // Discriminant descriptor values
270  DW_DSC_label = 0x00,
272 };
273 
274 /// Line Number Standard Opcode Encodings.
275 enum LineNumberOps : uint8_t {
276 #define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID,
277 #include "llvm/BinaryFormat/Dwarf.def"
278 };
279 
280 /// Line Number Extended Opcode Encodings.
282 #define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID,
283 #include "llvm/BinaryFormat/Dwarf.def"
286 };
287 
289 #define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID,
290 #include "llvm/BinaryFormat/Dwarf.def"
291  DW_LNCT_lo_user = 0x2000,
292  DW_LNCT_hi_user = 0x3fff,
293 };
294 
296  // Macinfo Type Encodings
302 };
303 
304 /// DWARF v5 macro information entry type encodings.
306 #define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID,
307 #include "llvm/BinaryFormat/Dwarf.def"
310 };
311 
312 /// DWARF v5 range list entry encoding values.
314 #define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
315 #include "llvm/BinaryFormat/Dwarf.def"
316 };
317 
318 /// DWARF v5 loc list entry encoding values.
320 #define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID,
321 #include "llvm/BinaryFormat/Dwarf.def"
322 };
323 
324 /// Call frame instruction encodings.
326 #define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
327 #define HANDLE_DW_CFA_PRED(ID, NAME, ARCH) DW_CFA_##NAME = ID,
328 #include "llvm/BinaryFormat/Dwarf.def"
330 
333 };
334 
335 enum Constants {
336  // Children flag
339 
357 };
358 
359 /// Constants for the DW_APPLE_PROPERTY_attributes attribute.
360 /// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
362 #define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID,
363 #include "llvm/BinaryFormat/Dwarf.def"
364 };
365 
366 /// Constants for unit types in DWARF v5.
367 enum UnitType : unsigned char {
368 #define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID,
369 #include "llvm/BinaryFormat/Dwarf.def"
372 };
373 
374 enum Index {
375 #define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID,
376 #include "llvm/BinaryFormat/Dwarf.def"
377  DW_IDX_lo_user = 0x2000,
378  DW_IDX_hi_user = 0x3fff
379 };
380 
381 inline bool isUnitType(uint8_t UnitType) {
382  switch (UnitType) {
383  case DW_UT_compile:
384  case DW_UT_type:
385  case DW_UT_partial:
386  case DW_UT_skeleton:
387  case DW_UT_split_compile:
388  case DW_UT_split_type:
389  return true;
390  default:
391  return false;
392  }
393 }
394 
395 inline bool isUnitType(dwarf::Tag T) {
396  switch (T) {
397  case DW_TAG_compile_unit:
398  case DW_TAG_type_unit:
399  case DW_TAG_partial_unit:
400  case DW_TAG_skeleton_unit:
401  return true;
402  default:
403  return false;
404  }
405 }
406 
407 // Constants for the DWARF v5 Accelerator Table Proposal
409  // Data layout descriptors.
410  DW_ATOM_null = 0u, /// Marker as the end of a list of atoms.
411  DW_ATOM_die_offset = 1u, // DIE offset in the debug_info section.
412  DW_ATOM_cu_offset = 2u, // Offset of the compile unit header that contains the
413  // item in question.
414  DW_ATOM_die_tag = 3u, // A tag entry.
415  DW_ATOM_type_flags = 4u, // Set of flags for a type.
416 
417  DW_ATOM_type_type_flags = 5u, // Dsymutil type extension.
418  DW_ATOM_qual_name_hash = 6u, // Dsymutil qualified hash extension.
419 
420  // DW_ATOM_type_flags values.
421 
422  // Always set for C++, only set for ObjC if this is the @implementation for a
423  // class.
425 
426  // Hash functions.
427 
428  // Daniel J. Bernstein hash.
430 };
431 
432 // Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
442 };
443 
445 
446 /// \defgroup DwarfConstantsDumping Dwarf constants dumping functions
447 ///
448 /// All these functions map their argument's value back to the
449 /// corresponding enumerator name or return an empty StringRef if the value
450 /// isn't known.
451 ///
452 /// @{
453 StringRef TagString(unsigned Tag);
454 StringRef ChildrenString(unsigned Children);
456 StringRef FormEncodingString(unsigned Encoding);
457 StringRef OperationEncodingString(unsigned Encoding);
458 StringRef AttributeEncodingString(unsigned Encoding);
459 StringRef DecimalSignString(unsigned Sign);
460 StringRef EndianityString(unsigned Endian);
461 StringRef AccessibilityString(unsigned Access);
462 StringRef DefaultedMemberString(unsigned DefaultedEncodings);
463 StringRef VisibilityString(unsigned Visibility);
464 StringRef VirtualityString(unsigned Virtuality);
466 StringRef CaseString(unsigned Case);
467 StringRef ConventionString(unsigned Convention);
468 StringRef InlineCodeString(unsigned Code);
469 StringRef ArrayOrderString(unsigned Order);
470 StringRef LNStandardString(unsigned Standard);
471 StringRef LNExtendedString(unsigned Encoding);
472 StringRef MacinfoString(unsigned Encoding);
473 StringRef RangeListEncodingString(unsigned Encoding);
474 StringRef LocListEncodingString(unsigned Encoding);
475 StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
477 StringRef UnitTypeString(unsigned);
478 StringRef AtomTypeString(unsigned Atom);
481 StringRef IndexString(unsigned Idx);
482 /// @}
483 
484 /// \defgroup DwarfConstantsParsing Dwarf constants parsing functions
485 ///
486 /// These functions map their strings back to the corresponding enumeration
487 /// value or return 0 if there is none, except for these exceptions:
488 ///
489 /// \li \a getTag() returns \a DW_TAG_invalid on invalid input.
490 /// \li \a getVirtuality() returns \a DW_VIRTUALITY_invalid on invalid input.
491 /// \li \a getMacinfo() returns \a DW_MACINFO_invalid on invalid input.
492 ///
493 /// @{
494 unsigned getTag(StringRef TagString);
495 unsigned getOperationEncoding(StringRef OperationEncodingString);
496 unsigned getVirtuality(StringRef VirtualityString);
497 unsigned getLanguage(StringRef LanguageString);
498 unsigned getCallingConvention(StringRef LanguageString);
499 unsigned getAttributeEncoding(StringRef EncodingString);
500 unsigned getMacinfo(StringRef MacinfoString);
501 /// @}
502 
503 /// \defgroup DwarfConstantsVersioning Dwarf version for constants
504 ///
505 /// For constants defined by DWARF, returns the DWARF version when the constant
506 /// was first defined. For vendor extensions, if there is a version-related
507 /// policy for when to emit it, returns a version number for that policy.
508 /// Otherwise returns 0.
509 ///
510 /// @{
511 unsigned TagVersion(Tag T);
512 unsigned AttributeVersion(Attribute A);
513 unsigned FormVersion(Form F);
516 unsigned LanguageVersion(SourceLanguage L);
517 /// @}
518 
519 /// \defgroup DwarfConstantsVendor Dwarf "vendor" for constants
520 ///
521 /// These functions return an identifier describing "who" defined the constant,
522 /// either the DWARF standard itself or the vendor who defined the extension.
523 ///
524 /// @{
525 unsigned TagVendor(Tag T);
526 unsigned AttributeVendor(Attribute A);
527 unsigned FormVendor(Form F);
528 unsigned OperationVendor(LocationAtom O);
530 unsigned LanguageVendor(SourceLanguage L);
531 /// @}
532 
534 
535 /// A helper struct providing information about the byte size of DW_FORM
536 /// values that vary in size depending on the DWARF version, address byte
537 /// size, or DWARF32/DWARF64.
538 struct FormParams {
540  uint8_t AddrSize;
542 
543  /// The definition of the size of form DW_FORM_ref_addr depends on the
544  /// version. In DWARF v2 it's the size of an address; after that, it's the
545  /// size of a reference.
546  uint8_t getRefAddrByteSize() const {
547  if (Version == 2)
548  return AddrSize;
549  return getDwarfOffsetByteSize();
550  }
551 
552  /// The size of a reference is determined by the DWARF 32/64-bit format.
553  uint8_t getDwarfOffsetByteSize() const {
554  switch (Format) {
556  return 4;
558  return 8;
559  }
560  llvm_unreachable("Invalid Format value");
561  }
562 
563  explicit operator bool() const { return Version && AddrSize; }
564 };
565 
566 /// Get the byte size of the unit length field depending on the DWARF format.
568  switch (Format) {
570  return 4;
572  return 12;
573  }
574  llvm_unreachable("Invalid Format value");
575 }
576 
577 /// Get the fixed byte size for a given form.
578 ///
579 /// If the form has a fixed byte size, then an Optional with a value will be
580 /// returned. If the form is always encoded using a variable length storage
581 /// format (ULEB or SLEB numbers or blocks) then None will be returned.
582 ///
583 /// \param Form DWARF form to get the fixed byte size for.
584 /// \param Params DWARF parameters to help interpret forms.
585 /// \returns Optional<uint8_t> value with the fixed byte size or None if
586 /// \p Form doesn't have a fixed byte size.
588 
589 /// Tells whether the specified form is defined in the specified version,
590 /// or is an extension if extensions are allowed.
591 bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk = true);
592 
593 /// Returns the symbolic string representing Val when used as a value
594 /// for attribute Attr.
595 StringRef AttributeValueString(uint16_t Attr, unsigned Val);
596 
597 /// Returns the symbolic string representing Val when used as a value
598 /// for atom Atom.
599 StringRef AtomValueString(uint16_t Atom, unsigned Val);
600 
601 /// Describes an entry of the various gnu_pub* debug sections.
602 ///
603 /// The gnu_pub* kind looks like:
604 ///
605 /// 0-3 reserved
606 /// 4-6 symbol kind
607 /// 7 0 == global, 1 == static
608 ///
609 /// A gdb_index descriptor includes the above kind, shifted 24 bits up with the
610 /// offset of the cu within the debug_info section stored in those 24 bits.
615  : Kind(Kind), Linkage(Linkage) {}
617  : Kind(Kind), Linkage(GIEL_EXTERNAL) {}
618  explicit PubIndexEntryDescriptor(uint8_t Value)
619  : Kind(
620  static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >> KIND_OFFSET)),
621  Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>
622  LINKAGE_OFFSET)) {}
623  uint8_t toBits() const {
624  return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET;
625  }
626 
627 private:
628  enum {
629  KIND_OFFSET = 4,
630  KIND_MASK = 7 << KIND_OFFSET,
631  LINKAGE_OFFSET = 7,
632  LINKAGE_MASK = 1 << LINKAGE_OFFSET
633  };
634 };
635 
636 template <typename Enum> struct EnumTraits : public std::false_type {};
637 
638 template <> struct EnumTraits<Attribute> : public std::true_type {
639  static constexpr char Type[3] = "AT";
640  static constexpr StringRef (*StringFn)(unsigned) = &AttributeString;
641 };
642 
643 template <> struct EnumTraits<Form> : public std::true_type {
644  static constexpr char Type[5] = "FORM";
645  static constexpr StringRef (*StringFn)(unsigned) = &FormEncodingString;
646 };
647 
648 template <> struct EnumTraits<Index> : public std::true_type {
649  static constexpr char Type[4] = "IDX";
650  static constexpr StringRef (*StringFn)(unsigned) = &IndexString;
651 };
652 
653 template <> struct EnumTraits<Tag> : public std::true_type {
654  static constexpr char Type[4] = "TAG";
655  static constexpr StringRef (*StringFn)(unsigned) = &TagString;
656 };
657 } // End of namespace dwarf
658 
659 /// Dwarf constants format_provider
660 ///
661 /// Specialization of the format_provider template for dwarf enums. Unlike the
662 /// dumping functions above, these format unknown enumerator values as
663 /// DW_TYPE_unknown_1234 (e.g. DW_TAG_unknown_ffff).
664 template <typename Enum>
666  Enum, typename std::enable_if<dwarf::EnumTraits<Enum>::value>::type> {
667  static void format(const Enum &E, raw_ostream &OS, StringRef Style) {
669  if (Str.empty()) {
670  OS << "DW_" << dwarf::EnumTraits<Enum>::Type << "_unknown_"
671  << llvm::format("%x", E);
672  } else
673  OS << Str;
674  }
675 };
676 } // End of namespace llvm
677 
678 #endif
DecimalSignEncoding
Definition: Dwarf.h:134
MacinfoRecordType
Definition: Dwarf.h:295
LocationAtom
Definition: Dwarf.h:116
unsigned FormVersion(Form F)
Definition: Dwarf.cpp:116
StringRef ApplePropertyString(unsigned)
Definition: Dwarf.cpp:531
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition: Dwarf.h:538
PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
Definition: Dwarf.h:616
StringRef IndexString(unsigned Idx)
Definition: Dwarf.cpp:649
LineNumberOps
Line Number Standard Opcode Encodings.
Definition: Dwarf.h:275
Not specified by DWARF.
Definition: Dwarf.h:113
This class represents lattice values for constants.
Definition: AllocatorList.h:23
StringRef AtomTypeString(unsigned Atom)
Definition: Dwarf.cpp:553
unsigned FormVendor(Form F)
Definition: Dwarf.cpp:127
LoclistEntries
DWARF v5 loc list entry encoding values.
Definition: Dwarf.h:319
bool isUnitType(uint8_t UnitType)
Definition: Dwarf.h:381
Attribute
Attributes.
Definition: Dwarf.h:103
StringRef LNExtendedString(unsigned Encoding)
Definition: Dwarf.cpp:440
StringRef LNStandardString(unsigned Standard)
Definition: Dwarf.cpp:429
unsigned TagVendor(Tag T)
Definition: Dwarf.cpp:51
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
Definition: Dwarf.h:546
Only used in LLVM metadata.
Definition: Dwarf.h:122
GDBIndexEntryKind
Definition: Dwarf.h:433
F(f)
ArrayDimensionOrdering
Definition: Dwarf.h:262
Optional< unsigned > LanguageLowerBound(SourceLanguage L)
Definition: Dwarf.cpp:362
unsigned getVirtuality(StringRef VirtualityString)
Definition: Dwarf.cpp:313
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
Definition: Dwarf.cpp:502
InlineAttribute
Definition: Dwarf.h:254
CallFrameInfo
Call frame instruction encodings.
Definition: Dwarf.h:325
Definition: BitVector.h:937
EndianityEncoding
Definition: Dwarf.h:143
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition: Dwarf.h:71
LLVMConstants
Definition: Dwarf.h:43
unsigned TagVersion(Tag T)
Definition: Dwarf.cpp:40
unsigned AttributeVendor(Attribute A)
Definition: Dwarf.cpp:94
StringRef FormEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:105
Only used in LLVM metadata.
Definition: Dwarf.h:121
PubIndexEntryDescriptor(uint8_t Value)
Definition: Dwarf.h:618
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:147
unsigned LanguageVendor(SourceLanguage L)
Definition: Dwarf.cpp:351
Describes an entry of the various gnu_pub* debug sections.
Definition: Dwarf.h:611
#define UINT64_MAX
Definition: DataTypes.h:83
MacroEntryType
DWARF v5 macro information entry type encodings.
Definition: Dwarf.h:305
StringRef AttributeString(unsigned Attribute)
Definition: Dwarf.cpp:72
StringRef LanguageString(unsigned Language)
Definition: Dwarf.cpp:321
AccessAttribute
Definition: Dwarf.h:151
StringRef DecimalSignString(unsigned Sign)
Definition: Dwarf.cpp:232
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
Definition: Dwarf.h:567
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
Definition: Dwarf.cpp:605
unsigned LanguageVersion(SourceLanguage L)
Definition: Dwarf.cpp:340
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
Definition: Dwarf.cpp:572
StringRef AccessibilityString(unsigned Access)
Definition: Dwarf.cpp:264
const uint32_t DW_INVALID_OFFSET
Identifier of an invalid DIE offset in the .debug_info section.
Definition: Dwarf.h:81
StringRef EndianityString(unsigned Endian)
Definition: Dwarf.cpp:248
StringRef AttributeEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:191
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
unsigned OperationVendor(LocationAtom O)
Definition: Dwarf.cpp:180
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
unsigned getCallingConvention(StringRef LanguageString)
Definition: Dwarf.cpp:398
Only used in LLVM metadata.
Definition: Dwarf.h:123
SourceLanguage
Definition: Dwarf.h:177
unsigned getOperationEncoding(StringRef OperationEncodingString)
Definition: Dwarf.cpp:157
StringRef ArrayOrderString(unsigned Order)
Definition: Dwarf.cpp:419
Recommended base for user tags.
Definition: Dwarf.h:88
unsigned OperationVersion(LocationAtom O)
Definition: Dwarf.cpp:169
RnglistEntries
DWARF v5 range list entry encoding values.
Definition: Dwarf.h:313
Only used in LLVM metadata.
Definition: Dwarf.h:124
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
Definition: Dwarf.cpp:595
GDBIndexEntryLinkage Linkage
Definition: Dwarf.h:613
unsigned getLanguage(StringRef LanguageString)
Definition: Dwarf.cpp:332
StringRef RangeListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:480
VisibilityAttribute
Definition: Dwarf.h:158
LineNumberExtendedOps
Line Number Extended Opcode Encodings.
Definition: Dwarf.h:281
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef VirtualityString(unsigned Virtuality)
Definition: Dwarf.cpp:302
StringRef OperationEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:138
const uint32_t DW_CIE_ID
Special ID values that distinguish a CIE from a FDE in DWARF CFI.
Definition: Dwarf.h:76
unsigned getTag(StringRef TagString)
Definition: Dwarf.cpp:32
UnitType
Constants for unit types in DWARF v5.
Definition: Dwarf.h:367
StringRef CaseString(unsigned Case)
Definition: Dwarf.cpp:373
ApplePropertyAttributes
Constants for the DW_APPLE_PROPERTY_attributes attribute.
Definition: Dwarf.h:361
unsigned AttributeVersion(Attribute A)
Definition: Dwarf.cpp:83
static void format(const Enum &E, raw_ostream &OS, StringRef Style)
Definition: Dwarf.h:667
AcceleratorTable
Definition: Dwarf.h:408
bool isType(Tag T)
Definition: Dwarf.h:91
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
Definition: Dwarf.h:614
unsigned AttributeEncodingVersion(TypeKind E)
Definition: Dwarf.cpp:210
StringRef VisibilityString(unsigned Visibility)
Definition: Dwarf.cpp:290
StringRef UnitTypeString(unsigned)
Definition: Dwarf.cpp:542
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
Definition: Dwarf.cpp:638
Optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
Definition: Dwarf.cpp:660
StringRef TagString(unsigned Tag)
Definition: Dwarf.cpp:21
unsigned AttributeEncodingVendor(TypeKind E)
Definition: Dwarf.cpp:221
StringRef InlineCodeString(unsigned Code)
Definition: Dwarf.cpp:405
StringRef ConventionString(unsigned Convention)
Definition: Dwarf.cpp:387
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
Definition: Dwarf.cpp:277
unsigned getMacinfo(StringRef MacinfoString)
Definition: Dwarf.cpp:470
StringRef ChildrenString(unsigned Children)
Definition: Dwarf.cpp:62
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:747
CallingConvention
Definition: Dwarf.h:246
StringRef LocListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:491
DwarfFormat Format
Definition: Dwarf.h:541
VirtualityAttribute
Definition: Dwarf.h:165
LLVM Value Representation.
Definition: Value.h:74
unsigned getAttributeEncoding(StringRef EncodingString)
Definition: Dwarf.cpp:202
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
GDBIndexEntryLinkage
Definition: Dwarf.h:444
DiscriminantList
Definition: Dwarf.h:268
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54
StringRef MacinfoString(unsigned Encoding)
Definition: Dwarf.cpp:451
Marker as the end of a list of atoms.
Definition: Dwarf.h:411
LineNumberEntryFormat
Definition: Dwarf.h:288
CaseSensitivity
Definition: Dwarf.h:238
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
Definition: Dwarf.h:553
bool isCPlusPlus(SourceLanguage S)
Definition: Dwarf.h:185
DefaultedMemberAttribute
Definition: Dwarf.h:171
const uint64_t DW64_CIE_ID
Definition: Dwarf.h:77