summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-06-06 22:16:56 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-06-06 22:16:56 +0000
commitebcf48cf9eb4cb8690c37e538ab7fab7fe134bd0 (patch)
tree6a167be1a7e6c5b2b6523e7186786e16ee7ba68f /lib
parentc77dec905a58b2308e5efe3a7d1635e4965ccff3 (diff)
downloadllvm-ebcf48cf9eb4cb8690c37e538ab7fab7fe134bd0.tar.gz
llvm-ebcf48cf9eb4cb8690c37e538ab7fab7fe134bd0.tar.bz2
llvm-ebcf48cf9eb4cb8690c37e538ab7fab7fe134bd0.tar.xz
DebugInfo: pubnames: include file-local (static or anonymous namespace) variables and anonymous namespaces themselves.
Still some issues with name qualification, FIXMEs added to test cases and fixes will come next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 49864ea1f3..33cdcefb71 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1071,6 +1071,8 @@ std::string DwarfUnit::getParentContextString(DIScope Context) const {
I != E; ++I) {
DIScope Ctx = *I;
StringRef Name = Ctx.getName();
+ if (Name.empty() && Ctx.isNameSpace())
+ Name = "(anonymous namespace)";
if (!Name.empty()) {
CS += Name;
CS += "::";
@@ -1359,12 +1361,13 @@ DIE *DwarfUnit::getOrCreateNameSpace(DINameSpace NS) {
return NDie;
DIE &NDie = createAndAddDIE(dwarf::DW_TAG_namespace, *ContextDIE, NS);
- if (!NS.getName().empty()) {
+ StringRef Name = NS.getName();
+ if (!Name.empty())
addString(NDie, dwarf::DW_AT_name, NS.getName());
- DD->addAccelNamespace(NS.getName(), NDie);
- addGlobalName(NS.getName(), NDie, NS.getContext());
- } else
- DD->addAccelNamespace("(anonymous namespace)", NDie);
+ else
+ Name = "(anonymous namespace)";
+ DD->addAccelNamespace(Name, NDie);
+ addGlobalName(Name, NDie, NS.getContext());
addSourceLine(NDie, NS);
return &NDie;
}
@@ -1667,10 +1670,8 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
DD->addAccelName(GV.getLinkageName(), AddrDIE);
}
- if (!GV.isLocalToUnit())
- addGlobalName(GV.getName(),
- VariableSpecDIE ? *VariableSpecDIE : *VariableDIE,
- GV.getContext());
+ addGlobalName(GV.getName(), VariableSpecDIE ? *VariableSpecDIE : *VariableDIE,
+ GV.getContext());
}
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.