1//===-- llvm/BinaryFormat/Dwarf.h ---Dwarf Constants-------------*- C++ -*-===// 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 7//===----------------------------------------------------------------------===// 10/// This file contains constants used for implementing Dwarf 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. 17//===----------------------------------------------------------------------===// 19#ifndef LLVM_BINARYFORMAT_DWARF_H 20#define LLVM_BINARYFORMAT_DWARF_H 36//===----------------------------------------------------------------------===// 37// DWARF constants as gleaned from the DWARF Debugging Information Format V.5 38// reference manual http://www.dwarfstd.org/. 41// Do not mix the following two enumerations sets. DW_TAG_invalid changes the 42// enumeration base type. 45 /// LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def). 52 /// Special values for an initial length field. 67 /// Identifiers we use to distinguish vendor extensions. 90/// Constants that define the DWARF format as 32 or 64 bit. 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. 100/// Identifier of an invalid DIE offset in the .debug_info section. 104#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR, KIND) DW_TAG_##NAME = ID, 105#include "llvm/BinaryFormat/Dwarf.def" 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" 124#define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID, 125#include "llvm/BinaryFormat/Dwarf.def" 131#define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID, 132#include "llvm/BinaryFormat/Dwarf.def" 137#define HANDLE_DW_OP(ID, NAME, OPERANDS, ARITY, VERSION, VENDOR) \ 139#include "llvm/BinaryFormat/Dwarf.def" 153#define HANDLE_DW_OP_LLVM_USEROP(ID, NAME) DW_OP_LLVM_##NAME = ID, 154#include "llvm/BinaryFormat/Dwarf.def" 158#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID, 159#include "llvm/BinaryFormat/Dwarf.def" 165// Decimal sign attribute values 174// Endianity attribute values 175#define HANDLE_DW_END(ID, NAME) DW_END_##NAME = ID, 176#include "llvm/BinaryFormat/Dwarf.def" 182// Accessibility codes 196#define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID, 197#include "llvm/BinaryFormat/Dwarf.def" 202#define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID, 203#include "llvm/BinaryFormat/Dwarf.def" 208#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \ 210#include "llvm/BinaryFormat/Dwarf.def" 216#define HANDLE_DW_LNAME(ID, NAME, DESC, LOWER_BOUND) DW_LNAME_##NAME = ID, 217#include "llvm/BinaryFormat/Dwarf.def" 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. 226case DW_LNAME_Ada:
// YYYY 232return DW_LANG_Ada2005;
234return DW_LANG_Ada2012;
238case DW_LNAME_C:
// YYYYMM, K&R 000000 241if (version <= 198912)
243if (version <= 199901)
245if (version <= 201112)
247if (version <= 201710)
250case DW_LNAME_C_plus_plus:
// YYYYMM 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;
266case DW_LNAME_Cobol:
// YYYY 268return DW_LANG_Cobol74;
270return DW_LANG_Cobol85;
272case DW_LNAME_Crystal:
273return DW_LANG_Crystal;
278case DW_LNAME_Fortran:
// YYYY 280return DW_LANG_Fortran77;
282return DW_LANG_Fortran90;
284return DW_LANG_Fortran95;
286return DW_LANG_Fortran03;
288return DW_LANG_Fortran08;
290return DW_LANG_Fortran18;
294case DW_LNAME_Haskell:
295return DW_LANG_Haskell;
297// return DW_LANG_HIP; 303return DW_LANG_Kotlin;
304case DW_LNAME_Modula2:
305return DW_LANG_Modula2;
306case DW_LNAME_Modula3:
307return DW_LANG_Modula3;
310case DW_LNAME_ObjC_plus_plus:
311return DW_LANG_ObjC_plus_plus;
314case DW_LNAME_OpenCL_C:
315return DW_LANG_OpenCL;
317return DW_LANG_Pascal83;
321return DW_LANG_Python;
322case DW_LNAME_RenderScript:
323return DW_LANG_RenderScript;
332case DW_LNAME_Assembly:
333return DW_LANG_Assembly;
334case DW_LNAME_C_sharp:
335return DW_LANG_C_sharp;
340case DW_LNAME_GLSL_ES:
341return DW_LANG_GLSL_ES;
344case DW_LNAME_OpenCL_CPP:
345return DW_LANG_OpenCL_CPP;
346case DW_LNAME_CPP_for_OpenCL:
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>>
367return {{DW_LNAME_Ada, 1983}};
369return {{DW_LNAME_Ada, 1995}};
371return {{DW_LNAME_Ada, 2005}};
373return {{DW_LNAME_Ada, 2012}};
375return {{DW_LNAME_BLISS, 0}};
377return {{DW_LNAME_C, 0}};
379return {{DW_LNAME_C, 198912}};
381return {{DW_LNAME_C, 199901}};
383return {{DW_LNAME_C, 201112}};
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}};
399return {{DW_LNAME_Cobol, 1974}};
401return {{DW_LNAME_Cobol, 1985}};
403return {{DW_LNAME_Crystal, 0}};
405return {{DW_LNAME_D, 0}};
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}};
421return {{DW_LNAME_Go, 0}};
423return {{DW_LNAME_Haskell, 0}};
425return {};
// return {{DW_LNAME_HIP, 0}}; 427return {{DW_LNAME_Java, 0}};
429return {{DW_LNAME_Julia, 0}};
431return {{DW_LNAME_Kotlin, 0}};
433return {{DW_LNAME_Modula2, 0}};
435return {{DW_LNAME_Modula3, 0}};
437return {{DW_LNAME_ObjC, 0}};
438case DW_LANG_ObjC_plus_plus:
439return {{DW_LNAME_ObjC_plus_plus, 0}};
441return {{DW_LNAME_OCaml, 0}};
443return {{DW_LNAME_OpenCL_C, 0}};
444case DW_LANG_Pascal83:
445return {{DW_LNAME_Pascal, 1983}};
447return {{DW_LNAME_PLI, 0}};
449return {{DW_LNAME_Python, 0}};
450case DW_LANG_RenderScript:
451case DW_LANG_GOOGLE_RenderScript:
452return {{DW_LNAME_RenderScript, 0}};
454return {{DW_LNAME_Rust, 0}};
456return {{DW_LNAME_Swift, 0}};
458return {{DW_LNAME_UPC, 0}};
460return {{DW_LNAME_Zig, 0}};
461case DW_LANG_Assembly:
462case DW_LANG_Mips_Assembler:
463return {{DW_LNAME_Assembly, 0}};
465return {{DW_LNAME_C_sharp, 0}};
467return {{DW_LNAME_Mojo, 0}};
469return {{DW_LNAME_GLSL, 0}};
471return {{DW_LNAME_GLSL_ES, 0}};
473return {{DW_LNAME_HLSL, 0}};
474case DW_LANG_OpenCL_CPP:
475return {{DW_LNAME_OpenCL_CPP, 0}};
477return {{DW_LNAME_SYCL, 0}};
479return {{DW_LNAME_Ruby, 0}};
481return {{DW_LNAME_Move, 0}};
483return {{DW_LNAME_Hylo, 0}};
485return {{DW_LNAME_Metal, 0}};
486case DW_LANG_BORLAND_Delphi:
487case DW_LANG_CPP_for_OpenCL:
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. 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:
516case DW_LANG_Fortran77:
517case DW_LANG_Fortran90:
518case DW_LANG_Pascal83:
523case DW_LANG_Fortran95:
526case DW_LANG_ObjC_plus_plus:
540case DW_LANG_Fortran03:
541case DW_LANG_Fortran08:
542case DW_LANG_RenderScript:
544case DW_LANG_Mips_Assembler:
545case DW_LANG_GOOGLE_RenderScript:
546case DW_LANG_BORLAND_Delphi:
553case DW_LANG_Fortran18:
557case DW_LANG_Assembly:
563case DW_LANG_OpenCL_CPP:
564case DW_LANG_CPP_for_OpenCL:
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. 583case DW_LANG_Fortran77:
584case DW_LANG_Fortran90:
585case DW_LANG_Fortran95:
586case DW_LANG_Fortran03:
587case DW_LANG_Fortran08:
588case DW_LANG_Fortran18:
594case DW_LANG_C_plus_plus:
597case DW_LANG_Pascal83:
604case DW_LANG_ObjC_plus_plus:
612case DW_LANG_C_plus_plus_03:
613case DW_LANG_C_plus_plus_11:
620case DW_LANG_C_plus_plus_14:
621case DW_LANG_RenderScript:
623case DW_LANG_Mips_Assembler:
624case DW_LANG_GOOGLE_RenderScript:
625case DW_LANG_BORLAND_Delphi:
631case DW_LANG_C_plus_plus_17:
632case DW_LANG_C_plus_plus_20:
637case DW_LANG_Assembly:
643case DW_LANG_OpenCL_CPP:
644case DW_LANG_CPP_for_OpenCL:
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. 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:
678case DW_LANG_Fortran77:
679case DW_LANG_Fortran90:
680case DW_LANG_Pascal83:
684case DW_LANG_Fortran95:
686case DW_LANG_ObjC_plus_plus:
699case DW_LANG_Fortran03:
700case DW_LANG_Fortran08:
701case DW_LANG_RenderScript:
703case DW_LANG_Mips_Assembler:
704case DW_LANG_GOOGLE_RenderScript:
705case DW_LANG_BORLAND_Delphi:
711case DW_LANG_Fortran18:
715case DW_LANG_Assembly:
721case DW_LANG_OpenCL_CPP:
722case DW_LANG_CPP_for_OpenCL:
734returnisFortran(S) ? DW_ATE_signed : DW_ATE_unsigned;
738// Identifier case codes 746// Calling convention codes 747#define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID, 748#include "llvm/BinaryFormat/Dwarf.def" 768// Discriminant descriptor values 773/// Line Number Standard Opcode Encodings. 775#define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID, 776#include "llvm/BinaryFormat/Dwarf.def" 779/// Line Number Extended Opcode Encodings. 781#define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID, 782#include "llvm/BinaryFormat/Dwarf.def" 788#define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID, 789#include "llvm/BinaryFormat/Dwarf.def" 795// Macinfo Type Encodings 803/// DWARF v5 macro information entry type encodings. 805#define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID, 806#include "llvm/BinaryFormat/Dwarf.def" 811/// GNU .debug_macro macro information entry type encodings. 813#define HANDLE_DW_MACRO_GNU(ID, NAME) DW_MACRO_GNU_##NAME = ID, 814#include "llvm/BinaryFormat/Dwarf.def" 819/// DWARF v5 range list entry encoding values. 821#define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID, 822#include "llvm/BinaryFormat/Dwarf.def" 825/// DWARF v5 loc list entry encoding values. 827#define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID, 828#include "llvm/BinaryFormat/Dwarf.def" 831/// Call frame instruction encodings. 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" 866/// Constants for the DW_APPLE_PROPERTY_attributes attribute. 867/// Keep this list in sync with clang's DeclObjCCommon.h 868/// ObjCPropertyAttribute::Kind! 870#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID, 871#include "llvm/BinaryFormat/Dwarf.def" 874/// Constants for unit types in DWARF v5. 876#define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID, 877#include "llvm/BinaryFormat/Dwarf.def" 883#define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID, 884#include "llvm/BinaryFormat/Dwarf.def" 895case DW_UT_split_compile:
896case DW_UT_split_type:
905case DW_TAG_compile_unit:
906case DW_TAG_type_unit:
907case DW_TAG_partial_unit:
908case DW_TAG_skeleton_unit:
915// Constants for the DWARF v5 Accelerator Table Proposal 917// Data layout descriptors. 928// DW_ATOM_type_flags values. 930// Always set for C++, only set for ObjC if this is the @implementation for a 936// Daniel J. Bernstein hash. 940// Return a suggested bucket count for the DWARF v5 Accelerator Table. 942if (UniqueHashCount > 1024)
943return UniqueHashCount / 4;
944if (UniqueHashCount > 16)
945return UniqueHashCount / 2;
946return std::max<uint32_t>(UniqueHashCount, 1);
949// Constants for the GNU pubnames/pubtypes extensions supporting gdb index. 963/// \defgroup DwarfConstantsDumping Dwarf constants dumping functions 965/// All these functions map their argument's value back to the 966/// corresponding enumerator name or return an empty StringRef if the value 976unsigned SubOpEncoding);
1008/// \defgroup DwarfConstantsParsing Dwarf constants parsing functions 1010/// These functions map their strings back to the corresponding enumeration 1011/// value or return 0 if there is none, except for these exceptions: 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. 1030/// \defgroup DwarfConstantsVersioning Dwarf version for constants 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. 1046/// \defgroup DwarfConstantsVendor Dwarf "vendor" for constants 1048/// These functions return an identifier describing "who" defined the constant, 1049/// either the DWARF standard itself or the vendor who defined the extension. 1060/// The number of operands for the given LocationAtom. 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. 1070/// The size of a reference determined by the DWARF 32/64-bit format. 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. 1088 /// True if DWARF v2 output generally uses relocations for references 1089 /// to other .debug_* sections. 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. 1101 /// The size of a reference is determined by the DWARF 32/64-bit format. 1109/// Get the byte size of the unit length field depending on the DWARF format. 1120/// Get the fixed byte size for a given form. 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. 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. 1133/// Tells whether the specified form is defined in the specified version, 1134/// or is an extension if extensions are allowed. 1137/// Returns the symbolic string representing Val when used as a value 1138/// for attribute Attr. 1141/// Returns the symbolic string representing Val when used as a value 1145/// Describes an entry of the various gnu_pub* debug sections. 1147/// The gnu_pub* kind looks like: 1151/// 7 0 == global, 1 == static 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. 1168returnKind << KIND_OFFSET |
Linkage << LINKAGE_OFFSET;
1174 KIND_MASK = 7 << KIND_OFFSET,
1176 LINKAGE_MASK = 1 << LINKAGE_OFFSET
1180template <
typename Enum>
structEnumTraits :
public std::false_type {};
1213return std::numeric_limits<uint64_t>::max() >> (8 - AddressByteSize) * 8;
1216}
// End of namespace dwarf 1218/// Dwarf constants format_provider 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>
1234}
// End of namespace llvm static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
StringRef LNExtendedString(unsigned Encoding)
StringRef RangeListEncodingString(unsigned Encoding)
StringRef CaseString(unsigned Case)
StringRef VisibilityString(unsigned Visibility)
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
StringRef AttributeString(unsigned Attribute)
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
StringRef FormEncodingString(unsigned Encoding)
StringRef ArrayOrderString(unsigned Order)
StringRef MacroString(unsigned Encoding)
StringRef LocListEncodingString(unsigned Encoding)
StringRef IndexString(unsigned Idx)
StringRef RLEString(unsigned RLE)
StringRef SubOperationEncodingString(unsigned OpEncoding, unsigned SubOpEncoding)
StringRef LanguageString(unsigned Language)
StringRef DecimalSignString(unsigned Sign)
StringRef VirtualityString(unsigned Virtuality)
StringRef AttributeEncodingString(unsigned Encoding)
StringRef ChildrenString(unsigned Children)
StringRef ApplePropertyString(unsigned)
StringRef AtomTypeString(unsigned Atom)
StringRef FormatString(DwarfFormat Format)
StringRef GnuMacroString(unsigned Encoding)
StringRef EndianityString(unsigned Endian)
StringRef ConventionString(unsigned Convention)
StringRef MacinfoString(unsigned Encoding)
StringRef OperationEncodingString(unsigned Encoding)
StringRef UnitTypeString(unsigned)
StringRef InlineCodeString(unsigned Code)
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
StringRef TagString(unsigned Tag)
StringRef LNStandardString(unsigned Standard)
StringRef AccessibilityString(unsigned Access)
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
unsigned getSubOperationEncoding(unsigned OpEncoding, StringRef SubOperationEncodingString)
unsigned getOperationEncoding(StringRef OperationEncodingString)
unsigned getAttributeEncoding(StringRef EncodingString)
unsigned getTag(StringRef TagString)
unsigned getCallingConvention(StringRef LanguageString)
unsigned getLanguage(StringRef LanguageString)
unsigned getVirtuality(StringRef VirtualityString)
unsigned getMacro(StringRef MacroString)
unsigned getMacinfo(StringRef MacinfoString)
unsigned AttributeEncodingVendor(TypeKind E)
unsigned FormVendor(Form F)
unsigned AttributeVendor(Attribute A)
unsigned OperationVendor(LocationAtom O)
unsigned TagVendor(Tag T)
unsigned LanguageVendor(SourceLanguage L)
unsigned OperationVersion(LocationAtom O)
unsigned AttributeVersion(Attribute A)
unsigned LanguageVersion(SourceLanguage L)
unsigned AttributeEncodingVersion(TypeKind E)
unsigned TagVersion(Tag T)
unsigned FormVersion(Form F)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ DW_INL_declared_not_inlined
@ DW_INL_declared_inlined
const uint32_t DW_CIE_ID
Special ID values that distinguish a CIE from a FDE in DWARF CFI.
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
MacroEntryType
DWARF v5 macro information entry type encodings.
std::optional< unsigned > LanguageLowerBound(SourceLanguage L)
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
const uint64_t DW64_CIE_ID
std::optional< unsigned > OperationArity(LocationAtom O)
The arity of the given LocationAtom.
LineNumberOps
Line Number Standard Opcode Encodings.
ApplePropertyAttributes
Constants for the DW_APPLE_PROPERTY_attributes attribute.
LoclistEntries
DWARF v5 loc list entry encoding values.
bool isFortran(SourceLanguage S)
bool isUnitType(uint8_t UnitType)
GnuMacroEntryType
GNU .debug_macro macro information entry type encodings.
UnitType
Constants for unit types in DWARF v5.
@ DW_FORM_lo_user
Not specified by DWARF.
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
@ DW_OP_LLVM_implicit_pointer
Only used in LLVM metadata.
@ DW_OP_LLVM_extract_bits_zext
Only used in LLVM metadata.
@ DW_OP_LLVM_tag_offset
Only used in LLVM metadata.
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
@ DW_OP_LLVM_convert
Only used in LLVM metadata.
@ DW_OP_LLVM_extract_bits_sext
Only used in LLVM metadata.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
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...
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.
const uint32_t DW_INVALID_OFFSET
Identifier of an invalid DIE offset in the .debug_info section.
RnglistEntries
DWARF v5 range list entry encoding values.
std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
LineNumberExtendedOps
Line Number Extended Opcode Encodings.
bool isCPlusPlus(SourceLanguage S)
TypeKind getArrayIndexTypeEncoding(SourceLanguage S)
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
std::optional< unsigned > OperationOperands(LocationAtom O)
The number of operands for the given LocationAtom.
@ DW_TAG_user_base
Recommended base for user tags.
CallFrameInfo
Call frame instruction encodings.
@ DW_DS_trailing_separate
@ DW_DS_trailing_overpunch
@ DW_DS_leading_overpunch
uint32_t getDebugNamesBucketCount(uint32_t UniqueHashCount)
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
llvm::StringRef LanguageDescription(SourceLanguageName name)
@ DW_FLAG_type_implementation
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
@ DW_ATOM_type_type_flags
bool isC(SourceLanguage S)
@ DW_ARANGES_VERSION
Section version number for .debug_aranges.
@ DW_PUBNAMES_VERSION
Section version number for .debug_pubnames.
@ DWARF_VERSION
Other constants.
@ DW_TAG_invalid
LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
@ DW_LENGTH_lo_reserved
Special values for an initial length field.
@ DW_MACINFO_invalid
Macinfo type for invalid results.
@ DW_VIRTUALITY_invalid
Virtuality for invalid results.
@ DW_LENGTH_hi_reserved
Upper bound of the reserved range.
@ DW_PUBTYPES_VERSION
Section version number for .debug_pubtypes.
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
@ DWARF_VENDOR_DWARF
Identifiers we use to distinguish vendor extensions.
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.
This is an optimization pass for GlobalISel generic memory operations.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Implement std::hash so that hash_code can be used in STL containers.
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
bool DwarfUsesRelocationsAcrossSections
True if DWARF v2 output generally uses relocations for references to other .debug_* sections.
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
Describes an entry of the various gnu_pub* debug sections.
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
PubIndexEntryDescriptor(uint8_t Value)
PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
GDBIndexEntryLinkage Linkage
static void format(const Enum &E, raw_ostream &OS, StringRef Style)