From 172515f0be61f91c3a67206c6627c5e2572bdb26 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 25 Apr 2014 19:33:43 +0000 Subject: DIEEntry: Refer to the specified DIE via reference rather than pointer. Makes some more cases (the unit tests, specifically), lexically compatible with a change to unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207261 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 321b6c03ba..c0ce5d2f36 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -323,7 +323,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU, if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) { // Pick up abstract subprogram DIE. SPDie = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie()); - SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE); + SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, *AbsSPDIE); } else { DISubprogram SPDecl = SP.getFunctionDeclaration(); if (!SPDecl.isSubprogram()) { @@ -346,7 +346,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU, DIE *SPDeclDie = SPDie; SPDie = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie()); - SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, SPDeclDie); + SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, *SPDeclDie); } } } @@ -471,7 +471,7 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DwarfCompileUnit &TheCU, } DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine); - TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, OriginDIE); + TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE); // If we have multiple ranges, emit them into the range section. if (ScopeRanges.size() > 1) @@ -614,7 +614,7 @@ DIE *DwarfDebug::constructScopeDIE(DwarfCompileUnit &TheCU, ScopeDIE->addChild(I); if (DS.isSubprogram() && ObjectPointer != nullptr) - TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_object_pointer, ObjectPointer); + TheCU.addDIEEntry(*ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer); return ScopeDIE; } @@ -748,7 +748,7 @@ void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit &TheCU, TheCU.addSourceLine(IMDie, Module.getLineNumber(), Module.getContext().getFilename(), Module.getContext().getDirectory()); - TheCU.addDIEEntry(IMDie, dwarf::DW_AT_import, EntityDie); + TheCU.addDIEEntry(IMDie, dwarf::DW_AT_import, *EntityDie); StringRef Name = Module.getName(); if (!Name.empty()) TheCU.addString(IMDie, dwarf::DW_AT_name, Name); @@ -1939,8 +1939,8 @@ static dwarf::PubIndexEntryDescriptor computeIndexValue(DwarfUnit *CU, // look for that now. DIEValue *SpecVal = Die->findAttribute(dwarf::DW_AT_specification); if (SpecVal) { - DIE *SpecDIE = cast(SpecVal)->getEntry(); - if (SpecDIE->findAttribute(dwarf::DW_AT_external)) + DIE &SpecDIE = cast(SpecVal)->getEntry(); + if (SpecDIE.findAttribute(dwarf::DW_AT_external)) Linkage = dwarf::GIEL_EXTERNAL; } else if (Die->findAttribute(dwarf::DW_AT_external)) Linkage = dwarf::GIEL_EXTERNAL; -- cgit v1.2.3