DebugInfo: Move LLE enum handling to .def to match RLE handling

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374122 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2019-10-08 21:48:46 +00:00
parent 43122072b2
commit f17b0c49ca
4 changed files with 37 additions and 16 deletions

View File

@ -17,7 +17,7 @@
defined HANDLE_DW_VIRTUALITY || defined HANDLE_DW_DEFAULTED || \
defined HANDLE_DW_CC || defined HANDLE_DW_LNS || defined HANDLE_DW_LNE || \
defined HANDLE_DW_LNCT || defined HANDLE_DW_MACRO || \
defined HANDLE_DW_RLE || \
defined HANDLE_DW_RLE || defined HANDLE_DW_LLE || \
(defined HANDLE_DW_CFA && defined HANDLE_DW_CFA_PRED) || \
defined HANDLE_DW_APPLE_PROPERTY || defined HANDLE_DW_UT || \
defined HANDLE_DWARF_SECTION || defined HANDLE_DW_IDX || \
@ -91,6 +91,10 @@
#define HANDLE_DW_RLE(ID, NAME)
#endif
#ifndef HANDLE_DW_LLE
#define HANDLE_DW_LLE(ID, NAME)
#endif
#ifndef HANDLE_DW_CFA
#define HANDLE_DW_CFA(ID, NAME)
#endif
@ -825,6 +829,17 @@ HANDLE_DW_RLE(0x05, base_address)
HANDLE_DW_RLE(0x06, start_end)
HANDLE_DW_RLE(0x07, start_length)
// DWARF v5 Loc List Entry encoding values.
HANDLE_DW_LLE(0x00, end_of_list)
HANDLE_DW_LLE(0x01, base_addressx)
HANDLE_DW_LLE(0x02, startx_endx)
HANDLE_DW_LLE(0x03, startx_length)
HANDLE_DW_LLE(0x04, offset_pair)
HANDLE_DW_LLE(0x05, default_location)
HANDLE_DW_LLE(0x06, base_address)
HANDLE_DW_LLE(0x07, start_end)
HANDLE_DW_LLE(0x08, start_length)
// Call frame instruction encodings.
HANDLE_DW_CFA(0x00, nop)
HANDLE_DW_CFA(0x40, advance_loc)
@ -939,6 +954,7 @@ HANDLE_DW_IDX(0x05, type_hash)
#undef HANDLE_DW_LNCT
#undef HANDLE_DW_MACRO
#undef HANDLE_DW_RLE
#undef HANDLE_DW_LLE
#undef HANDLE_DW_CFA
#undef HANDLE_DW_CFA_PRED
#undef HANDLE_DW_APPLE_PROPERTY

View File

@ -308,11 +308,17 @@ enum MacroEntryType {
};
/// DWARF v5 range list entry encoding values.
enum RangeListEntries {
enum RnglistEntries {
#define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
#include "llvm/BinaryFormat/Dwarf.def"
};
/// DWARF v5 loc list entry encoding values.
enum LoclistEntries {
#define HANDLE_DW_LLE(ID, NAME) DW_LLE_##NAME = ID,
#include "llvm/BinaryFormat/Dwarf.def"
};
/// Call frame instruction encodings.
enum CallFrameInfo {
#define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
@ -348,19 +354,6 @@ enum Constants {
DW_EH_PE_indirect = 0x80
};
/// Constants for location lists in DWARF v5.
enum LocationListEntry : unsigned char {
DW_LLE_end_of_list = 0x00,
DW_LLE_base_addressx = 0x01,
DW_LLE_startx_endx = 0x02,
DW_LLE_startx_length = 0x03,
DW_LLE_offset_pair = 0x04,
DW_LLE_default_location = 0x05,
DW_LLE_base_address = 0x06,
DW_LLE_start_end = 0x07,
DW_LLE_start_length = 0x08
};
/// Constants for the DW_APPLE_PROPERTY_attributes attribute.
/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
enum ApplePropertyAttributes {
@ -475,6 +468,7 @@ StringRef LNStandardString(unsigned Standard);
StringRef LNExtendedString(unsigned Encoding);
StringRef MacinfoString(unsigned Encoding);
StringRef RangeListEncodingString(unsigned Encoding);
StringRef LocListEncodingString(unsigned Encoding);
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
StringRef ApplePropertyString(unsigned);
StringRef UnitTypeString(unsigned);

View File

@ -472,6 +472,17 @@ StringRef llvm::dwarf::RangeListEncodingString(unsigned Encoding) {
}
}
StringRef llvm::dwarf::LocListEncodingString(unsigned Encoding) {
switch (Encoding) {
default:
return StringRef();
#define HANDLE_DW_LLE(ID, NAME) \
case DW_LLE_##NAME: \
return "DW_LLE_" #NAME;
#include "llvm/BinaryFormat/Dwarf.def"
}
}
StringRef llvm::dwarf::CallFrameString(unsigned Encoding,
Triple::ArchType Arch) {
assert(Arch != llvm::Triple::ArchType::UnknownArch);

View File

@ -143,7 +143,7 @@ DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data,
DataExtractor::Cursor C(*Offset);
// dwarf::DW_LLE_end_of_list_entry is 0 and indicates the end of the list.
while (auto Kind = static_cast<dwarf::LocationListEntry>(Data.getU8(C))) {
while (auto Kind = static_cast<dwarf::LoclistEntries>(Data.getU8(C))) {
Entry E;
E.Kind = Kind;
switch (Kind) {