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