mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Check in getOrCreateSubprogramDIE if a declaration exists and if so output
it first. This is a more general fix to pr11300. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144324 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -598,20 +598,8 @@ void DwarfDebug::constructSubprogramDIE(CompileUnit *TheCU,
|
||||
// class type.
|
||||
return;
|
||||
|
||||
DISubprogram SPDecl = SP.getFunctionDeclaration();
|
||||
DIE *DeclDie = NULL;
|
||||
if (SPDecl.isSubprogram()) {
|
||||
DeclDie = TheCU->getOrCreateSubprogramDIE(SPDecl);
|
||||
}
|
||||
|
||||
DIE *SubprogramDie = TheCU->getOrCreateSubprogramDIE(SP);
|
||||
|
||||
if (DeclDie) {
|
||||
// Refer function declaration directly.
|
||||
TheCU->addDIEEntry(SubprogramDie, dwarf::DW_AT_specification,
|
||||
dwarf::DW_FORM_ref4, DeclDie);
|
||||
}
|
||||
|
||||
// Add to map.
|
||||
TheCU->insertDIE(N, SubprogramDie);
|
||||
|
||||
|
Reference in New Issue
Block a user