[llvm-branch-commits] [llvm-branch] r71715 - in /llvm/branches/Apple/Dib: lib/CodeGen/AsmPrinter/DwarfWriter.cpp test/DebugInfo/2009-05-13-VariableScope.ll

Bill Wendling isanbard at gmail.com
Wed May 13 13:35:48 PDT 2009


Author: void
Date: Wed May 13 15:35:46 2009
New Revision: 71715

URL: http://llvm.org/viewvc/llvm-project?rev=71715&view=rev
Log:
--- Merging r71714 into '.':
A    test/DebugInfo/2009-05-13-VariableScope.ll
U    lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Move the bookkeeping of the debug scopes back to the place where it
belonged. The variable declaration stuff wasn't happy with it where it
was. Sorry that the testcase is so big. Bugpoint wasn't able to reduce it
successfully.

Added:
    llvm/branches/Apple/Dib/test/DebugInfo/2009-05-13-VariableScope.ll
      - copied unchanged from r71714, llvm/trunk/test/DebugInfo/2009-05-13-VariableScope.ll
Modified:
    llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=71715&r1=71714&r2=71715&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed May 13 15:35:46 2009
@@ -1286,9 +1286,9 @@
   /// DbgScopeMap - Tracks the scopes in the current function.
   DenseMap<GlobalVariable *, DbgScope *> DbgScopeMap;
 
-  /// DbgConcreteScopeMap - Tracks inlined scopes in the current function.
+  /// DbgInlinedScopeMap - Tracks inlined scopes in the current function.
   DenseMap<GlobalVariable *,
-           SmallVector<DbgConcreteScope *, 8> > DbgConcreteScopeMap;
+           SmallVector<DbgScope *, 8> > DbgInlinedScopeMap;
 
   /// InlineInfo - Keep track of inlined functions and their location.  This
   /// information is used to populate debug_inlined section.
@@ -3434,7 +3434,7 @@
     if (FunctionDbgScope) {
       delete FunctionDbgScope;
       DbgScopeMap.clear();
-      DbgConcreteScopeMap.clear();
+      DbgInlinedScopeMap.clear();
       InlinedVariableScopes.clear();
       FunctionDbgScope = NULL;
       LexicalScopeStack.clear();
@@ -3619,6 +3619,15 @@
       // could be more elegant.
       AddUInt(SPDie, DW_AT_inline, 0, DW_INL_declared_not_inlined);
 
+      // Keep track of the scope that's inlined into this function.
+      DenseMap<GlobalVariable *, SmallVector<DbgScope *, 8> >::iterator
+        SI = DbgInlinedScopeMap.find(GV);
+
+      if (SI == DbgInlinedScopeMap.end())
+        DbgInlinedScopeMap[GV].push_back(Scope);
+      else
+        SI->second.push_back(Scope);
+
       AbstractInstanceRootMap[GV] = Scope;
       AbstractInstanceRootList.push_back(Scope);
     }
@@ -3641,15 +3650,6 @@
 
     LexicalScopeStack.back()->AddConcreteInst(ConcreteScope);
 
-    // Keep track of the scope that's inlined into this function.
-    DenseMap<GlobalVariable *, SmallVector<DbgConcreteScope *, 8> >::iterator
-      SI = DbgConcreteScopeMap.find(GV);
-
-    if (SI == DbgConcreteScopeMap.end())
-      DbgConcreteScopeMap[GV].push_back(ConcreteScope);
-    else
-      SI->second.push_back(ConcreteScope);
-
     // Track the start label for this inlined function.
     DenseMap<GlobalVariable *, SmallVector<unsigned, 4> >::iterator
       I = InlineInfo.find(GV);
@@ -3674,19 +3674,19 @@
       DebugTimer->startTimer();
 
     GlobalVariable *GV = SP.getGV();
-    DenseMap<GlobalVariable *, SmallVector<DbgConcreteScope *, 8> >::iterator
-      I = DbgConcreteScopeMap.find(GV);
+    DenseMap<GlobalVariable *, SmallVector<DbgScope *, 8> >::iterator
+      I = DbgInlinedScopeMap.find(GV);
 
-    if (I == DbgConcreteScopeMap.end()) {
+    if (I == DbgInlinedScopeMap.end()) {
       if (TimePassesIsEnabled)
         DebugTimer->stopTimer();
 
       return 0;
     }
 
-    SmallVector<DbgConcreteScope *, 8> &Scopes = I->second;
+    SmallVector<DbgScope *, 8> &Scopes = I->second;
     assert(!Scopes.empty() && "We should have at least one debug scope!");
-    DbgConcreteScope *Scope = Scopes.back(); Scopes.pop_back();
+    DbgScope *Scope = Scopes.back(); Scopes.pop_back();
     unsigned ID = MMI->NextLabelID();
     MMI->RecordUsedDbgLabel(ID);
     Scope->setEndLabelID(ID);
@@ -3714,9 +3714,9 @@
       return;
     }
 
-    DenseMap<GlobalVariable *, SmallVector<DbgConcreteScope *, 8> >::iterator
-      I = DbgConcreteScopeMap.find(SP.getGV());
-    if (I != DbgConcreteScopeMap.end())
+    DenseMap<GlobalVariable *, SmallVector<DbgScope *, 8> >::iterator
+      I = DbgInlinedScopeMap.find(SP.getGV());
+    if (I != DbgInlinedScopeMap.end())
       InlinedVariableScopes[DeclareMI] = I->second.back();
 
     if (TimePassesIsEnabled)





More information about the llvm-branch-commits mailing list