mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
Debug Info: Use identifier to reference DIType in base type field of
ptr_to_member. We introduce a new class DITypeRef that represents a reference to a DIType. It wraps around a Value*, which can be either an identifier in MDString or an actual MDNode. The class has a helper function "resolve" that finds the actual MDNode for a given DITypeRef. We specialize getFieldAs to return a field that is a reference to a DIType. To correctly access the base type field of ptr_to_member, getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef. Also add a typedef for DITypeIdentifierMap and a helper generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually populate the map. Verifier is updated accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190081 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -823,6 +823,7 @@ void DwarfDebug::beginModule() {
|
||||
NamedMDNode *CU_Nodes = M->getNamedMetadata("llvm.dbg.cu");
|
||||
if (!CU_Nodes)
|
||||
return;
|
||||
TypeIdentifierMap = generateDITypeIdentifierMap(CU_Nodes);
|
||||
|
||||
// Emit initial sections so we can reference labels later.
|
||||
emitSectionLabels();
|
||||
@@ -2631,3 +2632,8 @@ void DwarfDebug::emitDebugStrDWO() {
|
||||
InfoHolder.emitStrings(Asm->getObjFileLowering().getDwarfStrDWOSection(),
|
||||
OffSec, StrSym);
|
||||
}
|
||||
|
||||
/// Find the MDNode for the given type reference.
|
||||
MDNode *DwarfDebug::resolve(DITypeRef TRef) const {
|
||||
return TRef.resolve(TypeIdentifierMap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user