Lines Matching refs:dwarf
44 static dwarf::Tag GetCompileUnitType(UnitKind Kind, DwarfDebug *DW) { in GetCompileUnitType()
52 return dwarf::DW_TAG_skeleton_unit; in GetCompileUnitType()
54 return dwarf::DW_TAG_compile_unit; in GetCompileUnitType()
67 void DwarfCompileUnit::addLabelAddress(DIE &Die, dwarf::Attribute Attribute, in addLabelAddress()
86 DD->getDwarfVersion() >= 5 ? dwarf::DW_FORM_addrx in addLabelAddress()
87 : dwarf::DW_FORM_GNU_addr_index, in addLabelAddress()
100 addBlock(Die, Attribute, dwarf::DW_FORM_exprloc, Loc); in addLabelAddress()
102 addAttribute(Die, Attribute, dwarf::DW_FORM_LLVM_addrx_offset, in addLabelAddress()
108 dwarf::Attribute Attribute, in addLocalLabelAddress()
111 addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIELabel(Label)); in addLocalLabelAddress()
113 addAttribute(Die, Attribute, dwarf::DW_FORM_addr, DIEInteger(0)); in addLocalLabelAddress()
160 addDIEEntry(*VariableDIE, dwarf::DW_AT_specification, *VariableSpecDIE); in getOrCreateGlobalVariableDIE()
170 addString(*VariableDIE, dwarf::DW_AT_name, GV->getDisplayName()); in getOrCreateGlobalVariableDIE()
176 addFlag(*VariableDIE, dwarf::DW_AT_external); in getOrCreateGlobalVariableDIE()
183 addFlag(*VariableDIE, dwarf::DW_AT_declaration); in getOrCreateGlobalVariableDIE()
190 addUInt(*VariableDIE, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata, in getOrCreateGlobalVariableDIE()
273 dwarf::Form Form; in addLocationAttribute()
274 dwarf::LocationAtom Op; in addLocationAttribute()
277 ? FormAndOp{dwarf::DW_FORM_data4, dwarf::DW_OP_const4u} in addLocationAttribute()
278 : FormAndOp{dwarf::DW_FORM_data8, dwarf::DW_OP_const8u}; in addLocationAttribute()
289 addUInt(*Loc, dwarf::DW_FORM_data1, FormAndOp.Op); in addLocationAttribute()
295 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index); in addLocationAttribute()
296 addUInt(*Loc, dwarf::DW_FORM_udata, in addLocationAttribute()
300 addUInt(*Loc, dwarf::DW_FORM_data1, in addLocationAttribute()
301 DD->useGNUTLSOpcode() ? dwarf::DW_OP_GNU_push_tls_address in addLocationAttribute()
302 : dwarf::DW_OP_form_tls_address); in addLocationAttribute()
311 addUInt(*Loc, dwarf::DW_FORM_data1, FormAndOp.Op); in addLocationAttribute()
318 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_breg0 + BaseReg); in addLocationAttribute()
320 addSInt(*Loc, dwarf::DW_FORM_sdata, 0); in addLocationAttribute()
322 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_plus); in addLocationAttribute()
342 addUInt(*VariableDIE, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1, in addLocationAttribute()
346 addBlock(*VariableDIE, dwarf::DW_AT_location, DwarfExpr->finalize()); in addLocationAttribute()
368 DIE &NDie = createAndAddDIE(dwarf::DW_TAG_common_block, *ContextDIE, CB); in getOrCreateCommonBlock()
370 addString(NDie, dwarf::DW_AT_name, Name); in getOrCreateCommonBlock()
419 addSectionLabel(getUnitDie(), dwarf::DW_AT_stmt_list, LineTableStartSym, in initStmtList()
425 addSectionLabel(D, dwarf::DW_AT_stmt_list, LineTableStartSym, in applyStmtList()
436 addLabelAddress(D, dwarf::DW_AT_low_pc, Begin); in attachLowHighPC()
438 addLabelAddress(D, dwarf::DW_AT_high_pc, End); in attachLowHighPC()
440 addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin); in attachLowHighPC()
460 addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr); in updateSubprogramScopeDIE()
471 addAddress(*SPDie, dwarf::DW_AT_frame_base, Location); in updateSubprogramScopeDIE()
477 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_call_frame_cfa); in updateSubprogramScopeDIE()
478 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc); in updateSubprogramScopeDIE()
501 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_WASM_location); in updateSubprogramScopeDIE()
502 addSInt(*Loc, dwarf::DW_FORM_sdata, TI_GLOBAL_RELOC); in updateSubprogramScopeDIE()
504 addLabel(*Loc, dwarf::DW_FORM_data4, SPSym); in updateSubprogramScopeDIE()
510 addUInt(*Loc, dwarf::DW_FORM_data4, FrameBase.Location.WasmLoc.Index); in updateSubprogramScopeDIE()
512 addUInt(*Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_stack_value); in updateSubprogramScopeDIE()
513 addBlock(*SPDie, dwarf::DW_AT_frame_base, Loc); in updateSubprogramScopeDIE()
521 addBlock(*SPDie, dwarf::DW_AT_frame_base, DwarfExpr.finalize()); in updateSubprogramScopeDIE()
590 addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_rnglistx, Index); in addScopeRangeList()
596 addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.Label, in addScopeRangeList()
599 addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, List.Label, in addScopeRangeList()
664 auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_inlined_subroutine); in constructInlinedScopeDIE()
665 addDIEEntry(*ScopeDIE, dwarf::DW_AT_abstract_origin, *OriginDIE); in constructInlinedScopeDIE()
671 addUInt(*ScopeDIE, dwarf::DW_AT_call_file, None, in constructInlinedScopeDIE()
673 addUInt(*ScopeDIE, dwarf::DW_AT_call_line, None, IA->getLine()); in constructInlinedScopeDIE()
675 addUInt(*ScopeDIE, dwarf::DW_AT_call_column, None, IA->getColumn()); in constructInlinedScopeDIE()
677 addUInt(*ScopeDIE, dwarf::DW_AT_GNU_discriminator, None, in constructInlinedScopeDIE()
693 auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_lexical_block); in constructLexicalScopeDIE()
736 addLocationList(*VariableDie, dwarf::DW_AT_location, Index); in constructVariableDIEImpl()
739 addUInt(*VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in constructVariableDIEImpl()
759 addBlock(*VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in constructVariableDIEImpl()
761 addUInt(*VariableDie, dwarf::DW_AT_LLVM_tag_offset, in constructVariableDIEImpl()
762 dwarf::DW_FORM_data1, *DwarfExpr.TagOffset); in constructVariableDIEImpl()
775 addBlock(*VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in constructVariableDIEImpl()
836 addBlock(*VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in constructVariableDIEImpl()
838 addUInt(*VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in constructVariableDIEImpl()
895 addUInt(*VariableDie, dwarf::DW_AT_address_class, dwarf::DW_FORM_data1, in constructVariableDIEImpl()
898 addBlock(*VariableDie, dwarf::DW_AT_location, DwarfExpr.finalize()); in constructVariableDIEImpl()
900 addUInt(*VariableDie, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in constructVariableDIEImpl()
919 if (!Array || Array->getTag() != dwarf::DW_TAG_array_type) in dependencies()
1029 addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, *ObjectPointer); in constructSubprogramScopeDIE()
1041 DIE::get(DIEValueAllocator, dwarf::DW_TAG_unspecified_parameters)); in constructSubprogramScopeDIE()
1124 AbsDef = &ContextCU->createAndAddDIE(dwarf::DW_TAG_subprogram, *ContextDIE, nullptr); in constructAbstractSubprogramScopeDIE()
1126 ContextCU->addSInt(*AbsDef, dwarf::DW_AT_inline, in constructAbstractSubprogramScopeDIE()
1127 DD->getDwarfVersion() <= 4 ? Optional<dwarf::Form>() in constructAbstractSubprogramScopeDIE()
1128 : dwarf::DW_FORM_implicit_const, in constructAbstractSubprogramScopeDIE()
1129 dwarf::DW_INL_inlined); in constructAbstractSubprogramScopeDIE()
1131 ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer); in constructAbstractSubprogramScopeDIE()
1138 dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag(dwarf::Tag Tag) const { in getDwarf5OrGNUTag()
1142 case dwarf::DW_TAG_call_site: in getDwarf5OrGNUTag()
1143 return dwarf::DW_TAG_GNU_call_site; in getDwarf5OrGNUTag()
1144 case dwarf::DW_TAG_call_site_parameter: in getDwarf5OrGNUTag()
1145 return dwarf::DW_TAG_GNU_call_site_parameter; in getDwarf5OrGNUTag()
1151 dwarf::Attribute
1152 DwarfCompileUnit::getDwarf5OrGNUAttr(dwarf::Attribute Attr) const { in getDwarf5OrGNUAttr()
1156 case dwarf::DW_AT_call_all_calls: in getDwarf5OrGNUAttr()
1157 return dwarf::DW_AT_GNU_all_call_sites; in getDwarf5OrGNUAttr()
1158 case dwarf::DW_AT_call_target: in getDwarf5OrGNUAttr()
1159 return dwarf::DW_AT_GNU_call_site_target; in getDwarf5OrGNUAttr()
1160 case dwarf::DW_AT_call_origin: in getDwarf5OrGNUAttr()
1161 return dwarf::DW_AT_abstract_origin; in getDwarf5OrGNUAttr()
1162 case dwarf::DW_AT_call_return_pc: in getDwarf5OrGNUAttr()
1163 return dwarf::DW_AT_low_pc; in getDwarf5OrGNUAttr()
1164 case dwarf::DW_AT_call_value: in getDwarf5OrGNUAttr()
1165 return dwarf::DW_AT_GNU_call_site_value; in getDwarf5OrGNUAttr()
1166 case dwarf::DW_AT_call_tail_call: in getDwarf5OrGNUAttr()
1167 return dwarf::DW_AT_GNU_tail_call; in getDwarf5OrGNUAttr()
1173 dwarf::LocationAtom
1174 DwarfCompileUnit::getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const { in getDwarf5OrGNULocationAtom()
1178 case dwarf::DW_OP_entry_value: in getDwarf5OrGNULocationAtom()
1179 return dwarf::DW_OP_GNU_entry_value; in getDwarf5OrGNULocationAtom()
1192 DIE &CallSiteDIE = createAndAddDIE(getDwarf5OrGNUTag(dwarf::DW_TAG_call_site), in constructCallSiteEntryDIE()
1197 addAddress(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_target), in constructCallSiteEntryDIE()
1202 addDIEEntry(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_origin), in constructCallSiteEntryDIE()
1208 addFlag(CallSiteDIE, getDwarf5OrGNUAttr(dwarf::DW_AT_call_tail_call)); in constructCallSiteEntryDIE()
1223 addLabelAddress(CallSiteDIE, dwarf::DW_AT_call_pc, CallAddr); in constructCallSiteEntryDIE()
1235 getDwarf5OrGNUAttr(dwarf::DW_AT_call_return_pc), PCAddr); in constructCallSiteEntryDIE()
1247 getDwarf5OrGNUTag(dwarf::DW_TAG_call_site_parameter)); in constructCallSiteParmEntryDIEs()
1249 addAddress(*CallSiteDieParam, dwarf::DW_AT_location, in constructCallSiteParmEntryDIEs()
1258 addBlock(*CallSiteDieParam, getDwarf5OrGNUAttr(dwarf::DW_AT_call_value), in constructCallSiteParmEntryDIEs()
1267 DIE *IMDie = DIE::get(DIEValueAllocator, (dwarf::Tag)Module->getTag()); in constructImportedEntityDIE()
1285 addDIEEntry(*IMDie, dwarf::DW_AT_import, *EntityDie); in constructImportedEntityDIE()
1288 addString(*IMDie, dwarf::DW_AT_name, Name); in constructImportedEntityDIE()
1308 addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE); in finishSubprogramDefinition()
1325 addDIEEntry(*Die, dwarf::DW_AT_abstract_origin, *AbsEntity->getDIE()); in finishEntityDefinition()
1338 addLabelAddress(*Die, dwarf::DW_AT_low_pc, Sym); in finishEntityDefinition()
1371 dwarf::UnitType UT = Skeleton ? dwarf::DW_UT_split_compile in emitHeader()
1372 : DD->useSplitDwarf() ? dwarf::DW_UT_skeleton in emitHeader()
1373 : dwarf::DW_UT_compile; in emitHeader()
1375 if (DD->getDwarfVersion() >= 5 && UT != dwarf::DW_UT_compile) in emitHeader()
1441 addComplexAddress(DV, Die, dwarf::DW_AT_location, Location); in addVariableAddress()
1443 addAddress(Die, dwarf::DW_AT_location, Location); in addVariableAddress()
1447 void DwarfCompileUnit::addAddress(DIE &Die, dwarf::Attribute Attribute, in addAddress()
1464 addUInt(Die, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in addAddress()
1473 dwarf::Attribute Attribute, in addComplexAddress()
1495 addUInt(Die, dwarf::DW_AT_LLVM_tag_offset, dwarf::DW_FORM_data1, in addComplexAddress()
1500 void DwarfCompileUnit::addLocationList(DIE &Die, dwarf::Attribute Attribute, in addLocationList()
1502 dwarf::Form Form = (DD->getDwarfVersion() >= 5) in addLocationList()
1503 ? dwarf::DW_FORM_loclistx in addLocationList()
1512 addString(VariableDie, dwarf::DW_AT_name, Name); in applyVariableAttributes()
1516 addUInt(VariableDie, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata, in applyVariableAttributes()
1524 addFlag(VariableDie, dwarf::DW_AT_artificial); in applyVariableAttributes()
1531 addString(LabelDie, dwarf::DW_AT_name, Name); in applyLabelAttributes()
1537 void DwarfCompileUnit::addExpr(DIELoc &Die, dwarf::Form Form, in addExpr()
1539 addAttribute(Die, (dwarf::Attribute)0, Form, DIEExpr(Expr)); in addExpr()
1567 DD->getDwarfVersion() >= 5 ? dwarf::DW_AT_addr_base in addAddrTableBase()
1568 : dwarf::DW_AT_GNU_addr_base, in addAddrTableBase()
1573 addAttribute(Die, (dwarf::Attribute)0, dwarf::DW_FORM_udata, in addBaseTypeRef()
1584 DIE::get(DIEValueAllocator, dwarf::DW_TAG_base_type)); in createBaseTypeDIEs()
1586 addString(Die, dwarf::DW_AT_name, in createBaseTypeDIEs()
1587 Twine(dwarf::AttributeEncodingString(Btr.Encoding) + in createBaseTypeDIEs()
1589 addUInt(Die, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, Btr.Encoding); in createBaseTypeDIEs()
1591 addUInt(Die, dwarf::DW_AT_byte_size, None, divideCeil(Btr.BitSize, 8)); in createBaseTypeDIEs()