summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-04-01 22:47:29 +0000
committerDevang Patel <dpatel@apple.com>2010-04-01 22:47:29 +0000
commitc8e77640a53823b233f3f7a5c2be12aef9ebc69e (patch)
treeb68990f8dd0fbc1a7488be4245d142ca81726402 /lib
parent8ef3acba00c9c42d450fa52c7d3faebce1e507dd (diff)
downloadllvm-c8e77640a53823b233f3f7a5c2be12aef9ebc69e.tar.gz
llvm-c8e77640a53823b233f3f7a5c2be12aef9ebc69e.tar.bz2
llvm-c8e77640a53823b233f3f7a5c2be12aef9ebc69e.tar.xz
Revert r100117.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 52c7089bb2..fb91d4f984 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2147,8 +2147,6 @@ bool DwarfDebug::extractScopeInformation() {
DenseMap<const MachineInstr *, unsigned> MIIndexMap;
unsigned MIIndex = 0;
- MDNode *PrevScope = NULL;
- MDNode *PrevInlinedAt = NULL;
// Scan each instruction and create scopes. First build working set of scopes.
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
I != E; ++I) {
@@ -2162,23 +2160,17 @@ bool DwarfDebug::extractScopeInformation() {
if (DL.isUnknown()) continue;
DILocation DLT = MF->getDILocation(DL);
DIScope DLTScope = DLT.getScope();
- MDNode *NewScope = DLTScope.getNode();
- if (!NewScope) continue;
+ if (!DLTScope.getNode()) continue;
// There is no need to create another DIE for compile unit. For all
// other scopes, create one DbgScope now. This will be translated
// into a scope DIE at the end.
if (DLTScope.isCompileUnit()) continue;
- MDNode *NewInlinedAt = DLT.getOrigLocation().getNode();
- if (NewScope == PrevScope && NewInlinedAt == PrevInlinedAt) continue;
- createDbgScope(NewScope, NewInlinedAt);
- PrevScope = NewScope;
- PrevInlinedAt = NewInlinedAt;
+ createDbgScope(DLTScope.getNode(), DLT.getOrigLocation().getNode());
}
}
+
// Build scope hierarchy using working set of scopes.
- PrevScope = NULL;
- PrevInlinedAt = NULL;
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
I != E; ++I) {
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
@@ -2190,18 +2182,14 @@ bool DwarfDebug::extractScopeInformation() {
if (DL.isUnknown()) continue;
DILocation DLT = MF->getDILocation(DL);
DIScope DLTScope = DLT.getScope();
- MDNode *NewScope = DLTScope.getNode();
- if (!NewScope) continue;
+ if (!DLTScope.getNode()) continue;
// There is no need to create another DIE for compile unit. For all
// other scopes, create one DbgScope now. This will be translated
// into a scope DIE at the end.
if (DLTScope.isCompileUnit()) continue;
- MDNode *NewInlinedAt = DLT.getOrigLocation().getNode();
- if (NewScope == PrevScope && NewInlinedAt == PrevInlinedAt) continue;
- DbgScope *Scope = getUpdatedDbgScope(NewScope, MInsn, NewInlinedAt);
+ DbgScope *Scope = getUpdatedDbgScope(DLTScope.getNode(), MInsn,
+ DLT.getOrigLocation().getNode());
Scope->setLastInsn(MInsn);
- PrevScope = NewScope;
- PrevInlinedAt = NewInlinedAt;
}
}