make InlineInfoLabels hold MCSymbol*'s, avoiding
authorChris Lattner <sabre@nondot.org>
Tue, 9 Mar 2010 00:31:02 +0000 (00:31 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 Mar 2010 00:31:02 +0000 (00:31 +0000)
recomputation of the labels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98016 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h

index 62c0d2183c8ef53458101b7b4e90372a14dc394a..7ca94de980d58ed56eeacb6322e1a228ebde7568 100644 (file)
@@ -1405,8 +1405,9 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
   addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin,
               dwarf::DW_FORM_ref4, OriginDIE);
 
-  addLabel(ScopeDIE, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr,
-           getDWLabel("label", StartID));
+  MCSymbol *StartLabel = 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,
            getDWLabel("label", EndID));
 
@@ -1417,11 +1418,11 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
     I = InlineInfo.find(InlinedSP.getNode());
 
   if (I == InlineInfo.end()) {
-    InlineInfo[InlinedSP.getNode()].push_back(std::make_pair(StartID,
+    InlineInfo[InlinedSP.getNode()].push_back(std::make_pair(StartLabel,
                                                              ScopeDIE));
     InlinedSPNodes.push_back(InlinedSP.getNode());
   } 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(getRealLinkageName(InlinedSP.getLinkageName()));
@@ -2965,13 +2966,12 @@ void DwarfDebug::emitDebugInlineInfo() {
 
     for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(),
            LE = Labels.end(); LI != LE; ++LI) {
-      DIE *SP = LI->second;
-      Asm->EmitInt32(SP->getOffset()); EOL("DIE offset");
+      if (Asm->VerboseAsm) Asm->OutStreamer.AddComment("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");
-      Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(L, Asm->OutContext),
+      Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(LI->first,
+                                                         Asm->OutContext),
                                  TD->getPointerSize(), 0/*AddrSpace*/);
     }
   }
index 2abad8aac2cb79f4975ef60a14ad5417cc8da946..0c04502444cf25ae95f2c23297e244e82d2f631f 100644 (file)
@@ -167,8 +167,8 @@ class DwarfDebug : public DwarfPrinter {
 
   /// InlineInfo - Keep track of inlined functions and their location.  This
   /// information is used to populate debug_inlined section.
-  typedef std::pair<unsigned, DIE *> InlineInfoLabels;
-  DenseMap<MDNode *, SmallVector<InlineInfoLabels, 4> > InlineInfo;
+  typedef std::pair<MCSymbol*, DIE *> InlineInfoLabels;
+  DenseMap<MDNode*, SmallVector<InlineInfoLabels, 4> > InlineInfo;
   SmallVector<MDNode *, 4> InlinedSPNodes;
 
   /// CompileUnitOffsets - A vector of the offsets of the compile units. This is