Accidental commit. This isn't ready for prime time just yet.
authorBill Wendling <isanbard@gmail.com>
Mon, 1 Jun 2009 20:18:46 +0000 (20:18 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 1 Jun 2009 20:18:46 +0000 (20:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72699 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 6b6d3b3c91a71a9fcd1bce75ed897137773970bf..25217b088099d9c7aaf3a9ed7576cecb897ad03f 100644 (file)
@@ -969,6 +969,12 @@ DbgScope *DwarfDebug::getOrCreateScope(GlobalVariable *V) {
   DbgScope *Parent = NULL;
   DIBlock Block(V);
 
+  // Don't create a new scope if we already created one for an inlined function.
+  DenseMap<const GlobalVariable *, DbgScope *>::iterator
+    II = AbstractInstanceRootMap.find(V);
+  if (II != AbstractInstanceRootMap.end())
+    return LexicalScopeStack.back();
+
   if (!Block.isNull()) {
     DIDescriptor ParentDesc = Block.getContext();
     Parent =
@@ -1024,8 +1030,6 @@ void DwarfDebug::ConstructDbgScope(DbgScope *ParentScope,
       AddLabel(Die, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr,
                DWLabel("func_end", SubprogramCount));
 
-    // Add the scope's contents.
-    ConstructDbgScope(ConcreteInst, StartID, EndID, Die, Unit);
     ParentDie->AddChild(Die);
   }