Revert r104165.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104172 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2010-05-19 21:58:28 +00:00
parent d32e735ae6
commit 461a646a03
2 changed files with 13 additions and 5 deletions

View File

@ -2230,8 +2230,11 @@ void DwarfDebug::beginScope(const MachineInstr *MI) {
Label = recordSourceLine(DL.getLine(), DL.getCol(), 0); Label = recordSourceLine(DL.getLine(), DL.getCol(), 0);
PrevInstLoc = DL; PrevInstLoc = DL;
PrevLabel = Label; 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; return;
@ -2255,7 +2258,6 @@ void DwarfDebug::beginScope(const MachineInstr *MI) {
Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope); Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
PrevInstLoc = DL; PrevInstLoc = DL;
PrevLabel = Label; PrevLabel = Label;
LabelsBeforeInsn[MI] = Label;
} }
DI->second->setDbgValueLabel(Label); DI->second->setDbgValueLabel(Label);
} }
@ -2271,9 +2273,11 @@ void DwarfDebug::beginScope(const MachineInstr *MI) {
Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope); Label = recordSourceLine(DL.getLine(), DL.getCol(), Scope);
PrevInstLoc = DL; PrevInstLoc = DL;
PrevLabel = Label; 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. /// endScope - Process end of a scope.
@ -2533,6 +2537,7 @@ void DwarfDebug::identifyScopeMarkers() {
RE = Ranges.end(); RI != RE; ++RI) { RE = Ranges.end(); RI != RE; ++RI) {
assert(RI->first && "DbgRange does not have first instruction!"); assert(RI->first && "DbgRange does not have first instruction!");
assert(RI->second && "DbgRange does not have second instruction!"); assert(RI->second && "DbgRange does not have second instruction!");
InsnsBeginScopeSet.insert(RI->first);
InsnsEndScopeSet.insert(RI->second); InsnsEndScopeSet.insert(RI->second);
} }
} }
@ -2626,6 +2631,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
// Clear debug info // Clear debug info
CurrentFnDbgScope = NULL; CurrentFnDbgScope = NULL;
DeleteContainerSeconds(DbgScopeMap); DeleteContainerSeconds(DbgScopeMap);
InsnsBeginScopeSet.clear();
InsnsEndScopeSet.clear(); InsnsEndScopeSet.clear();
DbgValueStartMap.clear(); DbgValueStartMap.clear();
ConcreteScopes.clear(); ConcreteScopes.clear();

View File

@ -179,6 +179,8 @@ class DwarfDebug {
/// corresponds to the MDNode mapped with the subprogram DIE. /// corresponds to the MDNode mapped with the subprogram DIE.
DenseMap<DIE *, const MDNode *> ContainingTypeMap; DenseMap<DIE *, const MDNode *> ContainingTypeMap;
typedef SmallVector<DbgScope *, 2> ScopeVector;
SmallPtrSet<const MachineInstr *, 8> InsnsBeginScopeSet;
SmallPtrSet<const MachineInstr *, 8> InsnsEndScopeSet; SmallPtrSet<const MachineInstr *, 8> InsnsEndScopeSet;
/// InlineInfo - Keep track of inlined functions and their location. This /// InlineInfo - Keep track of inlined functions and their location. This