llvm.org GIT mirror llvm / a66ce7a
Stuff git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216787 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 6 years ago
1 changed file(s) with 20 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
750750 for (MDNode *N : CU_Nodes->operands()) {
751751 DICompileUnit CUNode(N);
752752 DwarfCompileUnit &CU = constructDwarfCompileUnit(CUNode);
753 DIArray SPs = CUNode.getSubprograms();
754 for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
755 SPMap.insert(std::make_pair(SPs.getElement(i), &CU));
756 if (CU.getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly)
757 continue;
753758 DIArray ImportedEntities = CUNode.getImportedEntities();
754759 for (unsigned i = 0, e = ImportedEntities.getNumElements(); i != e; ++i)
755760 ScopesWithImportedEntities.push_back(std::make_pair(
760765 DIArray GVs = CUNode.getGlobalVariables();
761766 for (unsigned i = 0, e = GVs.getNumElements(); i != e; ++i)
762767 CU.createGlobalVariableDIE(DIGlobalVariable(GVs.getElement(i)));
763 DIArray SPs = CUNode.getSubprograms();
764 for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i)
765 SPMap.insert(std::make_pair(SPs.getElement(i), &CU));
766768 DIArray EnumTypes = CUNode.getEnumTypes();
767769 for (unsigned i = 0, e = EnumTypes.getNumElements(); i != e; ++i) {
768770 DIType Ty(EnumTypes.getElement(i));
832834 // If this subprogram has an abstract definition, reference that
833835 SPCU->addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE);
834836 } else {
835 if (!D)
837 if (!D && TheCU.getEmissionKind() != DIBuilder::LineTablesOnly)
836838 // Lazily construct the subprogram if we didn't see either concrete or
837839 // inlined versions during codegen.
838840 D = SPCU->getOrCreateSubprogramDIE(SP);
839 // And attach the attributes
840 SPCU->applySubprogramAttributesToDefinition(SP, *D);
841 if (D)
842 // And attach the attributes
843 SPCU->applySubprogramAttributesToDefinition(SP, *D);
841844 }
842845 }
843846 }
16661669
16671670 LexicalScope *FnScope = LScopes.getCurrentFunctionScope();
16681671 DwarfCompileUnit &TheCU = *SPMap.lookup(FnScope->getScopeNode());
1672 if (TheCU.getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly && LScopes.getAbstractScopesList().empty()) {
1673 assert(ScopeVariables.empty());
1674 assert(CurrentFnArguments.empty());
1675 assert(DbgValues.empty());
1676 assert(AbstractVariables.empty());
1677 LabelsBeforeInsn.clear();
1678 LabelsAfterInsn.clear();
1679 PrevLabel = nullptr;
1680 CurFn = nullptr;
1681 return;
1682 }
16691683
16701684 // Construct abstract scopes.
16711685 for (LexicalScope *AScope : LScopes.getAbstractScopesList()) {