diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-05-06 15:23:00 -0400 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-05-06 15:23:58 -0400 |
commit | f78b674de4531c9092ab1c0c7e4c00196f24e06c (patch) | |
tree | 73fe31837fbfafc15444de738c11f561ce1cf94c /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | |
parent | 6adc45d3fd67cdfc0b653e584ee04232309453fb (diff) | |
download | llvm-f78b674de4531c9092ab1c0c7e4c00196f24e06c.zip llvm-f78b674de4531c9092ab1c0c7e4c00196f24e06c.tar.gz llvm-f78b674de4531c9092ab1c0c7e4c00196f24e06c.tar.bz2 |
Revert "[Debug][CodeView] Emit fully qualified names for globals"
This reverts commit 06591b6d191ad3582d21a801cbaf56b36714cae7.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index cd75c40..f167cea 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -3092,14 +3092,6 @@ void CodeViewDebug::emitGlobalVariableList(ArrayRef<CVGlobalVariable> Globals) { void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) { const DIGlobalVariable *DIGV = CVGV.DIGV; - - 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())) - Scope = MemberDecl->getScope(); - std::string QualifiedName = getFullyQualifiedName(Scope, DIGV->getName()); - if (const GlobalVariable *GV = CVGV.GVInfo.dyn_cast<const GlobalVariable *>()) { // DataSym record, see SymbolRecord.h for more info. Thread local data @@ -3119,9 +3111,13 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) { OS.EmitCOFFSectionIndex(GVSym); OS.AddComment("Name"); const unsigned LengthOfDataRecord = 12; - emitNullTerminatedSymbolName(OS, QualifiedName, LengthOfDataRecord); + emitNullTerminatedSymbolName( + OS, getFullyQualifiedName(DIGV->getScope(), DIGV->getName()), + LengthOfDataRecord); endSymbolRecord(DataEnd); } else { + // FIXME: Currently this only emits the global variables in the IR metadata. + // This should also emit enums and static data members. const DIExpression *DIE = CVGV.GVInfo.get<const DIExpression *>(); assert(DIE->isConstant() && "Global constant variables must contain a constant expression."); @@ -3141,7 +3137,13 @@ void CodeViewDebug::emitDebugInfoForGlobal(const CVGlobalVariable &CVGV) { OS.emitBinaryData(SRef); OS.AddComment("Name"); - emitNullTerminatedSymbolName(OS, QualifiedName); + 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())) + Scope = MemberDecl->getScope(); + emitNullTerminatedSymbolName(OS, + getFullyQualifiedName(Scope, DIGV->getName())); endSymbolRecord(SConstantEnd); } } |