Home | History | Annotate | Download | only in AsmPrinter

Lines Matching refs:DIE

80 DIEEntry *DwarfUnit::createDIEEntry(DIE &Entry) {
129 /// Check whether the DIE for this MDNode can be shared across CUs.
131 // When the MDNode can be part of the type system, the DIE can be shared
133 // Combining type units and cross-CU DIE sharing is lower value (since
134 // cross-CU DIE sharing is used in LTO and removes type redundancy at that
145 /// when the DIE for this MDNode can be shared across CUs. The mappings
147 DIE *DwarfUnit::getDIE(DIDescriptor D) const {
153 /// insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug
154 /// when the DIE for this MDNode can be shared across CUs. The mappings
156 void DwarfUnit::insertDIE(DIDescriptor Desc, DIE *D) {
165 void DwarfUnit::addFlag(DIE &Die, dwarf::Attribute Attribute) {
167 Die.addValue(Attribute, dwarf::DW_FORM_flag_present, DIEIntegerOne);
169 Die.addValue(Attribute, dwarf::DW_FORM_flag, DIEIntegerOne);
174 void DwarfUnit::addUInt(DIE &Die, dwarf::Attribute Attribute,
180 Die.addValue(Attribute, *Form, Value);
183 void DwarfUnit::addUInt(DIE &Block, dwarf::Form Form, uint64_t Integer) {
189 void DwarfUnit::addSInt(DIE &Die, dwarf::Attribute Attribute,
194 Die.addValue(Attribute, *Form, Value);
197 void DwarfUnit::addSInt(DIELoc &Die, Optional<dwarf::Form> Form,
199 addSInt(Die, (dwarf::Attribute)0, Form, Integer);
207 void DwarfUnit::addString(DIE &Die, dwarf::Attribute Attribute,
211 return addLocalString(Die, Attribute, String);
216 Die.addValue(Attribute, dwarf::DW_FORM_GNU_str_index, Str);
221 void DwarfUnit::addLocalString(DIE &Die, dwarf::Attribute Attribute,
232 Die.addValue(Attribute, dwarf::DW_FORM_strp, Str);
237 void DwarfUnit::addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr) {
239 Die.addValue((dwarf::Attribute)0, Form, Value);
244 void DwarfUnit::addLocationList(DIE &Die, dwarf::Attribute Attribute,
249 Die.addValue(Attribute, Form, Value);
254 void DwarfUnit::addLabel(DIE &Die, dwarf::Attribute Attribute, dwarf::Form Form,
257 Die.addValue(Attribute, Form, Value);
260 void DwarfUnit::addLabel(DIELoc &Die, dwarf::Form Form, const MCSymbol *Label) {
261 addLabel(Die, (dwarf::Attribute)0, Form, Label);
266 void DwarfUnit::addSectionLabel(DIE &Die, dwarf::Attribute Attribute,
269 addLabel(Die, Attribute, dwarf::DW_FORM_sec_offset, Label);
271 addLabel(Die, Attribute, dwarf::DW_FORM_data4, Label);
276 void DwarfUnit::addSectionOffset(DIE &Die, dwarf::Attribute Attribute,
279 addUInt(Die, Attribute, dwarf::DW_FORM_sec_offset, Integer);
281 addUInt(Die, Attribute, dwarf::DW_FORM_data4, Integer);
287 void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute,
291 return addLocalLabelAddress(Die, Attribute, Label);
298 Die.addValue(Attribute, dwarf::DW_FORM_GNU_addr_index, Value);
301 void DwarfCompileUnit::addLocalLabelAddress(DIE &Die,
307 Die.addValue(Attribute, dwarf::DW_FORM_addr,
331 void DwarfUnit::addOpAddress(DIELoc &Die, const MCSymbol *Sym) {
333 addUInt(Die, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
334 addLabel(Die, dwarf::DW_FORM_udata, Sym);
336 addUInt(Die, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_addr_index);
337 addUInt(Die, dwarf::DW_FORM_GNU_addr_index,
344 void DwarfUnit::addSectionDelta(DIE &Die, dwarf::Attribute Attribute,
347 Die.addValue(Attribute, DD->getDwarfVersion() >= 4 ? dwarf::DW_FORM_sec_offset
352 void DwarfUnit::addLabelDelta(DIE &Die, dwarf::Attribute Attribute,
355 Die.addValue(Attribute, dwarf::DW_FORM_data4, Value);
358 /// addDIEEntry - Add a DIE attribute data and value.
360 void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry) {
361 addDIEEntry(Die, Attribute, createDIEEntry(Entry));
364 void DwarfUnit::addDIETypeSignature(DIE &Die, const DwarfTypeUnit &Type) {
369 addFlag(Die, dwarf::DW_AT_declaration);
371 Die.addValue(dwarf::DW_AT_signature, dwarf::DW_FORM_ref_sig8,
375 void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute,
377 const DIE *DieCU = Die.getUnitOrNull();
378 const DIE *EntryCU = Entry->getEntry().getUnitOrNull();
380 // We assume that Die belongs to this CU, if it is not linked to any CU yet.
384 Die.addValue(Attribute,
389 /// Create a DIE with the given Tag, add the DIE to its parent, and
391 DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N) {
394 Parent.addChild(make_unique<DIE>((dwarf::Tag)Tag));
395 DIE &Die = *Parent.getChildren().back();
397 insertDIE(N, &Die);
398 return Die;
403 void DwarfUnit::addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc) {
406 Die.addValue(Attribute, Loc->BestForm(DD->getDwarfVersion()), Loc);
409 void DwarfUnit::addBlock(DIE &Die, dwarf::Attribute Attribute,
413 Die.addValue(Attribute, Block->BestForm(), Block);
418 void DwarfUnit::addSourceLine(DIE &Die, unsigned Line, StringRef File,
425 addUInt(Die, dwarf::DW_AT_decl_file, None, FileID);
426 addUInt(Die, dwarf::DW_AT_decl_line, None, Line);
431 void DwarfUnit::addSourceLine(DIE &Die, DIVariable V) {
434 addSourceLine(Die, V.getLineNumber(), V.getContext().getFilename(),
440 DIE &Die, DIGlobalVariable G) {
443 addSourceLine(Die, G.getLineNumber(), G.getFilename(), G.getDirectory());
448 void DwarfUnit::addSourceLine(DIE &Die, DISubprogram SP) {
451 addSourceLine(Die, SP.getLineNumber(), SP.getFilename(), SP.getDirectory());
456 void DwarfUnit::addSourceLine(DIE &Die, DIType Ty) {
459 addSourceLine(Die, Ty.getLineNumber(), Ty.getFilename(), Ty.getDirectory());
464 void DwarfUnit::addSourceLine(DIE &Die, DIObjCProperty Ty) {
468 addSourceLine(Die, Ty.getLineNumber(), File.getFilename(),
474 void DwarfUnit::addSourceLine(DIE &Die, DINameSpace NS) {
477 addSourceLine(Die, NS.getLineNumber(), NS.getFilename(), NS.getDirectory());
482 void DwarfUnit::addVariableAddress(const DbgVariable &DV, DIE &Die,
485 addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
487 addBlockByrefAddress(DV, Die, dwarf::DW_AT_location, Location);
489 addAddress(Die, dwarf::DW_AT_location, Location,
556 /// addAddress - Add an address attribute to a die based on the location
558 void DwarfUnit::addAddress(DIE &Die, dwarf::Attribute Attribute,
571 // Now attach the location information to the DIE.
572 addBlock(Die, Attribute, Loc);
578 /// from the starting location. Add the DWARF information to the die.
580 void DwarfUnit::addComplexAddress(const DbgVariable &DV, DIE &Die,
609 // Now attach the location information to the DIE.
610 addBlock(Die, Attribute, Loc);
670 /// starting location. Add the DWARF information to the die. For
673 void DwarfUnit::addBlockByrefAddress(const DbgVariable &DV, DIE &Die,
744 // Now attach the location information to the DIE.
745 addBlock(Die, Attribute, Loc);
818 /// addConstantFPValue - Add constant value entry in variable DIE.
819 void DwarfUnit::addConstantFPValue(DIE &Die, const MachineOperand &MO) {
838 addBlock(Die, dwarf::DW_AT_const_value, Block);
841 /// addConstantFPValue - Add constant value entry in variable DIE.
842 void DwarfUnit::addConstantFPValue(DIE &Die, const ConstantFP *CFP) {
844 addConstantValue(Die, CFP->getValueAPF().bitcastToAPInt(), true);
847 /// addConstantValue - Add constant value entry in variable DIE.
848 void DwarfUnit::addConstantValue(DIE &Die, const ConstantInt *CI, DIType Ty) {
849 addConstantValue(Die, CI->getValue(), Ty);
852 /// addConstantValue - Add constant value entry in variable DIE.
853 void DwarfUnit::addConstantValue(DIE &Die, const MachineOperand &MO,
857 addConstantValue(Die, isUnsignedDIType(DD, Ty), MO.getImm());
860 void DwarfUnit::addConstantValue(DIE &Die
863 addUInt(Die, dwarf::DW_AT_const_value,
867 void DwarfUnit::addConstantValue(DIE &Die, const APInt &Val, DIType Ty) {
868 addConstantValue(Die, Val, isUnsignedDIType(DD, Ty));
871 // addConstantValue - Add constant value entry in variable DIE.
872 void DwarfUnit::addConstantValue(DIE &Die, const APInt &Val, bool Unsigned) {
875 addConstantValue(Die, Unsigned,
898 addBlock(Die, dwarf::DW_AT_const_value, Block);
902 void DwarfUnit::addTemplateParams(DIE &Buffer, DIArray TParams) {
915 /// getOrCreateContextDIE - Get context owner's DIE.
916 DIE *DwarfUnit::getOrCreateContextDIE(DIScope Context) {
928 DIE *DwarfUnit::createTypeDIE(DICompositeType Ty) {
930 DIE *ContextDIE = getOrCreateContextDIE(Context);
932 if (DIE *TyDIE = getDIE(Ty))
936 DIE &TyDIE = createAndAddDIE(Ty.getTag(), *ContextDIE, Ty);
944 /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
946 DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
959 // Construct the context before querying for the existence of the DIE in case
960 // such construction creates the DIE.
962 DIE *ContextDIE = getOrCreateContextDIE(Context);
965 if (DIE *TyDIE = getDIE(Ty))
969 DIE &TyDIE = createAndAddDIE(Ty.getTag(), *ContextDIE, Ty);
993 const DIE &TyDIE) {
1014 void DwarfUnit::addType(DIE &Entity, DIType Ty, dwarf::Attribute Attribute) {
1026 DIE *Buffer = getOrCreateTypeDIE(Ty);
1035 void DwarfUnit::addGlobalName(StringRef Name, DIE &Die, DIScope Context) {
1039 GlobalNames[FullName] = &Die;
1084 /// constructTypeDIE - Construct basic type die from DIBasicType.
1085 void DwarfUnit::constructTypeDIE(DIE &Buffer, DIBasicType BTy) {
1103 /// constructTypeDIE - Construct derived type die from DIDerivedType.
1104 void DwarfUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) {
1132 void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) {
1139 DIE &Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer);
1147 /// constructTypeDIE - Construct type DIE from DICompositeType.
1148 void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
1202 DIE &ElemDie = createAndAddDIE(dwarf::DW_TAG_friend, Buffer);
1212 DIE &ElemDie = createAndAddDIE(Property.getTag(), Buffer);
1304 /// constructTemplateTypeParameterDIE - Construct new DIE for the given
1306 void DwarfUnit::constructTemplateTypeParameterDIE(DIE &Buffer,
1308 DIE &ParamDIE =
1317 /// constructTemplateValueParameterDIE - Construct new DIE for the given
1320 DwarfUnit::constructTemplateValueParameterDIE(DIE &Buffer,
1322 DIE &ParamDIE = createAndAddDIE(VP.getTag(), Buffer);
1354 /// getOrCreateNameSpace - Create a DIE for DINameSpace.
1355 DIE *DwarfUnit::getOrCreateNameSpace(DINameSpace NS) {
1356 // Construct the context before querying for the existence of the DIE in case
1357 // such construction creates the DIE.
1358 DIE *ContextDIE = getOrCreateContextDIE(NS.getContext());
1360 if (DIE *NDie = getDIE(NS))
1362 DIE &NDie = createAndAddDIE(dwarf::DW_TAG_namespace, *ContextDIE, NS);
1375 /// getOrCreateSubprogramDIE - Create new DIE using SP.
1376 DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
1377 // Construct the context before querying for the existence of the DIE in case
1378 // such construction creates the DIE (as is the case for member function
1380 DIE *ContextDIE = getOrCreateContextDIE(resolve(SP.getContext()));
1382 if (DIE *SPDie = getDIE(SP))
1386 // Add subprogram definitions to the CU die directly.
1392 // DW_TAG_inlined_subroutine may refer to this DIE.
1393 DIE &SPDie = createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, SP);
1404 void DwarfUnit::applySubprogramAttributesToDefinition(DISubprogram SP, DIE &SPDie) {
1411 void DwarfUnit::applySubprogramAttributes(DISubprogram SP, DIE &SPDie) {
1412 DIE *DeclDie = nullptr;
1416 assert(DeclDie && "This DIE should've already been constructed when the "
1417 "definition DIE was created in "
1518 DIE &VariableDie) {
1555 /// createGlobalVariableDIE - create global variable DIE.
1567 // to the declaration DIE.
1568 DIE *VariableDIE = nullptr;
1573 // We need the declaration DIE that is in the static member's class.
1579 // DIE and add the initial set of attributes to it.
1581 // Construct the context before querying for the existence of the DIE in
1582 // case such construction creates the DIE.
1583 DIE *ContextDIE = getOrCreateContextDIE(GVContext);
1602 DIE *VariableSpecDIE = nullptr;
1633 // Do not create specification DIE if context is either compile unit
1637 // Create specification DIE.
1682 DIE &AddrDIE = VariableSpecDIE ? *VariableSpecDIE : *VariableDIE;
1695 /// constructSubrangeDIE - Construct subrange DIE from DISubrange.
1696 void DwarfUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy) {
1697 DIE &DW_Subrange = createAndAddDIE(dwarf::DW_TAG_subrange_type, Buffer);
1720 /// constructArrayTypeDIE - Construct array type DIE from DICompositeType.
1721 void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType CTy) {
1731 DIE *IdxTy = getIndexTyDie();
1751 /// constructEnumTypeDIE - Construct an enum type DIE from DICompositeType.
1752 void DwarfUnit::constructEnumTypeDIE(DIE &Buffer, DICompositeType CTy) {
1759 DIE &Enumerator = createAndAddDIE(dwarf::DW_TAG_enumerator, Buffer);
1777 for (DenseMap<DIE *, const MDNode *>::iterator CI = ContainingTypeMap.begin(),
1780 DIE &SPDie = *CI->first;
1784 DIE *NDie = getDIE(D);
1791 /// constructVariableDIE - Construct a DIE for the given DbgVariable.
1792 std::unique_ptr<DIE> DwarfUnit::constructVariableDIE(DbgVariable &DV,
1799 std::unique_ptr<DIE> DwarfUnit::constructVariableDIEImpl(const DbgVariable &DV,
1802 auto VariableDie = make_unique<DIE>(DV.getTag());
1853 /// constructMemberDIE - Construct member DIE from DIDerivedType.
1854 void DwarfUnit::constructMemberDIE(DIE &Buffer, DIDerivedType DT) {
1855 DIE &MemberDie = createAndAddDIE(DT.getTag(), Buffer);
1942 /// getOrCreateStaticMemberDIE - Create new DIE for C++ static member.
1943 DIE *DwarfUnit::getOrCreateStaticMemberDIE(DIDerivedType DT) {
1947 // Construct the context before querying for the existence of the DIE in case
1948 // such construction creates the DIE.
1949 DIE *ContextDIE = getOrCreateContextDIE(resolve(DT.getContext()));
1953 if (DIE *StaticMemberDIE = getDIE(DT))
1956 DIE &StaticMemberDIE = createAndAddDIE(DT.getTag(), *ContextDIE, DT);
2042 void DwarfCompileUnit::applyStmtList(DIE &D) {
2052 Asm->OutStreamer.AddComment("Type DIE Offset");
2053 // In a skeleton type unit there is no type DIE so emit a zero offset.