summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-16 18:18:03 +0000
committerDevang Patel <dpatel@apple.com>2009-10-16 18:18:03 +0000
commitd0099a94dbf2e2a14b654d8c333a03b9c8ec8fca (patch)
tree1c9129b891940311ec276a612ccffd2df4a183cf /llvm/lib
parent6f834660c947eb3d172fd84c49aafc671807d3bc (diff)
downloadbcm5719-llvm-d0099a94dbf2e2a14b654d8c333a03b9c8ec8fca.tar.gz
bcm5719-llvm-d0099a94dbf2e2a14b654d8c333a03b9c8ec8fca.zip
If there is not any llvm instruction associated with each lexical scope encoded in debug info then create such scope on demand for variable info.
llvm-svn: 84262
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 29148510956..87e808ff9af 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1811,10 +1811,18 @@ void DwarfDebug::CollectVariableInfo() {
DIVariable DV (Var);
if (DV.isNull()) continue;
unsigned VSlot = VI->second;
+ DbgScope *Scope = NULL;
DenseMap<MDNode *, DbgScope *>::iterator DSI =
DbgScopeMap.find(DV.getContext().getNode());
- assert (DSI != DbgScopeMap.end() && "Unable to find variable scope!");
- DbgScope *Scope = DSI->second;
+ if (DSI != DbgScopeMap.end())
+ Scope = DSI->second;
+ else
+ // There is not any instruction assocated with this scope, so get
+ // a new scope.
+ Scope = getDbgScope(DV.getContext().getNode(),
+ NULL /* Not an instruction */,
+ NULL /* Not inlined */);
+ assert (Scope && "Unable to find variable scope!");
Scope->AddVariable(new DbgVariable(DV, VSlot, false));
}
}
OpenPOWER on IntegriCloud