diff options
author | Derek Schuff <dschuff@chromium.org> | 2020-10-28 17:15:58 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2020-10-28 17:41:22 -0700 |
commit | 77973f8dee6d4d6f1b7c2a026249c1f7068f267b (patch) | |
tree | e758cba03022dd0bd6251a11b27422e7e99f7129 /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | a66e334cebec0c54ec357436563ddf78e3caab72 (diff) | |
download | llvm-77973f8dee6d4d6f1b7c2a026249c1f7068f267b.zip llvm-77973f8dee6d4d6f1b7c2a026249c1f7068f267b.tar.gz llvm-77973f8dee6d4d6f1b7c2a026249c1f7068f267b.tar.bz2 |
[WebAssembly] Add support for DWARF type units
Since Wasm comdat sections work similarly to ELF, we can use that mechanism
to eliminate duplicate dwarf type information in the same way.
Differential Revision: https://reviews.llvm.org/D88603
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index d8ea0a8..1349494 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -963,9 +963,14 @@ MCSection *MCObjectFileInfo::getDwarfComdatSection(const char *Name, case Triple::ELF: return Ctx->getELFSection(Name, ELF::SHT_PROGBITS, ELF::SHF_GROUP, 0, utostr(Hash)); + case Triple::Wasm: + // FIXME: When using dwarf 5, the .debug_info section is used for type units + // but that section already exists, so attempting to get it as a comdate + // section triggers an assert. + return Ctx->getWasmSection(Name, SectionKind::getMetadata(), utostr(Hash), + MCContext::GenericSectionID); case Triple::MachO: case Triple::COFF: - case Triple::Wasm: case Triple::GOFF: case Triple::XCOFF: case Triple::UnknownObjectFormat: |