1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[DebugInfo]: Added DWARFv5 macro header flags and corresponding helper

functions.
This commit is contained in:
Sourabh Singh Tomar 2020-03-07 17:50:07 +05:30
parent 18edbe50e4
commit 6b31d13fe1
3 changed files with 30 additions and 0 deletions

View File

@ -17,6 +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_MACRO_FLAG || \
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 || \
@ -87,6 +88,10 @@
#define HANDLE_DW_MACRO(ID, NAME)
#endif
#ifndef HANDLE_MACRO_FLAG
#define HANDLE_MACRO_FLAG(ID, NAME)
#endif
#ifndef HANDLE_DW_RLE
#define HANDLE_DW_RLE(ID, NAME)
#endif
@ -822,6 +827,11 @@ HANDLE_DW_MACRO(0x0a, import_sup)
HANDLE_DW_MACRO(0x0b, define_strx)
HANDLE_DW_MACRO(0x0c, undef_strx)
// DWARF v5 Macro header flags.
HANDLE_MACRO_FLAG(0x01, OFFSET_SIZE)
HANDLE_MACRO_FLAG(0x02, DEBUG_LINE_OFFSET)
HANDLE_MACRO_FLAG(0x04, OPCODE_OPERANDS_TABLE)
// DWARF v5 Range List Entry encoding values.
HANDLE_DW_RLE(0x00, end_of_list)
HANDLE_DW_RLE(0x01, base_addressx)
@ -956,6 +966,7 @@ HANDLE_DW_IDX(0x05, type_hash)
#undef HANDLE_DW_LNE
#undef HANDLE_DW_LNCT
#undef HANDLE_DW_MACRO
#undef HANDLE_MACRO_FLAG
#undef HANDLE_DW_RLE
#undef HANDLE_DW_LLE
#undef HANDLE_DW_CFA

View File

@ -470,6 +470,7 @@ StringRef ArrayOrderString(unsigned Order);
StringRef LNStandardString(unsigned Standard);
StringRef LNExtendedString(unsigned Encoding);
StringRef MacinfoString(unsigned Encoding);
StringRef MacroString(unsigned Encoding);
StringRef RangeListEncodingString(unsigned Encoding);
StringRef LocListEncodingString(unsigned Encoding);
StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
@ -498,6 +499,7 @@ unsigned getLanguage(StringRef LanguageString);
unsigned getCallingConvention(StringRef LanguageString);
unsigned getAttributeEncoding(StringRef EncodingString);
unsigned getMacinfo(StringRef MacinfoString);
unsigned getMacro(StringRef MacroString);
/// @}
/// \defgroup DwarfConstantsVersioning Dwarf version for constants

View File

@ -477,6 +477,23 @@ unsigned llvm::dwarf::getMacinfo(StringRef MacinfoString) {
.Default(DW_MACINFO_invalid);
}
StringRef llvm::dwarf::MacroString(unsigned Encoding) {
switch (Encoding) {
default:
return StringRef();
#define HANDLE_DW_MACRO(ID, NAME) \
case DW_MACRO_##NAME: \
return "DW_MACRO_" #NAME;
#include "llvm/BinaryFormat/Dwarf.def"
}
}
unsigned llvm::dwarf::getMacro(StringRef MacroString) {
return StringSwitch<unsigned>(MacroString)
#define HANDLE_DW_MACRO(ID, NAME) .Case("DW_MACRO_" #NAME, ID)
#include "llvm/BinaryFormat/Dwarf.def"
.Default(DW_MACINFO_invalid);
}
StringRef llvm::dwarf::RangeListEncodingString(unsigned Encoding) {
switch (Encoding) {
default: