From b3c56af49b54a4f6a8899d9cd198ce4da4ec15c0 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 20 Dec 2018 20:46:55 +0000 Subject: DebugInfo: Fix for missing comp_dir handling with r349207 When deciding lazily whether a CU would be split or non-split I accidentally dropped some handling for the line tables comp_dir (by doing it lazily it was too late to be handled properly by the MC line table code). Move that bit of the code back to the non-lazy place. llvm-svn: 349819 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2d8c9e49738..71fbfaa567c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -573,15 +573,6 @@ void DwarfDebug::finishUnitAttributes(const DICompileUnit *DIUnit, DIE &Die = NewCU.getUnitDie(); StringRef FN = DIUnit->getFilename(); - // LTO with assembly output shares a single line table amongst multiple CUs. - // To avoid the compilation directory being ambiguous, let the line table - // explicitly describe the directory of all files, never relying on the - // compilation directory. - if (!Asm->OutStreamer->hasRawTextSupport() || SingleCU) - Asm->OutStreamer->emitDwarfFile0Directive( - CompilationDir, FN, NewCU.getMD5AsBytes(DIUnit->getFile()), - DIUnit->getSource(), NewCU.getUniqueID()); - StringRef Producer = DIUnit->getProducer(); StringRef Flags = DIUnit->getFlags(); if (!Flags.empty() && !useAppleExtensionAttributes()) { @@ -649,6 +640,16 @@ DwarfDebug::getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit) { for (auto *IE : DIUnit->getImportedEntities()) NewCU.addImportedEntity(IE); + // LTO with assembly output shares a single line table amongst multiple CUs. + // To avoid the compilation directory being ambiguous, let the line table + // explicitly describe the directory of all files, never relying on the + // compilation directory. + if (!Asm->OutStreamer->hasRawTextSupport() || SingleCU) + Asm->OutStreamer->emitDwarfFile0Directive( + CompilationDir, DIUnit->getFilename(), + NewCU.getMD5AsBytes(DIUnit->getFile()), DIUnit->getSource(), + NewCU.getUniqueID()); + if (useSplitDwarf()) { NewCU.setSkeleton(constructSkeletonCU(NewCU)); NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoDWOSection()); -- cgit v1.2.3