make InlineInfoLabels hold MCSymbol*'s, avoiding

recomputation of the labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98016 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2010-03-09 00:31:02 +00:00
parent b9dc5f7b58
commit 6ed0f90dac
2 changed files with 11 additions and 11 deletions

View File

@ -1405,8 +1405,9 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin, addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin,
dwarf::DW_FORM_ref4, OriginDIE); dwarf::DW_FORM_ref4, OriginDIE);
addLabel(ScopeDIE, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, MCSymbol *StartLabel = getDWLabel("label", StartID);
getDWLabel("label", StartID));
addLabel(ScopeDIE, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, StartLabel);
addLabel(ScopeDIE, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr, addLabel(ScopeDIE, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr,
getDWLabel("label", EndID)); getDWLabel("label", EndID));
@ -1417,11 +1418,11 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
I = InlineInfo.find(InlinedSP.getNode()); I = InlineInfo.find(InlinedSP.getNode());
if (I == InlineInfo.end()) { if (I == InlineInfo.end()) {
InlineInfo[InlinedSP.getNode()].push_back(std::make_pair(StartID, InlineInfo[InlinedSP.getNode()].push_back(std::make_pair(StartLabel,
ScopeDIE)); ScopeDIE));
InlinedSPNodes.push_back(InlinedSP.getNode()); InlinedSPNodes.push_back(InlinedSP.getNode());
} else } else
I->second.push_back(std::make_pair(StartID, ScopeDIE)); I->second.push_back(std::make_pair(StartLabel, ScopeDIE));
StringPool.insert(InlinedSP.getName()); StringPool.insert(InlinedSP.getName());
StringPool.insert(getRealLinkageName(InlinedSP.getLinkageName())); StringPool.insert(getRealLinkageName(InlinedSP.getLinkageName()));
@ -2965,13 +2966,12 @@ void DwarfDebug::emitDebugInlineInfo() {
for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(), for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(),
LE = Labels.end(); LI != LE; ++LI) { LE = Labels.end(); LI != LE; ++LI) {
DIE *SP = LI->second; if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("DIE offset");
Asm->EmitInt32(SP->getOffset()); EOL("DIE offset"); Asm->EmitInt32(LI->second->getOffset());
// FIXME: "Labels" should hold MCSymbol*'s
MCSymbol *L = getDWLabel("label", LI->first);
if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("low_pc"); if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("low_pc");
Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(L, Asm->OutContext), Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(LI->first,
Asm->OutContext),
TD->getPointerSize(), 0/*AddrSpace*/); TD->getPointerSize(), 0/*AddrSpace*/);
} }
} }

View File

@ -167,8 +167,8 @@ class DwarfDebug : public DwarfPrinter {
/// InlineInfo - Keep track of inlined functions and their location. This /// InlineInfo - Keep track of inlined functions and their location. This
/// information is used to populate debug_inlined section. /// information is used to populate debug_inlined section.
typedef std::pair<unsigned, DIE *> InlineInfoLabels; typedef std::pair<MCSymbol*, DIE *> InlineInfoLabels;
DenseMap<MDNode *, SmallVector<InlineInfoLabels, 4> > InlineInfo; DenseMap<MDNode*, SmallVector<InlineInfoLabels, 4> > InlineInfo;
SmallVector<MDNode *, 4> InlinedSPNodes; SmallVector<MDNode *, 4> InlinedSPNodes;
/// CompileUnitOffsets - A vector of the offsets of the compile units. This is /// CompileUnitOffsets - A vector of the offsets of the compile units. This is