mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.
Follow-up to r203982. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204162 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -369,7 +369,6 @@ bool DwarfDebug::isSubprogramContext(const MDNode *Context) {
|
|||||||
// scope then create and insert DIEs for these variables.
|
// scope then create and insert DIEs for these variables.
|
||||||
DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
|
DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
|
||||||
DISubprogram SP) {
|
DISubprogram SP) {
|
||||||
SP = SPCU->getOdrUniqueSubprogram(resolve(SP.getContext()), SP);
|
|
||||||
DIE *SPDie = SPCU->getDIE(SP);
|
DIE *SPDie = SPCU->getDIE(SP);
|
||||||
|
|
||||||
assert(SPDie && "Unable to find subprogram DIE!");
|
assert(SPDie && "Unable to find subprogram DIE!");
|
||||||
@ -604,7 +603,8 @@ DIE *DwarfDebug::constructScopeDIE(DwarfCompileUnit *TheCU,
|
|||||||
if (!Scope || !Scope->getScopeNode())
|
if (!Scope || !Scope->getScopeNode())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
DIScope DS(Scope->getScopeNode());
|
// Unique scope where applicable.
|
||||||
|
DIScope DS(resolve(DIScope(Scope->getScopeNode()).getRef()));
|
||||||
|
|
||||||
SmallVector<DIE *, 8> Children;
|
SmallVector<DIE *, 8> Children;
|
||||||
DIE *ObjectPointer = NULL;
|
DIE *ObjectPointer = NULL;
|
||||||
|
@ -346,9 +346,6 @@ class DwarfDebug : public AsmPrinterHandler {
|
|||||||
/// of in DwarfCompileUnit.
|
/// of in DwarfCompileUnit.
|
||||||
DenseMap<const MDNode *, DIE *> MDTypeNodeToDieMap;
|
DenseMap<const MDNode *, DIE *> MDTypeNodeToDieMap;
|
||||||
|
|
||||||
// Used to unique C++ member function declarations.
|
|
||||||
StringMap<const MDNode *> OdrMemberMap;
|
|
||||||
|
|
||||||
// List of all labels used in aranges generation.
|
// List of all labels used in aranges generation.
|
||||||
std::vector<SymbolCU> ArangeLabels;
|
std::vector<SymbolCU> ArangeLabels;
|
||||||
|
|
||||||
@ -700,11 +697,6 @@ public:
|
|||||||
return MDTypeNodeToDieMap.lookup(TypeMD);
|
return MDTypeNodeToDieMap.lookup(TypeMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Look up or create an entry in the OdrMemberMap.
|
|
||||||
const MDNode *&getOrCreateOdrMember(StringRef Key) {
|
|
||||||
return OdrMemberMap.GetOrCreateValue(Key).getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Emit all Dwarf sections that should come prior to the
|
/// \brief Emit all Dwarf sections that should come prior to the
|
||||||
/// content.
|
/// content.
|
||||||
void beginModule();
|
void beginModule();
|
||||||
|
@ -1427,24 +1427,6 @@ DIE *DwarfUnit::getOrCreateNameSpace(DINameSpace NS) {
|
|||||||
return NDie;
|
return NDie;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unique C++ member function declarations based on their
|
|
||||||
/// context and mangled name.
|
|
||||||
DISubprogram
|
|
||||||
DwarfUnit::getOdrUniqueSubprogram(DIScope Context, DISubprogram SP) const {
|
|
||||||
if (!hasODR() ||
|
|
||||||
!Context.isCompositeType() ||
|
|
||||||
SP.getLinkageName().empty() ||
|
|
||||||
SP.isDefinition())
|
|
||||||
return SP;
|
|
||||||
// Create a key with the UID of the parent class and this SP's name.
|
|
||||||
Twine Key = SP.getContext().getName() + SP.getLinkageName();
|
|
||||||
const MDNode *&Entry = DD->getOrCreateOdrMember(Key.str());
|
|
||||||
if (!Entry)
|
|
||||||
Entry = &*SP;
|
|
||||||
|
|
||||||
return DISubprogram(Entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// getOrCreateSubprogramDIE - Create new DIE using SP.
|
/// getOrCreateSubprogramDIE - Create new DIE using SP.
|
||||||
DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
|
DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
|
||||||
// Construct the context before querying for the existence of the DIE in case
|
// Construct the context before querying for the existence of the DIE in case
|
||||||
@ -1452,8 +1434,10 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
|
|||||||
// declarations).
|
// declarations).
|
||||||
DIScope Context = resolve(SP.getContext());
|
DIScope Context = resolve(SP.getContext());
|
||||||
DIE *ContextDIE = getOrCreateContextDIE(Context);
|
DIE *ContextDIE = getOrCreateContextDIE(Context);
|
||||||
|
|
||||||
// Unique declarations based on the ODR, where applicable.
|
// Unique declarations based on the ODR, where applicable.
|
||||||
SP = getOdrUniqueSubprogram(Context, SP);
|
SP = DISubprogram(DD->resolve(SP.getRef()));
|
||||||
|
assert(SP.Verify());
|
||||||
|
|
||||||
DIE *SPDie = getDIE(SP);
|
DIE *SPDie = getDIE(SP);
|
||||||
if (SPDie)
|
if (SPDie)
|
||||||
|
@ -487,28 +487,6 @@ public:
|
|||||||
|
|
||||||
virtual DwarfCompileUnit &getCU() = 0;
|
virtual DwarfCompileUnit &getCU() = 0;
|
||||||
|
|
||||||
/// \brief Return whether this compilation unit has the
|
|
||||||
/// one-definition-rule (ODR). In C++ this allows the compiler to
|
|
||||||
/// perform type unique during LTO.
|
|
||||||
bool hasODR() const {
|
|
||||||
switch (getLanguage()) {
|
|
||||||
case dwarf::DW_LANG_C_plus_plus:
|
|
||||||
case dwarf::DW_LANG_C_plus_plus_03:
|
|
||||||
case dwarf::DW_LANG_C_plus_plus_11:
|
|
||||||
// For all we care, the C++ part of the language has the ODR and
|
|
||||||
// ObjC methods are not represented in a way that they could be
|
|
||||||
// confused with C++ member functions.
|
|
||||||
case dwarf::DW_LANG_ObjC_plus_plus:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Unique C++ member function declarations based on their
|
|
||||||
/// context+mangled name.
|
|
||||||
DISubprogram getOdrUniqueSubprogram(DIScope Context, DISubprogram SP) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// getOrCreateStaticMemberDIE - Create new static data member DIE.
|
/// getOrCreateStaticMemberDIE - Create new static data member DIE.
|
||||||
DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);
|
DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);
|
||||||
|
Reference in New Issue
Block a user