aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 5e60bd8f66..6d61c52af5 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -111,6 +111,9 @@ llvm::DIDescriptor CGDebugInfo::getContextDescriptor(const Decl *Context) {
return llvm::DIDescriptor(Ty);
}
}
+
+ if (!LexicalBlockStack.empty())
+ return llvm::DIDescriptor(LexicalBlockStack.back());
return TheCU;
}
@@ -2822,6 +2825,12 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
getStaticDataMemberDeclaration(VD));
}
+void CGDebugInfo::EmitUsingDirectiveDecl(const UsingDirectiveDecl &UD) {
+ SourceLocation Loc = UD.getNamespaceKeyLocation();
+ llvm::DIFile Unit = getOrCreateFile(Loc);
+ DBuilder.createUsingDirective(getContextDescriptor(&UD), Unit, getLineNumber(Loc), getOrCreateNameSpace(UD.getNominatedNamespace()));
+}
+
/// getOrCreateNamesSpace - Return namespace descriptor for the given
/// namespace decl.
llvm::DINameSpace