diff options
author | Eric Christopher <echristo@gmail.com> | 2014-02-27 01:25:00 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-02-27 01:25:00 +0000 |
commit | 740a833a3be33d306c53c29b86ed3579b339b51e (patch) | |
tree | 2dbb869bac1cf9cbf2d96c436a19a50ea667c1c8 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | |
parent | 75d49db19b009cccb47bbd6e7dbee251bfeb3dad (diff) | |
download | bcm5719-llvm-740a833a3be33d306c53c29b86ed3579b339b51e.tar.gz bcm5719-llvm-740a833a3be33d306c53c29b86ed3579b339b51e.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 7 |
1 files changed, 6 insertions, 1 deletions
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<RangeSpan> &getRanges() const { return CURanges; } |