From f3cc96e1f3645aa4c4cae37f87d2ece3b9d35f80 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 13 May 2009 20:33:33 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71714 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfWriter.cpp') diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index e9cd280906..35539011aa 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -1286,9 +1286,9 @@ class DwarfDebug : public Dwarf { /// DbgScopeMap - Tracks the scopes in the current function. DenseMap DbgScopeMap; - /// DbgConcreteScopeMap - Tracks inlined scopes in the current function. + /// DbgInlinedScopeMap - Tracks inlined scopes in the current function. DenseMap > DbgConcreteScopeMap; + SmallVector > DbgInlinedScopeMap; /// InlineInfo - Keep track of inlined functions and their location. This /// information is used to populate debug_inlined section. @@ -3434,7 +3434,7 @@ public: if (FunctionDbgScope) { delete FunctionDbgScope; DbgScopeMap.clear(); - DbgConcreteScopeMap.clear(); + DbgInlinedScopeMap.clear(); InlinedVariableScopes.clear(); FunctionDbgScope = NULL; LexicalScopeStack.clear(); @@ -3619,6 +3619,15 @@ public: // 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 >::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 @@ public: LexicalScopeStack.back()->AddConcreteInst(ConcreteScope); - // Keep track of the scope that's inlined into this function. - DenseMap >::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 >::iterator I = InlineInfo.find(GV); @@ -3674,19 +3674,19 @@ public: DebugTimer->startTimer(); GlobalVariable *GV = SP.getGV(); - DenseMap >::iterator - I = DbgConcreteScopeMap.find(GV); + DenseMap >::iterator + I = DbgInlinedScopeMap.find(GV); - if (I == DbgConcreteScopeMap.end()) { + if (I == DbgInlinedScopeMap.end()) { if (TimePassesIsEnabled) DebugTimer->stopTimer(); return 0; } - SmallVector &Scopes = I->second; + SmallVector &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 @@ public: return; } - DenseMap >::iterator - I = DbgConcreteScopeMap.find(SP.getGV()); - if (I != DbgConcreteScopeMap.end()) + DenseMap >::iterator + I = DbgInlinedScopeMap.find(SP.getGV()); + if (I != DbgInlinedScopeMap.end()) InlinedVariableScopes[DeclareMI] = I->second.back(); if (TimePassesIsEnabled) -- cgit v1.2.3-18-g5258