summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-11-15 23:13:08 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-11-15 23:13:08 +0000
commit14f41e7e1811b0c504c82865bd6828acfee82527 (patch)
treec158099e4e9a9826d2d8c6603b3b5d130dd92768 /lib/CodeGen
parent4634338655449a6e76b6a948c91fbe5bc736d24b (diff)
downloadllvm-14f41e7e1811b0c504c82865bd6828acfee82527.tar.gz
llvm-14f41e7e1811b0c504c82865bd6828acfee82527.tar.bz2
llvm-14f41e7e1811b0c504c82865bd6828acfee82527.tar.xz
DwarfDebug: Push DISubprogram through updateSubprogramScopeDIE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp10
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 74c02694b9..c8f8104630 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -366,17 +366,15 @@ bool DwarfDebug::isSubprogramContext(const MDNode *Context) {
// Find DIE for the given subprogram and attach appropriate DW_AT_low_pc
// and DW_AT_high_pc attributes. If there are global variables in this
// scope then create and insert DIEs for these variables.
-DIE *DwarfDebug::updateSubprogramScopeDIE(CompileUnit *SPCU,
- const MDNode *SPNode) {
- DIE *SPDie = SPCU->getDIE(DIDescriptor(SPNode));
+DIE *DwarfDebug::updateSubprogramScopeDIE(CompileUnit *SPCU, DISubprogram SP) {
+ DIE *SPDie = SPCU->getDIE(SP);
assert(SPDie && "Unable to find subprogram DIE!");
- DISubprogram SP(SPNode);
// If we're updating an abstract DIE, then we will be adding the children and
// object pointer later on. But what we don't want to do is process the
// concrete DIE twice.
- if (DIE *AbsSPDIE = AbstractSPDies.lookup(SPNode)) {
+ if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) {
// Pick up abstract subprogram DIE.
SPDie = SPCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *SPCU->getCUDie());
SPCU->addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
@@ -624,7 +622,7 @@ DIE *DwarfDebug::constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope) {
AbstractSPDies.insert(std::make_pair(DS, ScopeDIE));
}
else
- ScopeDIE = updateSubprogramScopeDIE(TheCU, DS);
+ ScopeDIE = updateSubprogramScopeDIE(TheCU, DISubprogram(DS));
}
else {
// Early exit when we know the scope DIE is going to be null.
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 84fdcdd75e..db33abcc67 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -486,7 +486,7 @@ private:
/// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
/// variables in this scope then create and insert DIEs for these
/// variables.
- DIE *updateSubprogramScopeDIE(CompileUnit *SPCU, const MDNode *SPNode);
+ DIE *updateSubprogramScopeDIE(CompileUnit *SPCU, DISubprogram SP);
/// \brief Construct new DW_TAG_lexical_block for this scope and
/// attach DW_AT_low_pc/DW_AT_high_pc labels.