From ef953d6399f396b129417e1cdadcd6dc53b9a0ec Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 11 Mar 2014 23:23:39 +0000 Subject: [PATCH] DebugInfo: Avoid re-looking up the DwarfUnit when emitting pubnames/pubtypes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203620 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 93cd89e77a2..45a90dc12d7 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2212,6 +2212,9 @@ void DwarfDebug::emitDebugPubSection( const StringMap &(DwarfUnit::*Accessor)() const) { for (const auto &NU : CUMap) { DwarfCompileUnit *TheU = NU.second; + + const auto &Globals = (TheU->*Accessor)(); + if (auto Skeleton = static_cast(TheU->getSkeleton())) TheU = Skeleton; unsigned ID = TheU->getUniqueID(); @@ -2237,7 +2240,7 @@ void DwarfDebug::emitDebugPubSection( Asm->EmitLabelDifference(TheU->getLabelEnd(), TheU->getLabelBegin(), 4); // Emit the pubnames for this compilation unit. - for (const auto &GI : (getUnits()[ID]->*Accessor)()) { + for (const auto &GI : Globals) { const char *Name = GI.getKeyData(); const DIE *Entity = GI.second; -- 2.34.1