summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-10-10 06:39:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-10-10 06:39:26 +0000
commit58410f241ee7bbbf765b3c7a48868dc5a5b0a876 (patch)
tree7503719ac71a9ee562efddf46e825a61e5c306dd /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent5ccdb98c6846159a6cbcf3284ac3ede353ef1717 (diff)
downloadbcm5719-llvm-58410f241ee7bbbf765b3c7a48868dc5a5b0a876.tar.gz
bcm5719-llvm-58410f241ee7bbbf765b3c7a48868dc5a5b0a876.zip
Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE down into DwarfCompileUnit.
llvm-svn: 219476
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index b461674ad63..a02118566bc 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -335,7 +335,7 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
assert(Scope->isAbstractScope());
assert(!Scope->getInlinedAt());
- DISubprogram SP(Scope->getScopeNode());
+ const MDNode *SP = Scope->getScopeNode();
DIE *&AbsDef = AbstractSPDies[SP];
if (AbsDef)
@@ -346,28 +346,8 @@ void DwarfDebug::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
// Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
// was inlined from another compile unit.
DwarfCompileUnit &SPCU = *SPMap[SP];
- DIE *ContextDIE;
-
- // Some of this is duplicated from DwarfUnit::getOrCreateSubprogramDIE, with
- // the important distinction that the DIDescriptor is not associated with the
- // DIE (since the DIDescriptor will be associated with the concrete DIE, if
- // any). It could be refactored to some common utility function.
- if (DISubprogram SPDecl = SP.getFunctionDeclaration()) {
- ContextDIE = &SPCU.getUnitDie();
- SPCU.getOrCreateSubprogramDIE(SPDecl);
- } else
- ContextDIE = SPCU.getOrCreateContextDIE(resolve(SP.getContext()));
-
- // Passing null as the associated DIDescriptor because the abstract definition
- // shouldn't be found by lookup.
- AbsDef = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE,
- DIDescriptor());
- SPCU.applySubprogramAttributesToDefinition(SP, *AbsDef);
-
- if (SPCU.getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
- SPCU.addUInt(*AbsDef, dwarf::DW_AT_inline, None, dwarf::DW_INL_inlined);
- if (DIE *ObjectPointer = SPCU.createAndAddScopeChildren(Scope, *AbsDef))
- SPCU.addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);
+
+ AbsDef = &SPCU.constructAbstractSubprogramScopeDIE(Scope);
}
void DwarfDebug::addGnuPubAttributes(DwarfUnit &U, DIE &D) const {
OpenPOWER on IntegriCloud