diff options
author | Devang Patel <dpatel@apple.com> | 2010-05-19 21:58:28 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-05-19 21:58:28 +0000 |
commit | a08130864e651958959c6e01a476de66229f2aed (patch) | |
tree | e4c459abfd5bb7dfbd1af458236f3e136eeaf857 /llvm/lib/CodeGen | |
parent | 08de5c14187cade575f00214ddb2044b6be218ba (diff) | |
download | bcm5719-llvm-a08130864e651958959c6e01a476de66229f2aed.tar.gz bcm5719-llvm-a08130864e651958959c6e01a476de66229f2aed.zip |
Revert r104165.
llvm-svn: 104172
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 4287c115bdd..ce13945583e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2230,8 +2230,11 @@ void DwarfDebug::beginScope(const MachineInstr *MI) { Label = recordSourceLine(DL.getLine(), DL.getCol(), 0); PrevInstLoc = DL; PrevLabel = Label; - LabelsBeforeInsn[MI] = Label; } + + // If this instruction begins a scope then note down corresponding label. + if (InsnsBeginScopeSet.count(MI) != 0) + LabelsBeforeInsn[MI] = Label; } return; @@ -2255,7 +2258,6 @@ void DwarfDebug::beginScope(const MachineInstr *MI) { Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope); PrevInstLoc = DL; PrevLabel = Label; - LabelsBeforeInsn[MI] = Label; } DI->second->setDbgValueLabel(Label); } @@ -2271,9 +2273,11 @@ void DwarfDebug::beginScope(const MachineInstr *MI) { Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope); PrevInstLoc = DL; PrevLabel = Label; - LabelsBeforeInsn[MI] = Label; } + // If this instruction begins a scope then note down corresponding label. + if (InsnsBeginScopeSet.count(MI) != 0) + LabelsBeforeInsn[MI] = Label; } /// endScope - Process end of a scope. @@ -2531,8 +2535,9 @@ void DwarfDebug::identifyScopeMarkers() { continue; for (SmallVector<DbgRange, 4>::const_iterator RI = Ranges.begin(), RE = Ranges.end(); RI != RE; ++RI) { - assert(RI->first && "DbgRange does not have first instruction!"); - assert(RI->second && "DbgRange does not have second instruction!"); + assert(RI->first && "DbgRange does not have first instruction!"); + assert(RI->second && "DbgRange does not have second instruction!"); + InsnsBeginScopeSet.insert(RI->first); InsnsEndScopeSet.insert(RI->second); } } @@ -2626,6 +2631,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) { // Clear debug info CurrentFnDbgScope = NULL; DeleteContainerSeconds(DbgScopeMap); + InsnsBeginScopeSet.clear(); InsnsEndScopeSet.clear(); DbgValueStartMap.clear(); ConcreteScopes.clear(); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 2c4c9b66001..48a52623c39 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -179,6 +179,8 @@ class DwarfDebug { /// corresponds to the MDNode mapped with the subprogram DIE. DenseMap<DIE *, const MDNode *> ContainingTypeMap; + typedef SmallVector<DbgScope *, 2> ScopeVector; + SmallPtrSet<const MachineInstr *, 8> InsnsBeginScopeSet; SmallPtrSet<const MachineInstr *, 8> InsnsEndScopeSet; /// InlineInfo - Keep track of inlined functions and their location. This |