Go to the documentation of this file.
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
827 template <
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";
870 template <
typename Enum>
StringRef AttributeEncodingString(unsigned Encoding)
unsigned AttributeEncodingVendor(TypeKind E)
@ DW_LENGTH_hi_reserved
Upper bound of the reserved range.
This is an optimization pass for GlobalISel generic memory operations.
StringRef MacroString(unsigned Encoding)
@ DW_PUBTYPES_VERSION
Section version number for .debug_pubtypes.
CallFrameInfo
Call frame instruction encodings.
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage)
unsigned getVirtuality(StringRef VirtualityString)
@ DW_OP_LLVM_tag_offset
Only used in LLVM metadata.
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
The instances of the Type class are immutable: once they are created, they are never changed.
@ DWARF_VERSION
Other constants.
StringRef RangeListEncodingString(unsigned Encoding)
unsigned FormVersion(Form F)
bool isC(SourceLanguage S)
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
@ DW_INL_declared_not_inlined
unsigned AttributeVendor(Attribute A)
unsigned getCallingConvention(StringRef LanguageString)
LoclistEntries
DWARF v5 loc list entry encoding values.
StringRef VirtualityString(unsigned Virtuality)
bool isUnitType(uint8_t UnitType)
PubIndexEntryDescriptor(uint8_t Value)
StringRef IndexString(unsigned Idx)
StringRef AccessibilityString(unsigned Access)
StringRef GnuMacroString(unsigned Encoding)
GnuMacroEntryType
GNU .debug_macro macro information entry type encodings.
It looks like we only need to define PPCfmarto for these because according to these instructions perform RTO on fma s result
unsigned TagVendor(Tag T)
StringRef AtomTypeString(unsigned Atom)
const uint32_t DW_INVALID_OFFSET
Identifier of an invalid DIE offset in the .debug_info section.
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch)
StringRef LNExtendedString(unsigned Encoding)
StringRef LanguageString(unsigned Language)
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
StringRef AttributeValueString(uint16_t Attr, unsigned Val)
Returns the symbolic string representing Val when used as a value for attribute Attr.
@ DW_DS_trailing_overpunch
constexpr char Language[]
Key for Kernel::Metadata::mLanguage.
@ DW_ATOM_type_type_flags
unsigned getTag(StringRef TagString)
@ DW_FLAG_type_implementation
unsigned LanguageVersion(SourceLanguage L)
std::optional< unsigned > LanguageLowerBound(SourceLanguage L)
MacroEntryType
DWARF v5 macro information entry type encodings.
StringRef FormatString(DwarfFormat Format)
@ DW_LENGTH_lo_reserved
Special values for an initial length field.
StringRef VisibilityString(unsigned Visibility)
This class implements an extremely fast bulk output stream that can only output to a stream.
LineNumberExtendedOps
Line Number Extended Opcode Encodings.
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind)
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
StringRef FormEncodingString(unsigned Encoding)
@ DW_FORM_lo_user
Not specified by DWARF.
GDBIndexEntryLinkage Linkage
@ DW_OP_LLVM_entry_value
Only used in LLVM metadata.
unsigned getLanguage(StringRef LanguageString)
unsigned TagVersion(Tag T)
StringRef DefaultedMemberString(unsigned DefaultedEncodings)
uint8_t getUnitLengthFieldByteSize(DwarfFormat Format)
Get the byte size of the unit length field depending on the DWARF format.
UnitType
Constants for unit types in DWARF v5.
unsigned AttributeVersion(Attribute A)
@ DW_ARANGES_VERSION
Section version number for .debug_aranges.
unsigned FormVendor(Form F)
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
@ DW_INL_declared_inlined
@ DW_OP_LLVM_arg
Only used in LLVM metadata.
unsigned getAttributeEncoding(StringRef EncodingString)
bool isFortran(SourceLanguage S)
StringRef ArrayOrderString(unsigned Order)
std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
StringRef CaseString(unsigned Case)
@ DW_OP_LLVM_fragment
Only used in LLVM metadata.
@ DW_OP_LLVM_implicit_pointer
Only used in LLVM metadata.
@ DW_TAG_invalid
LLVM mock tags (see also llvm/BinaryFormat/Dwarf.def).
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned LanguageVendor(SourceLanguage L)
ApplePropertyAttributes
Constants for the DW_APPLE_PROPERTY_attributes attribute.
StringRef ApplePropertyString(unsigned)
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
StringRef AtomValueString(uint16_t Atom, unsigned Val)
Returns the symbolic string representing Val when used as a value for atom Atom.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
RnglistEntries
DWARF v5 range list entry encoding values.
StringRef ChildrenString(unsigned Children)
TypeKind getArrayIndexTypeEncoding(SourceLanguage S)
StringRef ConventionString(unsigned Convention)
unsigned getOperationEncoding(StringRef OperationEncodingString)
const uint32_t DW_CIE_ID
Special ID values that distinguish a CIE from a FDE in DWARF CFI.
@ DW_PUBNAMES_VERSION
Section version number for .debug_pubnames.
StringRef EndianityString(unsigned Endian)
@ DW_VIRTUALITY_invalid
Virtuality for invalid results.
@ DW_DS_trailing_separate
@ DWARF_VENDOR_DWARF
Identifiers we use to distinguish vendor extensions.
bool isCPlusPlus(SourceLanguage S)
@ DW_OP_LLVM_convert
Only used in LLVM metadata.
Describes an entry of the various gnu_pub* debug sections.
StringRef LNStandardString(unsigned Standard)
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...
unsigned OperationVendor(LocationAtom O)
StringRef MacinfoString(unsigned Encoding)
@ DW_TAG_user_base
Recommended base for user tags.
@ DW_MACINFO_invalid
Macinfo type for invalid results.
unsigned getMacro(StringRef MacroString)
unsigned OperationVersion(LocationAtom O)
StringRef RLEString(unsigned RLE)
LineNumberOps
Line Number Standard Opcode Encodings.
StringRef InlineCodeString(unsigned Code)
StringRef TagString(unsigned Tag)
@ DW_DS_leading_overpunch
const uint64_t DW64_CIE_ID
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
StringRef DecimalSignString(unsigned Sign)
unsigned AttributeEncodingVersion(TypeKind E)
unsigned getMacinfo(StringRef MacinfoString)
StringRef UnitTypeString(unsigned)
LLVM Value Representation.
StringRef AttributeString(unsigned Attribute)
StringRef OperationEncodingString(unsigned Encoding)
StringRef LocListEncodingString(unsigned Encoding)