diff options
author | Devang Patel <dpatel@apple.com> | 2009-11-10 23:20:04 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-11-10 23:20:04 +0000 |
commit | fb0ee43438d674213490afbeeaccba8052287f31 (patch) | |
tree | 4ed506555b7eac3268017a2c2c7ddece4ee67c53 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 6b41aba7ce9c07ae7e4c332c08ebcb0ff435beef (diff) |
Ignore variable if scope info is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 82b48acbbb..2849723af3 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1453,7 +1453,8 @@ DIE *DwarfDebug::UpdateSubprogramScopeDIE(MDNode *SPNode) { DIGlobalVariable GV(N); if (GV.getContext().getNode() == SPNode) { DIE *ScopedGVDie = CreateGlobalVariableDIE(ModuleCU, GV); - SPDie->AddChild(ScopedGVDie); + if (ScopedGVDie) + SPDie->AddChild(ScopedGVDie); } } return SPDie; @@ -2076,7 +2077,9 @@ void DwarfDebug::CollectVariableInfo() { ConcreteScopes.lookup(ScopeLoc.getOrigLocation().getNode()); if (!Scope) Scope = DbgScopeMap.lookup(ScopeLoc.getScope().getNode()); - assert (Scope && "Unable to find variable scope!"); + // If variable scope is not found then skip this variable. + if (!Scope) + continue; DbgVariable *RegVar = new DbgVariable(DV, VP.first); Scope->AddVariable(RegVar); |