From 740a833a3be33d306c53c29b86ed3579b339b51e Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 27 Feb 2014 01:25:00 +0000 Subject: If we're only emitting line tables for a particular CU then don't add any ranges to the list of ranges for the CU as we don't want to emit them anyway. This ensures that we will still emit ranges if we have a compile unit compiled with only line tables and one compiled with full debug info requested (we'll emit for the one with full debug info). Update testcase metadata accordingly to continue emitting ranges. llvm-svn: 202333 --- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h index 8dd25a0a1da..f92b0852c81 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -21,6 +21,7 @@ #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/StringMap.h" #include "llvm/DebugInfo.h" +#include "llvm/DIBuilder.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSection.h" @@ -249,7 +250,11 @@ public: bool hasContent() const { return !UnitDie->getChildren().empty(); } /// addRange - Add an address range to the list of ranges for this unit. - void addRange(RangeSpan Range) { CURanges.push_back(Range); } + void addRange(RangeSpan Range) { + // Only add a range for this unit if we're emitting full debug. + if (getCUNode().getEmissionKind() == DIBuilder::FullDebug) + CURanges.push_back(Range); + } /// getRanges - Get the list of ranges for this unit. const SmallVectorImpl &getRanges() const { return CURanges; } -- cgit v1.2.3