Return DIE by reference instead of pointer from DwarfUnit::getUnitDie

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-04-25 18:35:57 +00:00
parent d86dbccfef
commit 5410b5acda
4 changed files with 20 additions and 20 deletions

View File

@ -75,7 +75,7 @@ void DwarfFile::addUnit(std::unique_ptr<DwarfUnit> U) {
// the abbreviations going into ASection.
void DwarfFile::emitUnits(DwarfDebug *DD, const MCSymbol *ASectionSym) {
for (const auto &TheU : CUs) {
DIE *Die = TheU->getUnitDie();
DIE &Die = TheU->getUnitDie();
const MCSection *USection = TheU->getSection();
Asm->OutStreamer.SwitchSection(USection);
@ -84,11 +84,11 @@ void DwarfFile::emitUnits(DwarfDebug *DD, const MCSymbol *ASectionSym) {
// Emit size of content not including length itself
Asm->OutStreamer.AddComment("Length of Unit");
Asm->EmitInt32(TheU->getHeaderSize() + Die->getSize());
Asm->EmitInt32(TheU->getHeaderSize() + Die.getSize());
TheU->emitHeader(ASectionSym);
DD->emitDIE(*Die);
DD->emitDIE(Die);
Asm->OutStreamer.EmitLabel(TheU->getLabelEnd());
}
}
@ -108,7 +108,7 @@ void DwarfFile::computeSizeAndOffsets() {
// EndOffset here is CU-relative, after laying out
// all of the CU DIE.
unsigned EndOffset = computeSizeAndOffset(*TheU->getUnitDie(), Offset);
unsigned EndOffset = computeSizeAndOffset(TheU->getUnitDie(), Offset);
SecOffset += EndOffset;
}
}