From a9a1d276773a85c501213bfe3ed8dfe511d8a7bd Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 27 Feb 2014 07:44:45 +0000 Subject: Don't emit anything into the debug_ranges section if we aren't emitting any ranges - this includes CU ranges where we were previously emitting an end list marker even if we didn't have a list. Testcase includes a test for line table only code emission as the problem was noticed while writing this test. llvm-svn: 202357 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 ca060e2cc22..2eff17176b8 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2873,7 +2873,7 @@ void DwarfDebug::emitDebugRanges() { } // Now emit a range for the CU itself. - if (useCURanges()) { + if (useCURanges() && TheCU->getRanges().size()) { Asm->OutStreamer.EmitLabel( Asm->GetTempSymbol("cu_ranges", TheCU->getUniqueID())); const SmallVectorImpl &Ranges = TheCU->getRanges(); -- cgit v1.2.3