Home | History | Annotate | Download | only in dsymutil

Lines Matching refs:Unit

166   /// Get the child of \a Context described by \a DIE in \a Unit. The
176 const DWARFDebugInfoEntryMinimal *DIE, CompileUnit &Unit,
182 /// \brief Stores all information relating to a compile unit, be it in
260 /// Mark every DIE in this unit as kept. This function also
265 /// \brief Compute the end offset for this unit. Must be
267 /// \returns the next unit offset (which is also the current
355 /// functions in this unit, associated with the PC offset to apply
360 /// all the unit's function addresses.
372 /// \brief Accelerator entries for the unit, both for the pub*
385 /// Is this unit subject to the ODR rule?
401 // The root DIE might be null, meaning that the Unit had nothing to
403 // unit header without any actual DIE.
409 /// \brief Keep track of a forward cross-cu reference from this unit
492 /// Unit into \p Sec. The data is provided in \p Names.
494 const CompileUnit &Unit,
513 /// \brief Emit the compilation unit header for \p Unit in the
518 void emitCompileUnitHeader(CompileUnit &Unit);
538 /// \brief Emit debug_aranges entries for \p Unit and if \p
541 void emitUnitRangesEntries(CompileUnit &Unit, bool DoRangesSection);
545 /// \brief Emit the debug_loc contribution for \p Unit by copying
548 void emitLocationsForUnit(const CompileUnit &Unit, DWARFContext &Dwarf);
559 /// \brief Emit the .debug_pubnames contribution for \p Unit.
560 void emitPubNamesForUnit(const CompileUnit &Unit);
562 /// \brief Emit the .debug_pubtypes contribution for \p Unit.
563 void emitPubTypesForUnit(const CompileUnit &Unit);
664 /// \brief Emit the compilation unit header for \p Unit in the
668 /// uint32_t Unit length (omiting this field)
674 void DwarfStreamer::emitCompileUnitHeader(CompileUnit &Unit) {
675 unsigned Version = Unit.getOrigUnit().getVersion();
681 Asm->EmitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset() - 4);
686 Asm->EmitInt8(Unit.getOrigUnit().getAddressByteSize());
750 /// \brief Emit the debug_aranges contribution of a unit and
754 /// Just aggregate all the ranges gathered inside that unit.
755 void DwarfStreamer::emitUnitRangesEntries(CompileUnit &Unit,
757 unsigned AddressSize = Unit.getOrigUnit().getAddressByteSize();
762 const auto &FunctionRanges = Unit.getFunctionRanges();
791 Asm->EmitInt32(Unit.getStartOffset()); // Corresponding unit's offset
817 int64_t PcOffset = -Unit.getLowPc();
833 /// \brief Emit location lists for \p Unit and update attribtues to
835 void DwarfStreamer::emitLocationsForUnit(const CompileUnit &Unit,
837 const auto &Attributes = Unit.getLocationAttributes();
844 unsigned AddressSize = Unit.getOrigUnit().getAddressByteSize();
847 DWARFUnit &OrigUnit = Unit.getOrigUnit();
853 UnitPcOffset = int64_t(OrigLowPc) - Unit.getLowPc();
894 // compilation unit (not including these 4 bytes for the length).
1028 /// Unit into \p Sec. The data is provided in \p Names.
1030 MCSection *Sec, StringRef SecName, const CompileUnit &Unit,
1041 // Emit the pubnames for this compilation unit.
1051 Asm->EmitInt32(Unit.getStartOffset()); // Unit offset
1052 Asm->EmitInt32(Unit.getNextUnitOffset() - Unit.getStartOffset()); // Size
1066 /// \brief Emit .debug_pubnames for \p Unit.
1067 void DwarfStreamer::emitPubNamesForUnit(const CompileUnit &Unit) {
1069 "names", Unit, Unit.getPubnames());
1072 /// \brief Emit .debug_pubtypes for \p Unit.
1073 void DwarfStreamer::emitPubTypesForUnit(const CompileUnit &Unit) {
1075 "types", Unit, Unit.getPubtypes());
1123 void reportWarning(const Twine &Warning, const DWARFUnit *Unit = nullptr,
1204 /// If this compile unit is really a skeleton CU that points to a
1211 const DWARFUnit &Unit, DebugMap &ModuleMap,
1241 CompileUnit &Unit, CompileUnit::DIEInfo &MyInfo,
1246 CompileUnit &Unit,
1251 CompileUnit &Unit,
1284 /// compile unit.
1340 const DWARFFormValue &Val, CompileUnit &Unit);
1353 const CompileUnit &Unit,
1385 /// \brief Compute and emit debug_ranges section for \p Unit, and
1387 void patchRangesForUnit(const CompileUnit &Unit, DWARFContext &Dwarf) const;
1391 void generateUnitRanges(CompileUnit &Unit) const;
1396 void patchLineTableForUnit(CompileUnit &Unit, DWARFContext &OrigDwarf);
1398 /// \brief Emit the accelerator entries for \p Unit.
1399 void emitAcceleratorEntriesForUnit(CompileUnit &Unit);
1432 unsigned UnitID; ///< A unique ID that identifies each compile unit.
1486 const DWARFFormValue &RefValue, const DWARFUnit &Unit,
1489 uint64_t RefOffset = *RefValue.getAsReference(&Unit);
1495 Linker.reportWarning("could not find referenced DIE", &Unit, &DIE);
1732 void DwarfLinker::reportWarning(const Twine &Warning, const DWARFUnit *Unit,
1743 DIE->dump(errs(), const_cast<DWARFUnit *>(Unit), 0 /* RecurseDepth */,
1757 /// gather the child->parent relationships in the original compile unit.
1848 // unit, with 2 notable differences:
1849 // - obviously this one is global, while the other ones are per-unit.
2064 unsigned Offset, const DWARFUnit &Unit) {
2065 DataExtractor Data = Unit.getDebugInfoExtractor();
2068 DWARFFormValue::skipValue(Abbrev->getFormByIndex(i), Data, &Offset, &Unit);
2071 DWARFFormValue::skipValue(Abbrev->getFormByIndex(Idx), Data, &End, &Unit);
2080 CompileUnit &Unit,
2097 const DWARFUnit &OrigUnit = Unit.getOrigUnit();
2121 const DWARFDebugInfoEntryMinimal &DIE, CompileUnit &Unit,
2132 const DWARFUnit &OrigUnit = Unit.getOrigUnit();
2166 Unit.addFunctionRange(LowPc, HighPc, MyInfo.AddrAdjust);
2174 CompileUnit &Unit,
2180 return shouldKeepVariableDIE(RelocMgr, DIE, Unit, MyInfo, Flags);
2182 return shouldKeepSubprogramDIE(RelocMgr, DIE, Unit, MyInfo, Flags);
2207 const DWARFUnit &Unit = CU.getOrigUnit();
2214 lookForDIEsToKeep(RelocMgr, *Unit.getDIEAtIndex(AncestorIdx), DMO, CU,
2221 DataExtractor Data = Unit.getDebugInfoExtractor();
2230 DWARFFormValue::skipValue(AttrSpec.Form, Data, &Offset, &Unit);
2234 Val.extractValue(Data, &Offset, &Unit);
2238 Unit, Die, ReferencedCU)) {
2366 CompileUnit &Unit) {
2367 const DWARFUnit &U = Unit.getOrigUnit();
2404 (Unit.hasODR() && isODRAttribute(AttrSpec.Attr))) {
2407 // to find the unit offset. (We don't have a DwarfDebug)
2421 Unit.noteForwardReference(
2479 const CompileUnit &Unit, AttributesInfo &Info) {
2480 uint64_t Addr = *Val.getAsAddress(&Unit.getOrigUnit());
2491 Addr = Unit.getLowPc();
2498 if (uint64_t HighPc = Unit.getHighPc())
2511 return Unit.getOrigUnit().getAddressByteSize();
2515 DIE &Die, const DWARFDebugInfoEntryMinimal &InputDIE, CompileUnit &Unit,
2521 if (Unit.getLowPc() == -1ULL)
2524 Value = Unit.getHighPc() - Unit.getLowPc();
2534 &Unit.getOrigUnit(), &InputDIE);
2541 Unit.noteRangeAttribute(Die, Patch);
2548 Unit.noteLocationAttribute(Patch, Info.PCOffset);
2559 DIE &Die, const DWARFDebugInfoEntryMinimal &InputDIE, CompileUnit &Unit,
2562 const DWARFUnit &U = Unit.getOrigUnit();
2574 Unit);
2582 return cloneAddressAttribute(Die, AttrSpec, Val, Unit, Info);
2592 return cloneScalarAttribute(Die, InputDIE, Unit, AttrSpec, Val, AttrSize,
2706 const DWARFDebugInfoEntryMinimal &InputDIE, CompileUnit &Unit,
2708 DWARFUnit &U = Unit.getOrigUnit();
2710 CompileUnit::DIEInfo &Info = Unit.getInfo(Idx);
2713 if (!Unit.getInfo(Idx).Keep)
2724 if ((Unit.hasODR() || Unit.isClangModule()) &&
2726 Info.Ctxt != Unit.getInfo(Info.ParentIdx).Ctxt &&
2731 Info.Ctxt->setCanonicalDIEOffset(OutOffset + Unit.getStartOffset());
2738 // DW_TAG_compile_unit without any children, point to the next unit.
2795 copyAbbrev(*InputDIE.getAbbreviationDeclarationPtr(), Unit.hasODR());
2807 cloneAttribute(*Die, InputDIE, Unit, Val, AttrSpec, AttrSize, AttrInfo);
2817 getDIENames(InputDIE, Unit.getOrigUnit(), AttrInfo)) {
2819 Unit.addNameAccelerator(Die, AttrInfo.MangledName,
2823 Unit.addNameAccelerator(Die, AttrInfo.Name, AttrInfo.NameOffset,
2826 getDIENames(InputDIE, Unit.getOrigUnit(), AttrInfo)) {
2827 Unit.addTypeAccelerator(Die, AttrInfo.Name, AttrInfo.NameOffset);
2835 if (Unit.getInfo(Idx).Keep) {
2860 if (DIE *Clone = cloneDIE(*Child, Unit, PCOffset, OutOffset, Flags)) {
2876 void DwarfLinker::patchRangesForUnit(const CompileUnit &Unit,
2879 const auto &FunctionRanges = Unit.getFunctionRanges();
2880 unsigned AddressSize = Unit.getOrigUnit().getAddressByteSize();
2884 DWARFUnit &OrigUnit = Unit.getOrigUnit();
2888 // Ranges addresses are based on the unit's low_pc. Compute the
2889 // offset we need to apply to adapt to the new unit's low_pc.
2892 UnitPcOffset = int64_t(OrigLowPc) - Unit.getLowPc();
2894 for (const auto &RangeAttribute : Unit.getRangesAttributes()) {
2919 /// \brief Generate the debug_aranges entries for \p Unit and if the
2920 /// unit has a DW_AT_ranges attribute, also emit the debug_ranges
2925 void DwarfLinker::generateUnitRanges(CompileUnit &Unit) const {
2926 auto Attr = Unit.getUnitRangesAttribute();
2929 Streamer->emitUnitRangesEntries(Unit, static_cast<bool>(Attr));
2976 /// \brief Extract the line table for \p Unit from \p OrigDwarf, and
2979 void DwarfLinker::patchLineTableForUnit(CompileUnit &Unit,
2981 const DWARFDebugInfoEntryMinimal *CUDie = Unit.getOrigUnit().getUnitDIE();
2983 &Unit.getOrigUnit(), dwarf::DW_AT_stmt_list, -1ULL);
2988 if (auto *OutputDIE = Unit.getOutputUnitDIE())
2991 // Parse the original line info for the unit.
2996 Unit.getOrigUnit().getAddressByteSize());
3007 const auto &FunctionRanges = Unit.getFunctionRanges();
3104 Unit.getOrigUnit().getAddressByteSize());
3108 void DwarfLinker::emitAcceleratorEntriesForUnit(CompileUnit &Unit) {
3109 Streamer->emitPubNamesForUnit(Unit);
3110 Streamer->emitPubTypesForUnit(Unit);
3214 const DWARFUnit &Unit) {
3216 CUDie.getAttributeValueAsUnsignedConstant(&Unit, dwarf::DW_AT_dwo_id, 0);
3218 DwoId = CUDie.getAttributeValueAsUnsignedConstant(&Unit,
3224 const DWARFDebugInfoEntryMinimal &CUDie, const DWARFUnit &Unit,
3227 CUDie.getAttributeValueAsString(&Unit, dwarf::DW_AT_dwo_name, "");
3230 CUDie.getAttributeValueAsString(&Unit, dwarf::DW_AT_GNU_dwo_name, "");
3236 CUDie.getAttributeValueAsString(&Unit, dwarf::DW_AT_comp_dir, "");
3237 uint64_t DwoId = getDwoId(CUDie, Unit);
3240 CUDie.getAttributeValueAsString(&Unit, dwarf::DW_AT_name, "");
3335 std::unique_ptr<CompileUnit> Unit;
3344 if (Unit) {
3346 << " 1 compile unit.\n";
3363 Unit = llvm::make_unique<CompileUnit>(*CU, UnitID++, !Options.NoODR,
3365 Unit->setHasInterestingContent();
3366 analyzeContextInfo(CUDie, 0, *Unit, &ODRContexts.getRoot(), StringPool,
3369 Unit->markEverythingAsKept();
3377 DIECloner(*this, RelocMgr, DIEAlloc, MutableArrayRef<CompileUnit>(*Unit),
3391 11 /* Unit Header size */, 0);
3397 // an empty line table for the unit, even if the unit doesn't
3410 // Emit all the compile unit's debug information.
3428 // A unique ID that identifies each compile unit.
3457 outs() << "Input compilation unit:";