mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-01 10:57:21 +00:00
DebugInfo: Delete DIDescriptor (but not its subclasses)
Delete `DIDescriptor` and update the remaining users. I'll follow-up by deleting subclasses in manageable groups (top-down). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
603fc8c265
commit
20b39c653c
@ -58,22 +58,10 @@ class DIObjCProperty;
|
|||||||
/// \brief Maps from type identifier to the actual MDNode.
|
/// \brief Maps from type identifier to the actual MDNode.
|
||||||
typedef DenseMap<const MDString *, MDNode *> DITypeIdentifierMap;
|
typedef DenseMap<const MDString *, MDNode *> DITypeIdentifierMap;
|
||||||
|
|
||||||
class DIDescriptor {
|
|
||||||
MDNode *N;
|
|
||||||
|
|
||||||
public:
|
|
||||||
DIDescriptor(const MDNode *N = nullptr) : N(const_cast<MDNode *>(N)) {}
|
|
||||||
|
|
||||||
operator MDNode *() const { return N; }
|
|
||||||
MDNode *operator->() const { return N; }
|
|
||||||
MDNode &operator*() const { return *N; }
|
|
||||||
};
|
|
||||||
|
|
||||||
#define DECLARE_SIMPLIFY_DESCRIPTOR(DESC) \
|
#define DECLARE_SIMPLIFY_DESCRIPTOR(DESC) \
|
||||||
class DESC; \
|
class DESC; \
|
||||||
template <> struct simplify_type<const DESC>; \
|
template <> struct simplify_type<const DESC>; \
|
||||||
template <> struct simplify_type<DESC>;
|
template <> struct simplify_type<DESC>;
|
||||||
DECLARE_SIMPLIFY_DESCRIPTOR(DIDescriptor)
|
|
||||||
DECLARE_SIMPLIFY_DESCRIPTOR(DISubrange)
|
DECLARE_SIMPLIFY_DESCRIPTOR(DISubrange)
|
||||||
DECLARE_SIMPLIFY_DESCRIPTOR(DIEnumerator)
|
DECLARE_SIMPLIFY_DESCRIPTOR(DIEnumerator)
|
||||||
DECLARE_SIMPLIFY_DESCRIPTOR(DIScope)
|
DECLARE_SIMPLIFY_DESCRIPTOR(DIScope)
|
||||||
@ -133,7 +121,6 @@ class DIScope {
|
|||||||
public:
|
public:
|
||||||
DIScope(const MDScope *N = nullptr) : N(const_cast<MDScope *>(N)) {}
|
DIScope(const MDScope *N = nullptr) : N(const_cast<MDScope *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator MDScope *() const { return N; }
|
operator MDScope *() const { return N; }
|
||||||
MDScope *operator->() const { return N; }
|
MDScope *operator->() const { return N; }
|
||||||
MDScope &operator*() const { return *N; }
|
MDScope &operator*() const { return *N; }
|
||||||
@ -145,7 +132,6 @@ class DIType {
|
|||||||
public:
|
public:
|
||||||
DIType(const MDType *N = nullptr) : N(const_cast<MDType *>(N)) {}
|
DIType(const MDType *N = nullptr) : N(const_cast<MDType *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIScope() const { return N; }
|
operator DIScope() const { return N; }
|
||||||
operator MDType *() const { return N; }
|
operator MDType *() const { return N; }
|
||||||
MDType *operator->() const { return N; }
|
MDType *operator->() const { return N; }
|
||||||
@ -159,7 +145,6 @@ public:
|
|||||||
DIBasicType(const MDBasicType *N = nullptr)
|
DIBasicType(const MDBasicType *N = nullptr)
|
||||||
: N(const_cast<MDBasicType *>(N)) {}
|
: N(const_cast<MDBasicType *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIType() const { return N; }
|
operator DIType() const { return N; }
|
||||||
operator MDBasicType *() const { return N; }
|
operator MDBasicType *() const { return N; }
|
||||||
MDBasicType *operator->() const { return N; }
|
MDBasicType *operator->() const { return N; }
|
||||||
@ -173,7 +158,6 @@ public:
|
|||||||
DIDerivedType(const MDDerivedTypeBase *N = nullptr)
|
DIDerivedType(const MDDerivedTypeBase *N = nullptr)
|
||||||
: N(const_cast<MDDerivedTypeBase *>(N)) {}
|
: N(const_cast<MDDerivedTypeBase *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIType() const { return N; }
|
operator DIType() const { return N; }
|
||||||
operator MDDerivedTypeBase *() const { return N; }
|
operator MDDerivedTypeBase *() const { return N; }
|
||||||
MDDerivedTypeBase *operator->() const { return N; }
|
MDDerivedTypeBase *operator->() const { return N; }
|
||||||
@ -187,7 +171,6 @@ public:
|
|||||||
DICompositeType(const MDCompositeTypeBase *N = nullptr)
|
DICompositeType(const MDCompositeTypeBase *N = nullptr)
|
||||||
: N(const_cast<MDCompositeTypeBase *>(N)) {}
|
: N(const_cast<MDCompositeTypeBase *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIType() const { return N; }
|
operator DIType() const { return N; }
|
||||||
operator MDCompositeTypeBase *() const { return N; }
|
operator MDCompositeTypeBase *() const { return N; }
|
||||||
MDCompositeTypeBase *operator->() const { return N; }
|
MDCompositeTypeBase *operator->() const { return N; }
|
||||||
@ -201,7 +184,6 @@ public:
|
|||||||
DISubroutineType(const MDSubroutineType *N = nullptr)
|
DISubroutineType(const MDSubroutineType *N = nullptr)
|
||||||
: N(const_cast<MDSubroutineType *>(N)) {}
|
: N(const_cast<MDSubroutineType *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIType() const { return N; }
|
operator DIType() const { return N; }
|
||||||
operator DICompositeType() const { return N; }
|
operator DICompositeType() const { return N; }
|
||||||
operator MDSubroutineType *() const { return N; }
|
operator MDSubroutineType *() const { return N; }
|
||||||
@ -215,7 +197,6 @@ class DIFile {
|
|||||||
public:
|
public:
|
||||||
DIFile(const MDFile *N = nullptr) : N(const_cast<MDFile *>(N)) {}
|
DIFile(const MDFile *N = nullptr) : N(const_cast<MDFile *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIScope() const { return N; }
|
operator DIScope() const { return N; }
|
||||||
operator MDFile *() const { return N; }
|
operator MDFile *() const { return N; }
|
||||||
MDFile *operator->() const { return N; }
|
MDFile *operator->() const { return N; }
|
||||||
@ -229,7 +210,6 @@ public:
|
|||||||
DICompileUnit(const MDCompileUnit *N = nullptr)
|
DICompileUnit(const MDCompileUnit *N = nullptr)
|
||||||
: N(const_cast<MDCompileUnit *>(N)) {}
|
: N(const_cast<MDCompileUnit *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIScope() const { return N; }
|
operator DIScope() const { return N; }
|
||||||
operator MDCompileUnit *() const { return N; }
|
operator MDCompileUnit *() const { return N; }
|
||||||
MDCompileUnit *operator->() const { return N; }
|
MDCompileUnit *operator->() const { return N; }
|
||||||
@ -243,7 +223,6 @@ public:
|
|||||||
DISubprogram(const MDSubprogram *N = nullptr)
|
DISubprogram(const MDSubprogram *N = nullptr)
|
||||||
: N(const_cast<MDSubprogram *>(N)) {}
|
: N(const_cast<MDSubprogram *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIScope() const { return N; }
|
operator DIScope() const { return N; }
|
||||||
operator MDSubprogram *() const { return N; }
|
operator MDSubprogram *() const { return N; }
|
||||||
MDSubprogram *operator->() const { return N; }
|
MDSubprogram *operator->() const { return N; }
|
||||||
@ -257,7 +236,6 @@ public:
|
|||||||
DILexicalBlock(const MDLexicalBlockBase *N = nullptr)
|
DILexicalBlock(const MDLexicalBlockBase *N = nullptr)
|
||||||
: N(const_cast<MDLexicalBlockBase *>(N)) {}
|
: N(const_cast<MDLexicalBlockBase *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator MDLexicalBlockBase *() const { return N; }
|
operator MDLexicalBlockBase *() const { return N; }
|
||||||
MDLexicalBlockBase *operator->() const { return N; }
|
MDLexicalBlockBase *operator->() const { return N; }
|
||||||
MDLexicalBlockBase &operator*() const { return *N; }
|
MDLexicalBlockBase &operator*() const { return *N; }
|
||||||
@ -270,7 +248,6 @@ public:
|
|||||||
DILexicalBlockFile(const MDLexicalBlockFile *N = nullptr)
|
DILexicalBlockFile(const MDLexicalBlockFile *N = nullptr)
|
||||||
: N(const_cast<MDLexicalBlockFile *>(N)) {}
|
: N(const_cast<MDLexicalBlockFile *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator MDLexicalBlockFile *() const { return N; }
|
operator MDLexicalBlockFile *() const { return N; }
|
||||||
MDLexicalBlockFile *operator->() const { return N; }
|
MDLexicalBlockFile *operator->() const { return N; }
|
||||||
MDLexicalBlockFile &operator*() const { return *N; }
|
MDLexicalBlockFile &operator*() const { return *N; }
|
||||||
@ -283,7 +260,6 @@ public:
|
|||||||
DINameSpace(const MDNamespace *N = nullptr)
|
DINameSpace(const MDNamespace *N = nullptr)
|
||||||
: N(const_cast<MDNamespace *>(N)) {}
|
: N(const_cast<MDNamespace *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator DIScope() const { return N; }
|
operator DIScope() const { return N; }
|
||||||
operator MDNamespace *() const { return N; }
|
operator MDNamespace *() const { return N; }
|
||||||
MDNamespace *operator->() const { return N; }
|
MDNamespace *operator->() const { return N; }
|
||||||
@ -321,7 +297,6 @@ public:
|
|||||||
DIGlobalVariable(const MDGlobalVariable *N = nullptr)
|
DIGlobalVariable(const MDGlobalVariable *N = nullptr)
|
||||||
: N(const_cast<MDGlobalVariable *>(N)) {}
|
: N(const_cast<MDGlobalVariable *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator MDGlobalVariable *() const { return N; }
|
operator MDGlobalVariable *() const { return N; }
|
||||||
MDGlobalVariable *operator->() const { return N; }
|
MDGlobalVariable *operator->() const { return N; }
|
||||||
MDGlobalVariable &operator*() const { return *N; }
|
MDGlobalVariable &operator*() const { return *N; }
|
||||||
@ -381,7 +356,6 @@ public:
|
|||||||
DIImportedEntity(const MDImportedEntity *N = nullptr)
|
DIImportedEntity(const MDImportedEntity *N = nullptr)
|
||||||
: N(const_cast<MDImportedEntity *>(N)) {}
|
: N(const_cast<MDImportedEntity *>(N)) {}
|
||||||
|
|
||||||
operator DIDescriptor() const { return N; }
|
|
||||||
operator MDImportedEntity *() const { return N; }
|
operator MDImportedEntity *() const { return N; }
|
||||||
MDImportedEntity *operator->() const { return N; }
|
MDImportedEntity *operator->() const { return N; }
|
||||||
MDImportedEntity &operator*() const { return *N; }
|
MDImportedEntity &operator*() const { return *N; }
|
||||||
@ -393,7 +367,6 @@ public:
|
|||||||
static SimpleType getSimplifiedValue(const DESC &DI) { return DI; } \
|
static SimpleType getSimplifiedValue(const DESC &DI) { return DI; } \
|
||||||
}; \
|
}; \
|
||||||
template <> struct simplify_type<DESC> : simplify_type<const DESC> {};
|
template <> struct simplify_type<DESC> : simplify_type<const DESC> {};
|
||||||
SIMPLIFY_DESCRIPTOR(DIDescriptor)
|
|
||||||
SIMPLIFY_DESCRIPTOR(DISubrange)
|
SIMPLIFY_DESCRIPTOR(DISubrange)
|
||||||
SIMPLIFY_DESCRIPTOR(DIEnumerator)
|
SIMPLIFY_DESCRIPTOR(DIEnumerator)
|
||||||
SIMPLIFY_DESCRIPTOR(DIScope)
|
SIMPLIFY_DESCRIPTOR(DIScope)
|
||||||
|
@ -612,8 +612,8 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
|||||||
if (includeMinimalInlineScopes())
|
if (includeMinimalInlineScopes())
|
||||||
ContextDIE = &getUnitDie();
|
ContextDIE = &getUnitDie();
|
||||||
// Some of this is duplicated from DwarfUnit::getOrCreateSubprogramDIE, with
|
// Some of this is duplicated from DwarfUnit::getOrCreateSubprogramDIE, with
|
||||||
// the important distinction that the DIDescriptor is not associated with the
|
// the important distinction that the debug node is not associated with the
|
||||||
// DIE (since the DIDescriptor will be associated with the concrete DIE, if
|
// DIE (since the debug node will be associated with the concrete DIE, if
|
||||||
// any). It could be refactored to some common utility function.
|
// any). It could be refactored to some common utility function.
|
||||||
else if (auto *SPDecl = SP->getDeclaration()) {
|
else if (auto *SPDecl = SP->getDeclaration()) {
|
||||||
ContextDIE = &getUnitDie();
|
ContextDIE = &getUnitDie();
|
||||||
@ -621,10 +621,9 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
|
|||||||
} else
|
} else
|
||||||
ContextDIE = getOrCreateContextDIE(resolve(SP->getScope()));
|
ContextDIE = getOrCreateContextDIE(resolve(SP->getScope()));
|
||||||
|
|
||||||
// Passing null as the associated DIDescriptor because the abstract definition
|
// Passing null as the associated node because the abstract definition
|
||||||
// shouldn't be found by lookup.
|
// shouldn't be found by lookup.
|
||||||
AbsDef =
|
AbsDef = &createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr);
|
||||||
&createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, DIDescriptor());
|
|
||||||
applySubprogramAttributesToDefinition(SP, *AbsDef);
|
applySubprogramAttributesToDefinition(SP, *AbsDef);
|
||||||
|
|
||||||
if (!includeMinimalInlineScopes())
|
if (!includeMinimalInlineScopes())
|
||||||
|
@ -167,7 +167,7 @@ int64_t DwarfUnit::getDefaultLowerBound() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Check whether the DIE for this MDNode can be shared across CUs.
|
/// Check whether the DIE for this MDNode can be shared across CUs.
|
||||||
static bool isShareableAcrossCUs(DIDescriptor D) {
|
static bool isShareableAcrossCUs(const DebugNode *D) {
|
||||||
// When the MDNode can be part of the type system, the DIE can be shared
|
// When the MDNode can be part of the type system, the DIE can be shared
|
||||||
// across CUs.
|
// across CUs.
|
||||||
// Combining type units and cross-CU DIE sharing is lower value (since
|
// Combining type units and cross-CU DIE sharing is lower value (since
|
||||||
@ -184,7 +184,7 @@ static bool isShareableAcrossCUs(DIDescriptor D) {
|
|||||||
/// specified debug variable. We delegate the request to DwarfDebug
|
/// specified debug variable. We delegate the request to DwarfDebug
|
||||||
/// when the DIE for this MDNode can be shared across CUs. The mappings
|
/// when the DIE for this MDNode can be shared across CUs. The mappings
|
||||||
/// will be kept in DwarfDebug for shareable DIEs.
|
/// will be kept in DwarfDebug for shareable DIEs.
|
||||||
DIE *DwarfUnit::getDIE(DIDescriptor D) const {
|
DIE *DwarfUnit::getDIE(const DebugNode *D) const {
|
||||||
if (isShareableAcrossCUs(D))
|
if (isShareableAcrossCUs(D))
|
||||||
return DU->getDIE(D);
|
return DU->getDIE(D);
|
||||||
return MDNodeToDieMap.lookup(D);
|
return MDNodeToDieMap.lookup(D);
|
||||||
@ -193,7 +193,7 @@ DIE *DwarfUnit::getDIE(DIDescriptor D) const {
|
|||||||
/// insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug
|
/// insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug
|
||||||
/// when the DIE for this MDNode can be shared across CUs. The mappings
|
/// when the DIE for this MDNode can be shared across CUs. The mappings
|
||||||
/// will be kept in DwarfDebug for shareable DIEs.
|
/// will be kept in DwarfDebug for shareable DIEs.
|
||||||
void DwarfUnit::insertDIE(DIDescriptor Desc, DIE *D) {
|
void DwarfUnit::insertDIE(const DebugNode *Desc, DIE *D) {
|
||||||
if (isShareableAcrossCUs(Desc)) {
|
if (isShareableAcrossCUs(Desc)) {
|
||||||
DU->insertDIE(Desc, D);
|
DU->insertDIE(Desc, D);
|
||||||
return;
|
return;
|
||||||
@ -356,7 +356,7 @@ void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute,
|
|||||||
|
|
||||||
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
||||||
/// call insertDIE if MD is not null.
|
/// call insertDIE if MD is not null.
|
||||||
DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N) {
|
DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DebugNode *N) {
|
||||||
assert(Tag != dwarf::DW_TAG_auto_variable &&
|
assert(Tag != dwarf::DW_TAG_auto_variable &&
|
||||||
Tag != dwarf::DW_TAG_arg_variable);
|
Tag != dwarf::DW_TAG_arg_variable);
|
||||||
Parent.addChild(make_unique<DIE>((dwarf::Tag)Tag));
|
Parent.addChild(make_unique<DIE>((dwarf::Tag)Tag));
|
||||||
@ -763,8 +763,7 @@ void DwarfUnit::addLinkageName(DIE &Die, StringRef LinkageName) {
|
|||||||
/// addTemplateParams - Add template parameters into buffer.
|
/// addTemplateParams - Add template parameters into buffer.
|
||||||
void DwarfUnit::addTemplateParams(DIE &Buffer, DIArray TParams) {
|
void DwarfUnit::addTemplateParams(DIE &Buffer, DIArray TParams) {
|
||||||
// Add template parameters.
|
// Add template parameters.
|
||||||
for (unsigned i = 0, e = TParams.size(); i != e; ++i) {
|
for (const auto *Element : TParams) {
|
||||||
DIDescriptor Element = TParams[i];
|
|
||||||
if (auto *TTP = dyn_cast<MDTemplateTypeParameter>(Element))
|
if (auto *TTP = dyn_cast<MDTemplateTypeParameter>(Element))
|
||||||
constructTemplateTypeParameterDIE(Buffer, TTP);
|
constructTemplateTypeParameterDIE(Buffer, TTP);
|
||||||
else if (auto *TVP = dyn_cast<MDTemplateValueParameter>(Element))
|
else if (auto *TVP = dyn_cast<MDTemplateValueParameter>(Element))
|
||||||
@ -1040,8 +1039,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
|||||||
case dwarf::DW_TAG_class_type: {
|
case dwarf::DW_TAG_class_type: {
|
||||||
// Add elements to structure type.
|
// Add elements to structure type.
|
||||||
DIArray Elements = CTy->getElements();
|
DIArray Elements = CTy->getElements();
|
||||||
for (unsigned i = 0, N = Elements.size(); i < N; ++i) {
|
for (const auto *Element : Elements) {
|
||||||
DIDescriptor Element = Elements[i];
|
|
||||||
if (!Element)
|
if (!Element)
|
||||||
continue;
|
continue;
|
||||||
if (auto *SP = dyn_cast<MDSubprogram>(Element))
|
if (auto *SP = dyn_cast<MDSubprogram>(Element))
|
||||||
@ -1438,11 +1436,10 @@ void DwarfUnit::constructEnumTypeDIE(DIE &Buffer, DICompositeType CTy) {
|
|||||||
/// constructContainingTypeDIEs - Construct DIEs for types that contain
|
/// constructContainingTypeDIEs - Construct DIEs for types that contain
|
||||||
/// vtables.
|
/// vtables.
|
||||||
void DwarfUnit::constructContainingTypeDIEs() {
|
void DwarfUnit::constructContainingTypeDIEs() {
|
||||||
for (DenseMap<DIE *, const MDNode *>::iterator CI = ContainingTypeMap.begin(),
|
for (auto CI = ContainingTypeMap.begin(), CE = ContainingTypeMap.end();
|
||||||
CE = ContainingTypeMap.end();
|
|
||||||
CI != CE; ++CI) {
|
CI != CE; ++CI) {
|
||||||
DIE &SPDie = *CI->first;
|
DIE &SPDie = *CI->first;
|
||||||
DIDescriptor D(CI->second);
|
const DebugNode *D = CI->second;
|
||||||
if (!D)
|
if (!D)
|
||||||
continue;
|
continue;
|
||||||
DIE *NDie = getDIE(D);
|
DIE *NDie = getDIE(D);
|
||||||
|
@ -106,7 +106,7 @@ protected:
|
|||||||
/// ContainingTypeMap - This map is used to keep track of subprogram DIEs that
|
/// ContainingTypeMap - This map is used to keep track of subprogram DIEs that
|
||||||
/// need DW_AT_containing_type attribute. This attribute points to a DIE that
|
/// need DW_AT_containing_type attribute. This attribute points to a DIE that
|
||||||
/// corresponds to the MDNode mapped with the subprogram DIE.
|
/// corresponds to the MDNode mapped with the subprogram DIE.
|
||||||
DenseMap<DIE *, const MDNode *> ContainingTypeMap;
|
DenseMap<DIE *, const DebugNode *> ContainingTypeMap;
|
||||||
|
|
||||||
// DIEValueAllocator - All DIEValues are allocated through this allocator.
|
// DIEValueAllocator - All DIEValues are allocated through this allocator.
|
||||||
BumpPtrAllocator DIEValueAllocator;
|
BumpPtrAllocator DIEValueAllocator;
|
||||||
@ -169,7 +169,7 @@ public:
|
|||||||
/// when the MDNode can be part of the type system, since DIEs for
|
/// when the MDNode can be part of the type system, since DIEs for
|
||||||
/// the type system can be shared across CUs and the mappings are
|
/// the type system can be shared across CUs and the mappings are
|
||||||
/// kept in DwarfDebug.
|
/// kept in DwarfDebug.
|
||||||
DIE *getDIE(DIDescriptor D) const;
|
DIE *getDIE(const DebugNode *D) const;
|
||||||
|
|
||||||
/// getDIELoc - Returns a fresh newly allocated DIELoc.
|
/// getDIELoc - Returns a fresh newly allocated DIELoc.
|
||||||
DIELoc *getDIELoc() { return new (DIEValueAllocator) DIELoc(); }
|
DIELoc *getDIELoc() { return new (DIEValueAllocator) DIELoc(); }
|
||||||
@ -178,7 +178,7 @@ public:
|
|||||||
/// when the MDNode can be part of the type system, since DIEs for
|
/// when the MDNode can be part of the type system, since DIEs for
|
||||||
/// the type system can be shared across CUs and the mappings are
|
/// the type system can be shared across CUs and the mappings are
|
||||||
/// kept in DwarfDebug.
|
/// kept in DwarfDebug.
|
||||||
void insertDIE(DIDescriptor Desc, DIE *D);
|
void insertDIE(const DebugNode *Desc, DIE *D);
|
||||||
|
|
||||||
/// addFlag - Add a flag that is true to the DIE.
|
/// addFlag - Add a flag that is true to the DIE.
|
||||||
void addFlag(DIE &Die, dwarf::Attribute Attribute);
|
void addFlag(DIE &Die, dwarf::Attribute Attribute);
|
||||||
@ -313,8 +313,7 @@ public:
|
|||||||
|
|
||||||
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
||||||
/// call insertDIE if MD is not null.
|
/// call insertDIE if MD is not null.
|
||||||
DIE &createAndAddDIE(unsigned Tag, DIE &Parent,
|
DIE &createAndAddDIE(unsigned Tag, DIE &Parent, const DebugNode *N = nullptr);
|
||||||
DIDescriptor N = DIDescriptor());
|
|
||||||
|
|
||||||
/// Compute the size of a header for this unit, not including the initial
|
/// Compute the size of a header for this unit, not including the initial
|
||||||
/// length field.
|
/// length field.
|
||||||
|
@ -29,13 +29,13 @@ struct BreakpointPrinter : public ModulePass {
|
|||||||
|
|
||||||
BreakpointPrinter(raw_ostream &out) : ModulePass(ID), Out(out) {}
|
BreakpointPrinter(raw_ostream &out) : ModulePass(ID), Out(out) {}
|
||||||
|
|
||||||
void getContextName(DIDescriptor Context, std::string &N) {
|
void getContextName(const MDScope *Context, std::string &N) {
|
||||||
if (auto *NS = dyn_cast<MDNamespace>(Context)) {
|
if (auto *NS = dyn_cast<MDNamespace>(Context)) {
|
||||||
if (!NS->getName().empty()) {
|
if (!NS->getName().empty()) {
|
||||||
getContextName(NS->getScope(), N);
|
getContextName(NS->getScope(), N);
|
||||||
N = N + NS->getName().str() + "::";
|
N = N + NS->getName().str() + "::";
|
||||||
}
|
}
|
||||||
} else if (DIType TY = dyn_cast<MDType>(Context)) {
|
} else if (auto *TY = dyn_cast<MDType>(Context)) {
|
||||||
if (!TY->getName().empty()) {
|
if (!TY->getName().empty()) {
|
||||||
getContextName(TY->getScope().resolve(TypeIdentifierMap), N);
|
getContextName(TY->getScope().resolve(TypeIdentifierMap), N);
|
||||||
N = N + TY->getName().str() + "::";
|
N = N + TY->getName().str() + "::";
|
||||||
|
Loading…
Reference in New Issue
Block a user