diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-05-06 23:33:13 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-05-06 23:33:13 +0000 |
commit | c2fc4ab28c13ebc1da5828e12e638514d4d777dc (patch) | |
tree | 49af2f623f054d6fe66587788f92f9ed32dcb91b /lib | |
parent | 481da5554d03271b0d87b695449963f7728c5895 (diff) |
DebugInfo: Support imported modules (using directives) within lexical blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181272 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 6beba66c79..ddcb931e46 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2930,9 +2930,12 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD, } void CGDebugInfo::EmitUsingDirective(const UsingDirectiveDecl &UD) { + llvm::DIScope Scope = + LexicalBlockStack.empty() + ? getContextDescriptor(cast<Decl>(UD.getDeclContext())) + : llvm::DIScope(LexicalBlockStack.back()); DBuilder.createImportedModule( - getContextDescriptor(cast<Decl>(UD.getDeclContext())), - getOrCreateNameSpace(UD.getNominatedNamespace()), + Scope, getOrCreateNameSpace(UD.getNominatedNamespace()), getLineNumber(UD.getLocation())); } |