[llvm] r203620 - DebugInfo: Avoid re-looking up the DwarfUnit when emitting pubnames/pubtypes
David Blaikie
dblaikie at gmail.com
Tue Mar 11 16:23:39 PDT 2014
Author: dblaikie
Date: Tue Mar 11 18:23:39 2014
New Revision: 203620
URL: http://llvm.org/viewvc/llvm-project?rev=203620&view=rev
Log:
DebugInfo: Avoid re-looking up the DwarfUnit when emitting pubnames/pubtypes
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=203620&r1=203619&r2=203620&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Mar 11 18:23:39 2014
@@ -2212,6 +2212,9 @@ void DwarfDebug::emitDebugPubSection(
const StringMap<const DIE *> &(DwarfUnit::*Accessor)() const) {
for (const auto &NU : CUMap) {
DwarfCompileUnit *TheU = NU.second;
+
+ const auto &Globals = (TheU->*Accessor)();
+
if (auto Skeleton = static_cast<DwarfCompileUnit *>(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;
More information about the llvm-commits
mailing list