aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 531d299..3c4d3ab 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -875,11 +875,10 @@ void ELFWriter::writeSectionData(const MCAssembler &Asm, MCSection &Sec,
const MCAsmLayout &Layout) {
MCSectionELF &Section = static_cast<MCSectionELF &>(Sec);
StringRef SectionName = Section.getName();
-
- auto &MC = Asm.getContext();
- const auto &MAI = MC.getAsmInfo();
-
- const DebugCompressionType CompressionType = MAI->compressDebugSections();
+ auto &Ctx = Asm.getContext();
+ const DebugCompressionType CompressionType =
+ Ctx.getTargetOptions() ? Ctx.getTargetOptions()->CompressDebugSections
+ : DebugCompressionType::None;
if (CompressionType == DebugCompressionType::None ||
!SectionName.starts_with(".debug_")) {
Asm.writeSectionData(W.OS, &Section, Layout);