summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 29d34a8c1e3..d42231264da 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -950,8 +950,18 @@ void MCObjectFileInfo::InitMCObjectFileInfo(const Triple &TheTriple, bool PIC,
}
MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const {
- return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP,
- 0, utostr(Hash));
+ switch (TT.getObjectFormat()) {
+ case Triple::ELF:
+ return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP,
+ 0, utostr(Hash));
+ case Triple::MachO:
+ case Triple::COFF:
+ case Triple::Wasm:
+ case Triple::UnknownObjectFormat:
+ report_fatal_error("Cannot get DWARF types section for this object file "
+ "format: not implemented.");
+ break;
+ }
}
MCSection *
OpenPOWER on IntegriCloud