mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
DebugInfo: Use the scope of the function declaration, if any, to name a function in DWARF pubnames
This ensures that member functions, for example, are entered into pubnames with their fully qualified name, rather than inside the global namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -531,8 +531,7 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(DwarfCompileUnit &TheCU,
|
||||
// shouldn't be found by lookup.
|
||||
AbsDef = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE,
|
||||
DIDescriptor());
|
||||
SPCU.applySubprogramAttributes(SP, *AbsDef);
|
||||
SPCU.addGlobalName(SP.getName(), *AbsDef, resolve(SP.getContext()));
|
||||
SPCU.applySubprogramAttributesToDefinition(SP, *AbsDef);
|
||||
|
||||
SPCU.addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
|
||||
createAndAddScopeChildren(SPCU, Scope, *AbsDef);
|
||||
@@ -811,8 +810,7 @@ void DwarfDebug::finishSubprogramDefinitions() {
|
||||
// inlined versions during codegen.
|
||||
D = SPCU->getOrCreateSubprogramDIE(SP);
|
||||
// And attach the attributes
|
||||
SPCU->applySubprogramAttributes(SP, *D);
|
||||
SPCU->addGlobalName(SP.getName(), *D, resolve(SP.getContext()));
|
||||
SPCU->applySubprogramAttributesToDefinition(SP, *D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1401,6 +1401,13 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
|
||||
return &SPDie;
|
||||
}
|
||||
|
||||
void DwarfUnit::applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie) {
|
||||
DISubprogram SPDecl = SP.getFunctionDeclaration();
|
||||
DIScope Context = resolve(SPDecl ? SPDecl.getContext() : SP.getContext());
|
||||
applySubprogramAttributes(SP, SPDie);
|
||||
addGlobalName(SP.getName(), SPDie, Context);
|
||||
}
|
||||
|
||||
void DwarfUnit::applySubprogramAttributes(DISubprogram SP, DIE &SPDie) {
|
||||
DIE *DeclDie = nullptr;
|
||||
StringRef DeclLinkageName;
|
||||
|
||||
@@ -400,6 +400,7 @@ public:
|
||||
DIE *getOrCreateSubprogramDIE(DISubprogram SP);
|
||||
|
||||
void applySubprogramAttributes(DISubprogram SP, DIE &SPDie);
|
||||
void applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie);
|
||||
|
||||
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
|
||||
/// given DIType.
|
||||
|
||||
Reference in New Issue
Block a user