diff options
author | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2020-04-03 12:44:09 +0530 |
---|---|---|
committer | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2020-04-06 17:45:10 +0530 |
commit | 5d7e9adce20c997e2a9eeca161be3d22d046a4f4 (patch) | |
tree | 9bcfe170b12b0b89fedf543a8006aa1ddcb64a55 /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | 8f1233699bf64fca1a94dcffe955396f05fdb957 (diff) | |
download | llvm-5d7e9adce20c997e2a9eeca161be3d22d046a4f4.zip llvm-5d7e9adce20c997e2a9eeca161be3d22d046a4f4.tar.gz llvm-5d7e9adce20c997e2a9eeca161be3d22d046a4f4.tar.bz2 |
[DWARF5] Added support for emission of debug_macro section.
Summary:
This patch adds support for emission of following DWARFv5 macro forms
in .debug_macro section.
1. DW_MACRO_start_file
2. DW_MACRO_end_file
3. DW_MACRO_define_strp
4. DW_MACRO_undef_strp.
Reviewed By: dblaikie, ikudrin
Differential Revision: https://reviews.llvm.org/D72828
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index fb9a32e..90e760f 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -276,6 +276,9 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) { DwarfMacinfoSection = Ctx->getMachOSection("__DWARF", "__debug_macinfo", MachO::S_ATTR_DEBUG, SectionKind::getMetadata(), "debug_macinfo"); + DwarfMacroSection = + Ctx->getMachOSection("__DWARF", "__debug_macro", MachO::S_ATTR_DEBUG, + SectionKind::getMetadata(), "debug_macro"); DwarfDebugInlineSection = Ctx->getMachOSection("__DWARF", "__debug_inlined", MachO::S_ATTR_DEBUG, SectionKind::getMetadata()); @@ -427,6 +430,7 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) { Ctx->getELFSection(".debug_ranges", DebugSecType, 0); DwarfMacinfoSection = Ctx->getELFSection(".debug_macinfo", DebugSecType, 0); + DwarfMacroSection = Ctx->getELFSection(".debug_macro", DebugSecType, 0); // DWARF5 Experimental Debug Info @@ -635,6 +639,11 @@ void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) { COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ, SectionKind::getMetadata(), "debug_macinfo"); + DwarfMacroSection = Ctx->getCOFFSection( + ".debug_macro", + COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | + COFF::IMAGE_SCN_MEM_READ, + SectionKind::getMetadata(), "debug_macro"); DwarfMacinfoDWOSection = Ctx->getCOFFSection( ".debug_macinfo.dwo", COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | @@ -771,6 +780,8 @@ void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) { Ctx->getWasmSection(".debug_ranges", SectionKind::getMetadata()); DwarfMacinfoSection = Ctx->getWasmSection(".debug_macinfo", SectionKind::getMetadata()); + DwarfMacroSection = + Ctx->getWasmSection(".debug_macro", SectionKind::getMetadata()); DwarfCUIndexSection = Ctx->getWasmSection(".debug_cu_index", SectionKind::getMetadata()); DwarfTUIndexSection = Ctx->getWasmSection(".debug_tu_index", SectionKind::getMetadata()); DwarfInfoSection = |