mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-20 19:19:55 +00:00
Reuse existing subprogram DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6e1f16d522
commit
7d0750a10f
@ -1087,7 +1087,11 @@ DIE *DwarfDebug::createSubprogramDIE(CompileUnit *DW_Unit,
|
||||
const DISubprogram &SP,
|
||||
bool IsConstructor,
|
||||
bool IsInlined) {
|
||||
DIE *SPDie = new DIE(dwarf::DW_TAG_subprogram);
|
||||
DIE *SPDie = ModuleCU->getDIE(SP.getNode());
|
||||
if (SPDie)
|
||||
return SPDie;
|
||||
|
||||
SPDie = new DIE(dwarf::DW_TAG_subprogram);
|
||||
addString(SPDie, dwarf::DW_AT_name, dwarf::DW_FORM_string, SP.getName());
|
||||
|
||||
StringRef LinkageName = SP.getLinkageName();
|
||||
@ -1669,6 +1673,7 @@ void DwarfDebug::constructSubprogramDIE(MDNode *N) {
|
||||
ModuleCU->insertDIE(N, SubprogramDie);
|
||||
|
||||
// Add to context owner.
|
||||
if (SP.getContext().getNode() == SP.getCompileUnit().getNode())
|
||||
ModuleCU->getCUDie()->addChild(SubprogramDie);
|
||||
|
||||
// Expose as global.
|
||||
|
Loading…
Reference in New Issue
Block a user