aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-05-19 21:58:28 +0000
committerDevang Patel <dpatel@apple.com>2010-05-19 21:58:28 +0000
commit461a646a035a8c5cf717fcd006db0d637e342e70 (patch)
treeabc5f0c6c51e39e58d6c341d916c870d1361211a /lib
parentd32e735ae6e3fbebcae9a23d7cda091770bb3a14 (diff)
downloadexternal_llvm-461a646a035a8c5cf717fcd006db0d637e342e70.zip
external_llvm-461a646a035a8c5cf717fcd006db0d637e342e70.tar.gz
external_llvm-461a646a035a8c5cf717fcd006db0d637e342e70.tar.bz2
Revert r104165.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp16
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h2
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 4287c11..ce13945 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/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/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 2c4c9b6..48a5262 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/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