aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorAmy Huang <akhuang@google.com>2019-05-29 21:45:34 +0000
committerAmy Huang <akhuang@google.com>2019-05-29 21:45:34 +0000
commit325003be02bff4291afb7c635cb0e75d7b3d1ba2 (patch)
tree2d2d0a01a054578498833e4f4f00cfc4bf6d1e76 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parent86bad3f924b33d7985f34ed6b6aefdd86f204f5c (diff)
downloadllvm-325003be02bff4291afb7c635cb0e75d7b3d1ba2.zip
llvm-325003be02bff4291afb7c635cb0e75d7b3d1ba2.tar.gz
llvm-325003be02bff4291afb7c635cb0e75d7b3d1ba2.tar.bz2
CodeView - add static data members to global variable debug info.
Summary: Add static data members to IR debug info's list of global variables so that they are emitted as S_CONSTANT records. Related to https://bugs.llvm.org/show_bug.cgi?id=41615. Reviewers: rnk Subscribers: aprantl, cfe-commits, llvm-commits, thakis Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62167 llvm-svn: 362038
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 417388e..b877575 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -3069,7 +3069,12 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) {
OS.EmitBinaryData(SRef);
OS.AddComment("Name");
- emitNullTerminatedSymbolName(OS, DIGV->getDisplayName());
+ // Get fully qualified name if global is a static data member.
+ std::string Name = DIGV->getDisplayName();
+ if (const auto *MemberDecl = dyn_cast_or_null<DIDerivedType>(
+ DIGV->getRawStaticDataMemberDeclaration()))
+ Name = getFullyQualifiedName(MemberDecl->getScope(), Name);
+ emitNullTerminatedSymbolName(OS, Name);
endSymbolRecord(SConstantEnd);
}
}