diff options
| author | Devang Patel <dpatel@apple.com> | 2011-07-15 00:30:39 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2011-07-15 00:30:39 +0000 |
| commit | 001c4f3ff02ca06dddbce13ca44ca36e6046bf81 (patch) | |
| tree | d9ad7e3046d7541e390e08b9abbe6d3853413d97 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
| parent | c41d4fe2432263957da1e39d3a933a985725e9e5 (diff) | |
| download | bcm5719-llvm-001c4f3ff02ca06dddbce13ca44ca36e6046bf81.tar.gz bcm5719-llvm-001c4f3ff02ca06dddbce13ca44ca36e6046bf81.zip | |
Do not get confused by multiple empty lexical scopes inlined at one location.
llvm-svn: 135232
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 03fb8d1fa31..b7fc41b77b7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1587,18 +1587,22 @@ DbgScope *DwarfDebug::getOrCreateDbgScope(DebugLoc DL) { } getOrCreateAbstractScope(Scope); - DbgScope *WScope = DbgScopeMap.lookup(InlinedAt); + DbgScope *WScope = NULL; + const MDNode *Key = InlinedAt; + if (const MDNode *Nest = DILocation(InlinedAt).getOrigLocation()) + Key = Nest; + WScope = DbgScopeMap.lookup(Key); if (WScope) return WScope; WScope = new DbgScope(NULL, DIDescriptor(Scope), InlinedAt); - DbgScopeMap.insert(std::make_pair(InlinedAt, WScope)); + DbgScopeMap[Key] = WScope; DbgScope *Parent = getOrCreateDbgScope(DebugLoc::getFromDILocation(InlinedAt)); WScope->setParent(Parent); Parent->addScope(WScope); - ConcreteScopes[InlinedAt] = WScope; + ConcreteScopes[Key] = WScope; return WScope; } @@ -2083,8 +2087,12 @@ DbgScope *DwarfDebug::findDbgScope(DebugLoc DL) { DbgScope *Scope = NULL; LLVMContext &Ctx = Asm->MF->getFunction()->getContext(); - if (const MDNode *IA = DL.getInlinedAt(Ctx)) - Scope = ConcreteScopes.lookup(IA); + if (const MDNode *IA = DL.getInlinedAt(Ctx)) { + const MDNode *Key = IA; + if (const MDNode *Nest = DILocation(IA).getOrigLocation()) + Key = Nest; + Scope = ConcreteScopes.lookup(Key); + } if (Scope == 0) Scope = DbgScopeMap.lookup(DL.getScope(Ctx)); |

