summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
index 4e410bb49be..0bfa1d46008 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp
@@ -39,13 +39,14 @@ void DwarfFile::emitUnit(DwarfUnit *TheU, bool UseOffsets) {
if (TheU->getCUNode()->isDebugDirectivesOnly())
return;
- DIE &Die = TheU->getUnitDie();
- MCSection *USection = TheU->getSection();
- Asm->OutStreamer->SwitchSection(USection);
+ MCSection *S = TheU->getSection();
- TheU->emitHeader(UseOffsets);
+ if (!S)
+ return;
- Asm->emitDwarfDIE(Die);
+ Asm->OutStreamer->SwitchSection(S);
+ TheU->emitHeader(UseOffsets);
+ Asm->emitDwarfDIE(TheU->getUnitDie());
}
// Compute the size and offset for each DIE.
OpenPOWER on IntegriCloud