19#ifndef LLVM_BINARYFORMAT_DWARF_H
20#define LLVM_BINARYFORMAT_DWARF_H
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, VERSION, VENDOR) DW_OP_##NAME = ID,
138#include "llvm/BinaryFormat/Dwarf.def"
150#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID,
151#include "llvm/BinaryFormat/Dwarf.def"
167#define HANDLE_DW_END(ID, NAME) DW_END_##NAME = ID,
168#include "llvm/BinaryFormat/Dwarf.def"
188#define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,
189#include "llvm/BinaryFormat/Dwarf.def"
194#define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID,
195#include "llvm/BinaryFormat/Dwarf.def"
200#define HANDLE_DW_LANG(ID, NAME, LOWER_BOUND, VERSION, VENDOR) \
202#include "llvm/BinaryFormat/Dwarf.def"
213 case DW_LANG_C_plus_plus:
214 case DW_LANG_C_plus_plus_03:
215 case DW_LANG_C_plus_plus_11:
216 case DW_LANG_C_plus_plus_14:
217 case DW_LANG_C_plus_plus_17:
218 case DW_LANG_C_plus_plus_20:
224 case DW_LANG_Cobol74:
225 case DW_LANG_Cobol85:
226 case DW_LANG_Fortran77:
227 case DW_LANG_Fortran90:
228 case DW_LANG_Pascal83:
229 case DW_LANG_Modula2:
233 case DW_LANG_Fortran95:
236 case DW_LANG_ObjC_plus_plus:
242 case DW_LANG_Modula3:
243 case DW_LANG_Haskell:
250 case DW_LANG_Fortran03:
251 case DW_LANG_Fortran08:
252 case DW_LANG_RenderScript:
254 case DW_LANG_Mips_Assembler:
255 case DW_LANG_GOOGLE_RenderScript:
256 case DW_LANG_BORLAND_Delphi:
261 case DW_LANG_Crystal:
263 case DW_LANG_Fortran18:
264 case DW_LANG_Ada2005:
265 case DW_LANG_Ada2012:
279 case DW_LANG_Fortran77:
280 case DW_LANG_Fortran90:
281 case DW_LANG_Fortran95:
282 case DW_LANG_Fortran03:
283 case DW_LANG_Fortran08:
284 case DW_LANG_Fortran18:
290 case DW_LANG_C_plus_plus:
291 case DW_LANG_Cobol74:
292 case DW_LANG_Cobol85:
293 case DW_LANG_Pascal83:
294 case DW_LANG_Modula2:
300 case DW_LANG_ObjC_plus_plus:
306 case DW_LANG_Modula3:
307 case DW_LANG_Haskell:
308 case DW_LANG_C_plus_plus_03:
309 case DW_LANG_C_plus_plus_11:
316 case DW_LANG_C_plus_plus_14:
317 case DW_LANG_RenderScript:
319 case DW_LANG_Mips_Assembler:
320 case DW_LANG_GOOGLE_RenderScript:
321 case DW_LANG_BORLAND_Delphi:
326 case DW_LANG_Crystal:
327 case DW_LANG_C_plus_plus_17:
328 case DW_LANG_C_plus_plus_20:
330 case DW_LANG_Ada2005:
331 case DW_LANG_Ada2012:
351 case DW_LANG_C_plus_plus:
352 case DW_LANG_C_plus_plus_03:
353 case DW_LANG_C_plus_plus_11:
354 case DW_LANG_C_plus_plus_14:
355 case DW_LANG_C_plus_plus_17:
356 case DW_LANG_C_plus_plus_20:
358 case DW_LANG_Cobol74:
359 case DW_LANG_Cobol85:
360 case DW_LANG_Fortran77:
361 case DW_LANG_Fortran90:
362 case DW_LANG_Pascal83:
363 case DW_LANG_Modula2:
366 case DW_LANG_Fortran95:
368 case DW_LANG_ObjC_plus_plus:
374 case DW_LANG_Modula3:
375 case DW_LANG_Haskell:
381 case DW_LANG_Fortran03:
382 case DW_LANG_Fortran08:
383 case DW_LANG_RenderScript:
385 case DW_LANG_Mips_Assembler:
386 case DW_LANG_GOOGLE_RenderScript:
387 case DW_LANG_BORLAND_Delphi:
392 case DW_LANG_Crystal:
393 case DW_LANG_Fortran18:
394 case DW_LANG_Ada2005:
395 case DW_LANG_Ada2012:
402 return isFortran(S) ? DW_ATE_signed : DW_ATE_unsigned;
415#define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID,
416#include "llvm/BinaryFormat/Dwarf.def"
443#define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID,
444#include "llvm/BinaryFormat/Dwarf.def"
449#define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID,
450#include "llvm/BinaryFormat/Dwarf.def"
456#define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID,
457#include "llvm/BinaryFormat/Dwarf.def"
473#define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID,
474#include "llvm/BinaryFormat/Dwarf.def"
481#define HANDLE_DW_MACRO_GNU(ID, NAME) DW_MACRO_GNU_##NAME = ID,
482#include "llvm/BinaryFormat/Dwarf.def"
489#define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
490#include "llvm/BinaryFormat/Dwarf.def"
495#define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID,
496#include "llvm/BinaryFormat/Dwarf.def"
501#define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
502#define HANDLE_DW_CFA_PRED(ID, NAME, ARCH) DW_CFA_##NAME = ID,
503#include "llvm/BinaryFormat/Dwarf.def"
538#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID,
539#include "llvm/BinaryFormat/Dwarf.def"
544#define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID,
545#include "llvm/BinaryFormat/Dwarf.def"
551#define HANDLE_DW_IDX(ID, NAME) DW_IDX_##NAME = ID,
552#include "llvm/BinaryFormat/Dwarf.def"
563 case DW_UT_split_compile:
564 case DW_UT_split_type:
573 case DW_TAG_compile_unit:
574 case DW_TAG_type_unit:
575 case DW_TAG_partial_unit:
576 case DW_TAG_skeleton_unit:
815 return Kind << KIND_OFFSET |
Linkage << LINKAGE_OFFSET;
821 KIND_MASK = 7 << KIND_OFFSET,
823 LINKAGE_MASK = 1 << LINKAGE_OFFSET
827template <
typename Enum>
struct EnumTraits :
public std::false_type {};
830 static constexpr char Type[3] =
"AT";
835 static constexpr char Type[5] =
"FORM";
840 static constexpr char Type[4] =
"IDX";
845 static constexpr char Type[4] =
"TAG";
850 static constexpr char Type[4] =
"LNS";
855 static constexpr char Type[3] =
"OP";
860 return std::numeric_limits<uint64_t>::max() >> (8 - AddressByteSize) * 8;
870template <
typename Enum>
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 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 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
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_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.
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...
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.
@ 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
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
@ 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.
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.
Describes an entry of the various gnu_pub* debug sections.
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
PubIndexEntryDescriptor(uint8_t Value)
PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
GDBIndexEntryLinkage Linkage