diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-09-09 23:13:01 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-09-09 23:13:01 +0000 |
commit | d0f103775a66232fae4a54fc29fdc031f3436d38 (patch) | |
tree | 997beaa9aa8767527e313dd8605375ad7f7133f3 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | 6485fe4b07b0ea3003b727729ee8f0b8867e0381 (diff) | |
download | bcm5719-llvm-d0f103775a66232fae4a54fc29fdc031f3436d38.tar.gz bcm5719-llvm-d0f103775a66232fae4a54fc29fdc031f3436d38.zip |
Sink PrevCU updating into DwarfUnit::addRange to ensure consistency
So that the two operations in DwarfDebug couldn't get separated (because
I accidentally separated them in some work in progress), put them
together. While we're here, move DwarfUnit::addRange to
DwarfCompileUnit, since it's not relevant to type units.
llvm-svn: 217468
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 3797831506f..bf7860803c3 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -2037,14 +2037,16 @@ void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const { Asm->EmitInt8(Asm->getDataLayout().getPointerSize()); } -void DwarfUnit::addRange(RangeSpan Range) { +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() || this != DD->getPrevCU() || + if (CURanges.empty() || !SameAsPrevCU || (&CURanges.back().getEnd()->getSection() != &Range.getEnd()->getSection())) { CURanges.push_back(Range); |