summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-04 23:16:44 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-04 23:16:44 +0000
commitf992790cdc215ada87dde7680698a7a25430d1d7 (patch)
tree525eb914e365e7a6cc04c1d24d87228941e42587 /lib/CodeGen/CGDebugInfo.cpp
parent67d8fe3f69bfb586f3cda59659337caf90e00756 (diff)
downloadclang-f992790cdc215ada87dde7680698a7a25430d1d7.tar.gz
clang-f992790cdc215ada87dde7680698a7a25430d1d7.tar.bz2
clang-f992790cdc215ada87dde7680698a7a25430d1d7.tar.xz
DebugInfo: Place global constants in their appropriate context.
We also don't need to duplicate the name in the LinkageName field. Just leave it empty. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 41f1ddb697..eed2f3c615 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -3230,8 +3230,11 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
// Do not emit separate definitions for function local const/statics.
if (isa<FunctionDecl>(VD->getDeclContext()))
return;
+ llvm::DIDescriptor DContext =
+ getContextDescriptor(dyn_cast<Decl>(VD->getDeclContext()));
llvm::DIGlobalVariable GV = DBuilder.createStaticVariable(
- Unit, Name, Name, Unit, getLineNumber(VD->getLocation()), Ty, true, Init,
+ DContext, Name, StringRef(), Unit, getLineNumber(VD->getLocation()), Ty,
+ true, Init,
getOrCreateStaticDataMemberDeclarationOrNull(cast<VarDecl>(VD)));
DeclCache.insert(std::make_pair(VD->getCanonicalDecl(), llvm::WeakVH(GV)));
}