diff options
Diffstat (limited to 'include/llvm/ObjectYAML')
-rw-r--r-- | include/llvm/ObjectYAML/DWARFYAML.h | 73 | ||||
-rw-r--r-- | include/llvm/ObjectYAML/MachOYAML.h | 1 |
2 files changed, 73 insertions, 1 deletions
diff --git a/include/llvm/ObjectYAML/DWARFYAML.h b/include/llvm/ObjectYAML/DWARFYAML.h index 222cad61a9923..d031b5ac404c5 100644 --- a/include/llvm/ObjectYAML/DWARFYAML.h +++ b/include/llvm/ObjectYAML/DWARFYAML.h @@ -85,6 +85,41 @@ struct Unit { std::vector<Entry> Entries; }; +struct File { + StringRef Name; + uint64_t DirIdx; + uint64_t ModTime; + uint64_t Length; +}; + +struct LineTableOpcode { + dwarf::LineNumberOps Opcode; + uint64_t ExtLen; + dwarf::LineNumberExtendedOps SubOpcode; + uint64_t Data; + int64_t SData; + File FileEntry; + std::vector<llvm::yaml::Hex8> UnknownOpcodeData; + std::vector<llvm::yaml::Hex64> StandardOpcodeData; +}; + +struct LineTable { + uint32_t TotalLength; + uint64_t TotalLength64; + uint16_t Version; + uint64_t PrologueLength; + uint8_t MinInstLength; + uint8_t MaxOpsPerInst; + uint8_t DefaultIsStmt; + uint8_t LineBase; + uint8_t LineRange; + uint8_t OpcodeBase; + std::vector<uint8_t> StandardOpcodeLengths; + std::vector<StringRef> IncludeDirs; + std::vector<File> Files; + std::vector<LineTableOpcode> Opcodes; +}; + struct Data { bool IsLittleEndian; std::vector<Abbrev> AbbrevDecls; @@ -98,6 +133,8 @@ struct Data { std::vector<Unit> CompileUnits; + std::vector<LineTable> DebugLines; + bool isEmpty() const; }; @@ -105,6 +142,7 @@ struct Data { } // namespace llvm LLVM_YAML_IS_SEQUENCE_VECTOR(uint8_t) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex64) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex8) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev) @@ -115,6 +153,9 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::PubEntry) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Unit) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::FormValue) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Entry) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::File) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::LineTable) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::LineTableOpcode) namespace llvm { namespace yaml { @@ -159,6 +200,18 @@ template <> struct MappingTraits<DWARFYAML::FormValue> { static void mapping(IO &IO, DWARFYAML::FormValue &FormValue); }; +template <> struct MappingTraits<DWARFYAML::File> { + static void mapping(IO &IO, DWARFYAML::File &File); +}; + +template <> struct MappingTraits<DWARFYAML::LineTableOpcode> { + static void mapping(IO &IO, DWARFYAML::LineTableOpcode &LineTableOpcode); +}; + +template <> struct MappingTraits<DWARFYAML::LineTable> { + static void mapping(IO &IO, DWARFYAML::LineTable &LineTable); +}; + #define HANDLE_DW_TAG(unused, name) \ io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name); @@ -169,6 +222,26 @@ template <> struct ScalarEnumerationTraits<dwarf::Tag> { } }; +#define HANDLE_DW_LNS(unused, name) \ + io.enumCase(value, "DW_LNS_" #name, dwarf::DW_LNS_##name); + +template <> struct ScalarEnumerationTraits<dwarf::LineNumberOps> { + static void enumeration(IO &io, dwarf::LineNumberOps &value) { +#include "llvm/Support/Dwarf.def" + io.enumFallback<Hex8>(value); + } +}; + +#define HANDLE_DW_LNE(unused, name) \ + io.enumCase(value, "DW_LNE_" #name, dwarf::DW_LNE_##name); + +template <> struct ScalarEnumerationTraits<dwarf::LineNumberExtendedOps> { + static void enumeration(IO &io, dwarf::LineNumberExtendedOps &value) { +#include "llvm/Support/Dwarf.def" + io.enumFallback<Hex16>(value); + } +}; + #define HANDLE_DW_AT(unused, name) \ io.enumCase(value, "DW_AT_" #name, dwarf::DW_AT_##name); diff --git a/include/llvm/ObjectYAML/MachOYAML.h b/include/llvm/ObjectYAML/MachOYAML.h index 6b7a924f51438..9ec32d265bcae 100644 --- a/include/llvm/ObjectYAML/MachOYAML.h +++ b/include/llvm/ObjectYAML/MachOYAML.h @@ -139,7 +139,6 @@ struct UniversalBinary { LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::LoadCommand) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::Section) -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex64) LLVM_YAML_IS_SEQUENCE_VECTOR(int64_t) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::RebaseOpcode) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MachOYAML::BindOpcode) |