diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-10-10 06:39:29 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-10-10 06:39:29 +0000 |
| commit | 4191cbce8c7d9bcc151a0b4b406959a48b0883b7 (patch) | |
| tree | 1c1659a92689d332bc960ef9201d86158126f24f /llvm/lib/CodeGen | |
| parent | 58410f241ee7bbbf765b3c7a48868dc5a5b0a876 (diff) | |
| download | bcm5719-llvm-4191cbce8c7d9bcc151a0b4b406959a48b0883b7.tar.gz bcm5719-llvm-4191cbce8c7d9bcc151a0b4b406959a48b0883b7.zip | |
Sink the per-CU part of DwarfDebug::finishSubprogramDefinitions into DwarfCompileUnit.
llvm-svn: 219477
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 18 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 |
3 files changed, 21 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 617df1b762f..89d0df28e6b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -650,4 +650,22 @@ DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) { return AbsDef; } +void DwarfCompileUnit::finishSubprogramDefinition(DISubprogram SP) { + DIE *D = getDIE(SP); + if (DIE *AbsSPDIE = DD->getAbstractSPDies().lookup(SP)) { + if (D) + // If this subprogram has an abstract definition, reference that + addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE); + } else { + if (!D && getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly) + // Lazily construct the subprogram if we didn't see either concrete or + // inlined versions during codegen. (except in -gmlt ^ where we want + // to omit these entirely) + D = getOrCreateSubprogramDIE(SP); + if (D) + // And attach the attributes + applySubprogramAttributesToDefinition(SP, *D); + } +} + } // end llvm namespace diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index caa6efc121d..04748baf722 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -122,6 +122,8 @@ public: DIE *createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE); DIE &constructAbstractSubprogramScopeDIE(LexicalScope *Scope); + + void finishSubprogramDefinition(DISubprogram SP); }; } // end llvm namespace diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a02118566bc..e9b93bba343 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -530,21 +530,7 @@ void DwarfDebug::finishSubprogramDefinitions() { // folding, etc), in which case ignore it here. if (SPMap[SP] != SPCU) continue; - DIE *D = SPCU->getDIE(SP); - if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) { - if (D) - // If this subprogram has an abstract definition, reference that - SPCU->addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE); - } else { - if (!D && TheCU.getEmissionKind() != DIBuilder::LineTablesOnly) - // Lazily construct the subprogram if we didn't see either concrete or - // inlined versions during codegen. (except in -gmlt ^ where we want - // to omit these entirely) - D = SPCU->getOrCreateSubprogramDIE(SP); - if (D) - // And attach the attributes - SPCU->applySubprogramAttributesToDefinition(SP, *D); - } + SPCU->finishSubprogramDefinition(SP); } } } |

