diff options
author | Amy Huang <akhuang@google.com> | 2019-06-13 22:53:43 +0000 |
---|---|---|
committer | Amy Huang <akhuang@google.com> | 2019-06-13 22:53:43 +0000 |
commit | 49275272e3ec77e443418dda49b7b9cf0285c189 (patch) | |
tree | 2936fae3c919bafac71ca6013be3ea8314967f6f /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 0feb6e52f18e68f74746cdcd2c52400bf49d54ed (diff) | |
download | bcm5719-llvm-49275272e3ec77e443418dda49b7b9cf0285c189.tar.gz bcm5719-llvm-49275272e3ec77e443418dda49b7b9cf0285c189.zip |
Use fully qualified name when printing S_CONSTANT records
Summary:
Before it was using the fully qualified name only for static data members.
Now it does for all variable names to match MSVC.
Reviewers: rnk
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63012
llvm-svn: 363335
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index b87757583a4..33a69e8beb7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -3069,12 +3069,13 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) { OS.EmitBinaryData(SRef); OS.AddComment("Name"); - // Get fully qualified name if global is a static data member. - std::string Name = DIGV->getDisplayName(); + const DIScope *Scope = DIGV->getScope(); + // For static data members, get the scope from the declaration. if (const auto *MemberDecl = dyn_cast_or_null<DIDerivedType>( DIGV->getRawStaticDataMemberDeclaration())) - Name = getFullyQualifiedName(MemberDecl->getScope(), Name); - emitNullTerminatedSymbolName(OS, Name); + Scope = MemberDecl->getScope(); + emitNullTerminatedSymbolName(OS, + getFullyQualifiedName(Scope, DIGV->getName())); endSymbolRecord(SConstantEnd); } } |