Omit DW_TAG_subprograms for subprograms without inlined subroutines when producing...
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfUnit.cpp
index 4bf18db32ff5a0c5281c52df838d2e37dd5662a7..b6514e6b5d60e4bd0b77059a7e37dd6e0cb5ab94 100644 (file)
@@ -2049,23 +2049,20 @@ void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const {
 }
 
 void DwarfCompileUnit::addRange(RangeSpan Range) {
-  // Only add a range for this unit if we're emitting full debug.
-  if (getCUNode().getEmissionKind() == DIBuilder::FullDebug) {
-    bool SameAsPrevCU = this == DD->getPrevCU();
-    DD->setPrevCU(this);
-    // If we have no current ranges just add the range and return, otherwise,
-    // check the current section and CU against the previous section and CU we
-    // emitted into and the subprogram was contained within. If these are the
-    // same then extend our current range, otherwise add this as a new range.
-    if (CURanges.empty() || !SameAsPrevCU ||
-        (&CURanges.back().getEnd()->getSection() !=
-         &Range.getEnd()->getSection())) {
-      CURanges.push_back(Range);
-      return;
-    }
-
-    CURanges.back().setEnd(Range.getEnd());
+  bool SameAsPrevCU = this == DD->getPrevCU();
+  DD->setPrevCU(this);
+  // If we have no current ranges just add the range and return, otherwise,
+  // check the current section and CU against the previous section and CU we
+  // emitted into and the subprogram was contained within. If these are the
+  // same then extend our current range, otherwise add this as a new range.
+  if (CURanges.empty() || !SameAsPrevCU ||
+      (&CURanges.back().getEnd()->getSection() !=
+       &Range.getEnd()->getSection())) {
+    CURanges.push_back(Range);
+    return;
   }
+
+  CURanges.back().setEnd(Range.getEnd());
 }
 
 void DwarfCompileUnit::initStmtList(MCSymbol *DwarfLineSectionSym) {