diff options
author | Devang Patel <dpatel@apple.com> | 2009-08-22 17:12:53 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-08-22 17:12:53 +0000 |
commit | 24f20e083280d979e8fa1bc88959ae9e8339ee99 (patch) | |
tree | fdf60e309e78fbbf72b85785fb247d661f7a6705 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 310ed1364185535949432bfd25a1aca3c5496f87 (diff) | |
download | llvm-24f20e083280d979e8fa1bc88959ae9e8339ee99.tar.gz llvm-24f20e083280d979e8fa1bc88959ae9e8339ee99.tar.bz2 llvm-24f20e083280d979e8fa1bc88959ae9e8339ee99.tar.xz |
Record variable debug info at ISel time directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 59 |
1 files changed, 17 insertions, 42 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2f4ee5eef1..66b340821c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1502,7 +1502,6 @@ void DwarfDebug::EndFunction(MachineFunction *MF) { DbgScopeMap.clear(); DbgAbstractScopeMap.clear(); DbgConcreteScopeMap.clear(); - InlinedVariableScopes.clear(); FunctionDbgScope = NULL; LexicalScopeStack.clear(); AbstractInstanceRootList.clear(); @@ -1609,8 +1608,7 @@ unsigned DwarfDebug::RecordRegionEnd(GlobalVariable *V) { } /// RecordVariable - Indicate the declaration of a local variable. -void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex, - const MachineInstr *MI) { +void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { if (TimePassesIsEnabled) DebugTimer->startTimer(); @@ -1623,18 +1621,22 @@ void DwarfDebug::RecordVariable(GlobalVariable *GV, unsigned FrameIndex, DIGlobalVariable DG(GV); Scope = getOrCreateScope(DG.getContext().getGV()); } else { - DenseMap<const MachineInstr *, DbgScope *>::iterator - SI = InlinedVariableScopes.find(MI); - - if (SI != InlinedVariableScopes.end()) { - // or GV is an inlined local variable. - Scope = SI->second; - InlinedFnVar = true; - } else { - DIVariable DV(GV); - GlobalVariable *V = DV.getContext().getGV(); - - // or GV is a local variable. + bool InlinedVar = false; + DIVariable DV(GV); + GlobalVariable *V = DV.getContext().getGV(); + DISubprogram SP(V); + if (!SP.isNull()) { + // SP is inserted into DbgAbstractScopeMap when inlined function + // start was recorded by RecordInlineFnStart. + DenseMap<GlobalVariable *, DbgScope *>::iterator + I = DbgAbstractScopeMap.find(SP.getGV()); + if (I != DbgAbstractScopeMap.end()) { + InlinedVar = true; + Scope = I->second; + } + } + if (!InlinedVar) { + // GV is a local variable. Scope = getOrCreateScope(V); } } @@ -1768,33 +1770,6 @@ unsigned DwarfDebug::RecordInlinedFnEnd(DISubprogram &SP) { return ID; } -/// RecordVariableScope - Record scope for the variable declared by -/// DeclareMI. DeclareMI must describe TargetInstrInfo::DECLARE. Record scopes -/// for only inlined subroutine variables. Other variables's scopes are -/// determined during RecordVariable(). -void DwarfDebug::RecordVariableScope(DIVariable &DV, - const MachineInstr *DeclareMI) { - if (TimePassesIsEnabled) - DebugTimer->startTimer(); - - DISubprogram SP(DV.getContext().getGV()); - - if (SP.isNull()) { - if (TimePassesIsEnabled) - DebugTimer->stopTimer(); - - return; - } - - DenseMap<GlobalVariable *, DbgScope *>::iterator - I = DbgAbstractScopeMap.find(SP.getGV()); - if (I != DbgAbstractScopeMap.end()) - InlinedVariableScopes[DeclareMI] = I->second; - - if (TimePassesIsEnabled) - DebugTimer->stopTimer(); -} - //===----------------------------------------------------------------------===// // Emit Methods //===----------------------------------------------------------------------===// |