From: David Blaikie Date: Sun, 2 Nov 2014 01:21:43 +0000 (+0000) Subject: Drop DwarfCompileUnit::getLocalLabel* in favor of just mapping through the skeleton... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=d998d1cc56bb16ce0f6af52db3fc8aaae2c7ac9c Drop DwarfCompileUnit::getLocalLabel* in favor of just mapping through the skeleton explicitly. Confusing to do this two different ways - I'm not too wedded to either one, but here goes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221076 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index c9b365c6ce2..5f80e0cfc23 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -144,22 +144,6 @@ public: void collectDeadVariables(DISubprogram SP); - /// If there's a skeleton then return the begin label for the skeleton unit, - /// otherwise return the local label for this unit. - MCSymbol *getLocalLabelBegin() const { - if (Skeleton) - return Skeleton->getLabelBegin(); - return getLabelBegin(); - } - - /// If there's a skeleton then return the section symbol for the skeleton - /// unit, otherwise return the section symbol for this unit. - MCSymbol *getLocalSectionSym() const { - if (Skeleton) - return Skeleton->getSectionSym(); - return getSectionSym(); - } - /// Set the skeleton unit associated with this unit. void setSkeleton(DwarfCompileUnit &Skel) { Skeleton = &Skel; } diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index ce59debe235..5dbaa4d1f27 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1920,6 +1920,10 @@ void DwarfDebug::emitDebugARanges() { for (DwarfCompileUnit *CU : CUs) { std::vector &List = Spans[CU]; + // Describe the skeleton CU's offset and length, not the dwo file's. + if (auto *Skel = CU->getSkeleton()) + CU = Skel; + // Emit size of content not including length itself. unsigned ContentSize = sizeof(int16_t) + // DWARF ARange version number @@ -1942,7 +1946,7 @@ void DwarfDebug::emitDebugARanges() { Asm->OutStreamer.AddComment("DWARF Arange version number"); Asm->EmitInt16(dwarf::DW_ARANGES_VERSION); Asm->OutStreamer.AddComment("Offset Into Debug Info Section"); - Asm->EmitSectionOffset(CU->getLocalLabelBegin(), CU->getLocalSectionSym()); + Asm->EmitSectionOffset(CU->getLabelBegin(), CU->getSectionSym()); Asm->OutStreamer.AddComment("Address Size (in bytes)"); Asm->EmitInt8(PtrSize); Asm->OutStreamer.AddComment("Segment Size (in bytes)");