llvm.org GIT mirror llvm / 153cd65
Sink DwarfDebug::AbstractSPDies down into DwarfFile This is the first big step to allowing gmlt-like inline scope information in the skeleton CU. While this commit doesn't change the functionality, it's only a small step to call "constructAbstractSubprogramDIE" on both the InfoHolder and the SkeletonHolder (when in use) and that will at least create the abstract SP dies in that case, though still not creating the other subprograms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221051 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 5 years ago
3 changed file(s) with 11 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
415415 DISubprogram InlinedSP = getDISubprogram(DS);
416416 // Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram
417417 // was inlined from another compile unit.
418 DIE *OriginDIE = DD->getAbstractSPDies()[InlinedSP];
418 DIE *OriginDIE = DU->getAbstractSPDies()[InlinedSP];
419419 assert(OriginDIE && "Unable to find original DIE for an inlined subprogram.");
420420
421421 auto ScopeDIE = make_unique(dwarf::DW_TAG_inlined_subroutine);
587587
588588 void
589589 DwarfCompileUnit::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) {
590 DIE *&AbsDef = DD->getAbstractSPDies()[Scope->getScopeNode()];
590 DIE *&AbsDef = DU->getAbstractSPDies()[Scope->getScopeNode()];
591591 if (AbsDef)
592592 return;
593593
647647
648648 void DwarfCompileUnit::finishSubprogramDefinition(DISubprogram SP) {
649649 DIE *D = getDIE(SP);
650 if (DIE *AbsSPDIE = DD->getAbstractSPDies().lookup(SP)) {
650 if (DIE *AbsSPDIE = DU->getAbstractSPDies().lookup(SP)) {
651651 if (D)
652652 // If this subprogram has an abstract definition, reference that
653653 addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE);
670670 if (Variables.getNumElements() == 0)
671671 return;
672672
673 DIE *SPDIE = DD->getAbstractSPDies().lookup(SP);
673 DIE *SPDIE = DU->getAbstractSPDies().lookup(SP);
674674 if (!SPDIE)
675675 SPDIE = getDIE(SP);
676676 assert(SPDIE);
189189
190190 LexicalScopes LScopes;
191191
192 // Collection of abstract subprogram DIEs.
193 DenseMap AbstractSPDies;
194
195192 // Collection of abstract variables.
196193 DenseMap> AbstractVariables;
197194 SmallVector, 64> ConcreteVariables;
649646
650647 // FIXME: Sink these functions down into DwarfFile/Dwarf*Unit.
651648
652 DenseMap &getAbstractSPDies() {
653 return AbstractSPDies;
654 }
655
656649 SmallPtrSet &getProcessedSPNodes() {
657650 return ProcessedSPNodes;
658651 }
5353 // Collection of dbg variables of a scope.
5454 DenseMap> ScopeVariables;
5555
56 // Collection of abstract subprogram DIEs.
57 DenseMap AbstractSPDies;
58
5659 public:
5760 DwarfFile(AsmPrinter *AP, DwarfDebug &DD, StringRef Pref,
5861 BumpPtrAllocator &DA);
9295 DenseMap> &getScopeVariables() {
9396 return ScopeVariables;
9497 }
98
99 DenseMap &getAbstractSPDies() {
100 return AbstractSPDies;
101 }
95102 };
96103 }
97104 #endif