Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
DWARFLinkerCompileUnit.h
Go to the documentation of this file.
1//===- DWARFLinkerCompileUnit.h ---------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_DWARFLINKER_PARALLEL_DWARFLINKERCOMPILEUNIT_H
10#define LLVM_LIB_DWARFLINKER_PARALLEL_DWARFLINKERCOMPILEUNIT_H
11
12#include "DWARFLinkerUnit.h"
13#include "llvm/DWARFLinker/DWARFFile.h"
14#include <optional>
15
16namespacellvm {
17namespacedwarf_linker {
18namespaceparallel {
19
20usingOffsetToUnitTy =function_ref<CompileUnit *(uint64_tOffset)>;
21
22structAttributesInfo;
23classSyntheticTypeNameBuilder;
24classDIEGenerator;
25classTypeUnit;
26classDependencyTracker;
27
28classCompileUnit;
29
30/// This is a helper structure which keeps a debug info entry
31/// with it's containing compilation unit.
32structUnitEntryPairTy {
33UnitEntryPairTy() =default;
34UnitEntryPairTy(CompileUnit *CU,constDWARFDebugInfoEntry *DieEntry)
35 :CU(CU),DieEntry(DieEntry) {}
36
37CompileUnit *CU =nullptr;
38constDWARFDebugInfoEntry *DieEntry =nullptr;
39
40UnitEntryPairTygetNamespaceOrigin();
41 std::optional<UnitEntryPairTy>getParent();
42};
43
44enumResolveInterCUReferencesMode :bool {
45Resolve =true,
46AvoidResolving =false,
47};
48
49/// Stores all information related to a compile unit, be it in its original
50/// instance of the object file or its brand new cloned and generated DIE tree.
51/// NOTE: we need alignment of at least 8 bytes as we use
52/// PointerIntPair<CompileUnit *, 3> in the DependencyTracker.h
53classalignas(8)CompileUnit :publicDwarfUnit {
54public:
55 /// The stages of new compile unit processing.
56enum classStage :uint8_t {
57 /// Created, linked with input DWARF file.
58CreatedNotLoaded = 0,
59
60 /// Input DWARF is loaded.
61Loaded,
62
63 /// Input DWARF is analysed(DIEs pointing to the real code section are
64 /// discovered, type names are assigned if ODR is requested).
65LivenessAnalysisDone,
66
67 /// Check if dependencies have incompatible placement.
68 /// If that is the case modify placement to be compatible.
69UpdateDependenciesCompleteness,
70
71 /// Type names assigned to DIEs.
72TypeNamesAssigned,
73
74 /// Output DWARF is generated.
75Cloned,
76
77 /// Offsets inside patch records are updated.
78PatchesUpdated,
79
80 /// Resources(Input DWARF, Output DWARF tree) are released.
81Cleaned,
82
83 /// Compile Unit should be skipped
84Skipped
85 };
86
87CompileUnit(LinkingGlobalData &GlobalData,unsignedID,
88StringRefClangModuleName,DWARFFile &File,
89OffsetToUnitTy UnitFromOffset,dwarf::FormParamsFormat,
90llvm::endianness Endianess);
91
92CompileUnit(LinkingGlobalData &GlobalData,DWARFUnit &OrigUnit,unsignedID,
93StringRefClangModuleName,DWARFFile &File,
94OffsetToUnitTy UnitFromOffset,dwarf::FormParamsFormat,
95llvm::endianness Endianess);
96
97 /// Returns stage of overall processing.
98StagegetStage() const{returnStage; }
99
100 /// Set stage of overall processing.
101voidsetStage(StageStage) { this->Stage =Stage; }
102
103 /// Loads unit line table.
104voidloadLineTable();
105
106 /// Returns name of the file for the \p FileIdx
107 /// from the unit`s line table.
108StringEntry *getFileName(unsigned FileIdx,StringPool &GlobalStrings);
109
110 /// Returns DWARFFile containing this compile unit.
111constDWARFFile &getContaingFile() const{return File; }
112
113 /// Load DIEs of input compilation unit. \returns true if input DIEs
114 /// successfully loaded.
115boolloadInputDIEs();
116
117 /// Reset compile units data(results of liveness analysis, clonning)
118 /// if current stage greater than Stage::Loaded. We need to reset data
119 /// as we are going to repeat stages.
120voidmaybeResetToLoadedStage();
121
122 /// Collect references to parseable Swift interfaces in imported
123 /// DW_TAG_module blocks.
124voidanalyzeImportedModule(constDWARFDebugInfoEntry *DieEntry);
125
126 /// Navigate DWARF tree and set die properties.
127voidanalyzeDWARFStructure() {
128 analyzeDWARFStructureRec(getUnitDIE().getDebugInfoEntry(),false);
129 }
130
131 /// Cleanup unneeded resources after compile unit is cloned.
132voidcleanupDataAfterClonning();
133
134 /// After cloning stage the output DIEs offsets are deallocated.
135 /// This method copies output offsets for referenced DIEs into DIEs patches.
136voidupdateDieRefPatchesWithClonedOffsets();
137
138 /// Search for subprograms and variables referencing live code and discover
139 /// dependend DIEs. Mark live DIEs, set placement for DIEs.
140boolresolveDependenciesAndMarkLiveness(
141bool InterCUProcessingStarted,
142 std::atomic<bool> &HasNewInterconnectedCUs);
143
144 /// Check dependend DIEs for incompatible placement.
145 /// Make placement to be consistent.
146boolupdateDependenciesCompleteness();
147
148 /// Check DIEs to have a consistent marking(keep marking, placement marking).
149voidverifyDependencies();
150
151 /// Search for type entries and assign names.
152ErrorassignTypeNames(TypePool &TypePoolRef);
153
154 /// Kinds of placement for the output die.
155enumDieOutputPlacement :uint8_t {
156NotSet = 0,
157
158 /// Corresponding DIE goes to the type table only.
159TypeTable = 1,
160
161 /// Corresponding DIE goes to the plain dwarf only.
162PlainDwarf = 2,
163
164 /// Corresponding DIE goes to type table and to plain dwarf.
165Both = 3,
166 };
167
168 /// Information gathered about source DIEs.
169structDIEInfo {
170DIEInfo() =default;
171DIEInfo(constDIEInfo &Other) {Flags =Other.Flags.load(); }
172DIEInfo &operator=(constDIEInfo &Other) {
173Flags =Other.Flags.load();
174return *this;
175 }
176
177 /// Data member keeping various flags.
178 std::atomic<uint16_t>Flags = {0};
179
180 /// \returns Placement kind for the corresponding die.
181DieOutputPlacementgetPlacement() const{
182returnDieOutputPlacement(Flags & 0x7);
183 }
184
185 /// Sets Placement kind for the corresponding die.
186voidsetPlacement(DieOutputPlacementPlacement) {
187auto InputData =Flags.load();
188while (!Flags.compare_exchange_weak(InputData,
189 ((InputData & ~0x7) |Placement))) {
190 }
191 }
192
193 /// Unsets Placement kind for the corresponding die.
194voidunsetPlacement() {
195auto InputData =Flags.load();
196while (!Flags.compare_exchange_weak(InputData, (InputData & ~0x7))) {
197 }
198 }
199
200 /// Sets Placement kind for the corresponding die.
201boolsetPlacementIfUnset(DieOutputPlacementPlacement) {
202auto InputData =Flags.load();
203if ((InputData & 0x7) ==NotSet)
204if (Flags.compare_exchange_weak(InputData, (InputData |Placement)))
205returntrue;
206
207returnfalse;
208 }
209
210#define SINGLE_FLAG_METHODS_SET(Name, Value) \
211 bool get##Name() const { return Flags & Value; } \
212 void set##Name() { \
213 auto InputData = Flags.load(); \
214 while (!Flags.compare_exchange_weak(InputData, InputData | Value)) { \
215 } \
216 } \
217 void unset##Name() { \
218 auto InputData = Flags.load(); \
219 while (!Flags.compare_exchange_weak(InputData, InputData & ~Value)) { \
220 } \
221 }
222
223 /// DIE is a part of the linked output.
224SINGLE_FLAG_METHODS_SET(Keep, 0x08)
225
226/// DIE has children which are part of the linked output.
227SINGLE_FLAG_METHODS_SET(KeepPlainChildren, 0x10)
228
229 /// DIE has children which are part of the type table.
230SINGLE_FLAG_METHODS_SET(KeepTypeChildren, 0x20)
231
232 /// DIE is in module scope.
233SINGLE_FLAG_METHODS_SET(IsInMouduleScope, 0x40)
234
235 /// DIE is in function scope.
236SINGLE_FLAG_METHODS_SET(IsInFunctionScope, 0x80)
237
238 /// DIE is in anonymous namespace scope.
239SINGLE_FLAG_METHODS_SET(IsInAnonNamespaceScope, 0x100)
240
241 /// DIE is available for ODR type deduplication.
242SINGLE_FLAG_METHODS_SET(ODRAvailable, 0x200)
243
244 /// Track liveness for the DIE.
245SINGLE_FLAG_METHODS_SET(TrackLiveness, 0x400)
246
247 /// Track liveness for the DIE.
248SINGLE_FLAG_METHODS_SET(HasAnAddress, 0x800)
249
250voidunsetFlagsWhichSetDuringLiveAnalysis() {
251auto InputData =Flags.load();
252while (!Flags.compare_exchange_weak(
253 InputData, InputData & ~(0x7 | 0x8 | 0x10 | 0x20))) {
254 }
255 }
256
257 /// Erase all flags.
258voideraseData() {Flags = 0; }
259
260#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
261LLVM_DUMP_METHODvoiddump();
262#endif
263
264boolneedToPlaceInTypeTable() const{
265return (getKeep() && (getPlacement() ==CompileUnit::TypeTable ||
266getPlacement() ==CompileUnit::Both)) ||
267 getKeepTypeChildren();
268 }
269
270boolneedToKeepInPlainDwarf() const{
271return (getKeep() && (getPlacement() ==CompileUnit::PlainDwarf ||
272getPlacement() ==CompileUnit::Both)) ||
273 getKeepPlainChildren();
274 }
275 };
276
277 /// \defgroup Group of functions returning DIE info.
278 ///
279 /// @{
280
281 /// \p Idx index of the DIE.
282 /// \returns DieInfo descriptor.
283DIEInfo &getDIEInfo(unsignedIdx) {return DieInfoArray[Idx]; }
284
285 /// \p Idx index of the DIE.
286 /// \returns DieInfo descriptor.
287constDIEInfo &getDIEInfo(unsignedIdx) const{return DieInfoArray[Idx]; }
288
289 /// \p Idx index of the DIE.
290 /// \returns DieInfo descriptor.
291DIEInfo &getDIEInfo(constDWARFDebugInfoEntry *Entry) {
292return DieInfoArray[getOrigUnit().getDIEIndex(Entry)];
293 }
294
295 /// \p Idx index of the DIE.
296 /// \returns DieInfo descriptor.
297constDIEInfo &getDIEInfo(constDWARFDebugInfoEntry *Entry) const{
298return DieInfoArray[getOrigUnit().getDIEIndex(Entry)];
299 }
300
301 /// \p Die
302 /// \returns PlainDieInfo descriptor.
303DIEInfo &getDIEInfo(constDWARFDie &Die) {
304return DieInfoArray[getOrigUnit().getDIEIndex(Die)];
305 }
306
307 /// \p Die
308 /// \returns PlainDieInfo descriptor.
309constDIEInfo &getDIEInfo(constDWARFDie &Die) const{
310return DieInfoArray[getOrigUnit().getDIEIndex(Die)];
311 }
312
313 /// \p Idx index of the DIE.
314 /// \returns DieInfo descriptor.
315uint64_tgetDieOutOffset(uint32_tIdx) {
316returnreinterpret_cast<std::atomic<uint64_t> *>(&OutDieOffsetArray[Idx])
317 ->load();
318 }
319
320 /// \p Idx index of the DIE.
321 /// \returns type entry.
322TypeEntry *getDieTypeEntry(uint32_tIdx) {
323returnreinterpret_cast<std::atomic<TypeEntry *> *>(&TypeEntries[Idx])
324 ->load();
325 }
326
327 /// \p InputDieEntry debug info entry.
328 /// \returns DieInfo descriptor.
329uint64_tgetDieOutOffset(constDWARFDebugInfoEntry *InputDieEntry) {
330returnreinterpret_cast<std::atomic<uint64_t> *>(
331 &OutDieOffsetArray[getOrigUnit().getDIEIndex(InputDieEntry)])
332 ->load();
333 }
334
335 /// \p InputDieEntry debug info entry.
336 /// \returns type entry.
337TypeEntry *getDieTypeEntry(constDWARFDebugInfoEntry *InputDieEntry) {
338returnreinterpret_cast<std::atomic<TypeEntry *> *>(
339 &TypeEntries[getOrigUnit().getDIEIndex(InputDieEntry)])
340 ->load();
341 }
342
343 /// \p Idx index of the DIE.
344 /// \returns DieInfo descriptor.
345voidrememberDieOutOffset(uint32_tIdx,uint64_tOffset) {
346reinterpret_cast<std::atomic<uint64_t> *>(&OutDieOffsetArray[Idx])
347 ->store(Offset);
348 }
349
350 /// \p Idx index of the DIE.
351 /// \p Type entry.
352voidsetDieTypeEntry(uint32_tIdx,TypeEntry *Entry) {
353reinterpret_cast<std::atomic<TypeEntry *> *>(&TypeEntries[Idx])
354 ->store(Entry);
355 }
356
357 /// \p InputDieEntry debug info entry.
358 /// \p Type entry.
359voidsetDieTypeEntry(constDWARFDebugInfoEntry *InputDieEntry,
360TypeEntry *Entry) {
361reinterpret_cast<std::atomic<TypeEntry *> *>(
362 &TypeEntries[getOrigUnit().getDIEIndex(InputDieEntry)])
363 ->store(Entry);
364 }
365
366 /// @}
367
368 /// Returns value of DW_AT_low_pc attribute.
369 std::optional<uint64_t>getLowPc() const{return LowPc; }
370
371 /// Returns value of DW_AT_high_pc attribute.
372uint64_tgetHighPc() const{return HighPc; }
373
374 /// Returns true if there is a label corresponding to the specified \p Addr.
375boolhasLabelAt(uint64_tAddr) const{return Labels.count(Addr); }
376
377 /// Add the low_pc of a label that is relocated by applying
378 /// offset \p PCOffset.
379voidaddLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset);
380
381 /// Resolve the DIE attribute reference that has been extracted in \p
382 /// RefValue. The resulting DIE might be in another CompileUnit.
383 /// \returns referenced die and corresponding compilation unit.
384 /// compilation unit is null if reference could not be resolved.
385 std::optional<UnitEntryPairTy>
386resolveDIEReference(constDWARFFormValue &RefValue,
387ResolveInterCUReferencesMode CanResolveInterCUReferences);
388
389 std::optional<UnitEntryPairTy>
390resolveDIEReference(constDWARFDebugInfoEntry *DieEntry,
391dwarf::Attribute Attr,
392ResolveInterCUReferencesMode CanResolveInterCUReferences);
393
394 /// @}
395
396 /// Add a function range [\p LowPC, \p HighPC) that is relocated by applying
397 /// offset \p PCOffset.
398voidaddFunctionRange(uint64_t LowPC,uint64_t HighPC, int64_t PCOffset);
399
400 /// Returns function ranges of this unit.
401constRangesTy &getFunctionRanges() const{return Ranges; }
402
403 /// Clone and emit this compilation unit.
404Error
405cloneAndEmit(std::optional<std::reference_wrapper<const Triple>> TargetTriple,
406TypeUnit *ArtificialTypeUnit);
407
408 /// Clone and emit debug locations(.debug_loc/.debug_loclists).
409ErrorcloneAndEmitDebugLocations();
410
411 /// Clone and emit ranges.
412ErrorcloneAndEmitRanges();
413
414 /// Clone and emit debug macros(.debug_macinfo/.debug_macro).
415ErrorcloneAndEmitDebugMacro();
416
417// Clone input DIE entry.
418 std::pair<DIE *, TypeEntry *>
419cloneDIE(constDWARFDebugInfoEntry *InputDieEntry,
420TypeEntry *ClonedParentTypeDIE,uint64_t OutOffset,
421 std::optional<int64_t> FuncAddressAdjustment,
422 std::optional<int64_t> VarAddressAdjustment,
423BumpPtrAllocator &Allocator,TypeUnit *ArtificialTypeUnit);
424
425// Clone and emit line table.
426ErrorcloneAndEmitLineTable(constTriple &TargetTriple);
427
428 /// Clone attribute location axpression.
429voidcloneDieAttrExpression(constDWARFExpression &InputExpression,
430SmallVectorImpl<uint8_t> &OutputExpression,
431SectionDescriptor &Section,
432 std::optional<int64_t> VarAddressAdjustment,
433OffsetsPtrVector &PatchesOffsets);
434
435 /// Returns index(inside .debug_addr) of an address.
436uint64_tgetDebugAddrIndex(uint64_tAddr) {
437return DebugAddrIndexMap.getValueIndex(Addr);
438 }
439
440 /// Returns directory and file from the line table by index.
441 std::optional<std::pair<StringRef, StringRef>>
442getDirAndFilenameFromLineTable(constDWARFFormValue &FileIdxValue);
443
444 /// Returns directory and file from the line table by index.
445 std::optional<std::pair<StringRef, StringRef>>
446getDirAndFilenameFromLineTable(uint64_t FileIdx);
447
448 /// \defgroup Helper methods to access OrigUnit.
449 ///
450 /// @{
451
452 /// Returns paired compile unit from input DWARF.
453DWARFUnit &getOrigUnit() const{
454assert(OrigUnit !=nullptr);
455return *OrigUnit;
456 }
457
458constDWARFDebugInfoEntry *
459getFirstChildEntry(constDWARFDebugInfoEntry *Die) const{
460assert(OrigUnit !=nullptr);
461return OrigUnit->getFirstChildEntry(Die);
462 }
463
464constDWARFDebugInfoEntry *
465getSiblingEntry(constDWARFDebugInfoEntry *Die) const{
466assert(OrigUnit !=nullptr);
467return OrigUnit->getSiblingEntry(Die);
468 }
469
470DWARFDiegetParent(constDWARFDebugInfoEntry *Die) {
471assert(OrigUnit !=nullptr);
472return OrigUnit->getParent(Die);
473 }
474
475DWARFDiegetDIEAtIndex(unsignedIndex) {
476assert(OrigUnit !=nullptr);
477return OrigUnit->getDIEAtIndex(Index);
478 }
479
480constDWARFDebugInfoEntry *getDebugInfoEntry(unsignedIndex) const{
481assert(OrigUnit !=nullptr);
482return OrigUnit->getDebugInfoEntry(Index);
483 }
484
485DWARFDiegetUnitDIE(bool ExtractUnitDIEOnly =true) {
486assert(OrigUnit !=nullptr);
487return OrigUnit->getUnitDIE(ExtractUnitDIEOnly);
488 }
489
490DWARFDiegetDIE(constDWARFDebugInfoEntry *Die) {
491assert(OrigUnit !=nullptr);
492returnDWARFDie(OrigUnit, Die);
493 }
494
495uint32_tgetDIEIndex(constDWARFDebugInfoEntry *Die) const{
496assert(OrigUnit !=nullptr);
497return OrigUnit->getDIEIndex(Die);
498 }
499
500uint32_tgetDIEIndex(constDWARFDie &Die) const{
501assert(OrigUnit !=nullptr);
502return OrigUnit->getDIEIndex(Die);
503 }
504
505 std::optional<DWARFFormValue>find(uint32_t DieIdx,
506ArrayRef<dwarf::Attribute> Attrs) const{
507assert(OrigUnit !=nullptr);
508returnfind(OrigUnit->getDebugInfoEntry(DieIdx), Attrs);
509 }
510
511 std::optional<DWARFFormValue>find(constDWARFDebugInfoEntry *Die,
512ArrayRef<dwarf::Attribute> Attrs) const{
513if (!Die)
514return std::nullopt;
515auto AbbrevDecl = Die->getAbbreviationDeclarationPtr();
516if (AbbrevDecl) {
517for (auto Attr : Attrs) {
518if (autoValue = AbbrevDecl->getAttributeValue(Die->getOffset(), Attr,
519 *OrigUnit))
520returnValue;
521 }
522 }
523return std::nullopt;
524 }
525
526 std::optional<uint32_t>getDIEIndexForOffset(uint64_tOffset) {
527return OrigUnit->getDIEIndexForOffset(Offset);
528 }
529
530 /// @}
531
532 /// \defgroup Methods used for reporting warnings and errors:
533 ///
534 /// @{
535
536voidwarn(constTwine &Warning,constDWARFDie *DIE =nullptr) {
537GlobalData.warn(Warning,getUnitName(),DIE);
538 }
539
540voidwarn(ErrorWarning,constDWARFDie *DIE =nullptr) {
541handleAllErrors(std::move(Warning), [&](ErrorInfoBase &Info) {
542GlobalData.warn(Info.message(),getUnitName(),DIE);
543 });
544 }
545
546voidwarn(constTwine &Warning,constDWARFDebugInfoEntry *DieEntry) {
547if (DieEntry !=nullptr) {
548DWARFDieDIE(&getOrigUnit(), DieEntry);
549GlobalData.warn(Warning,getUnitName(), &DIE);
550return;
551 }
552
553GlobalData.warn(Warning,getUnitName());
554 }
555
556voiderror(constTwine &Err,constDWARFDie *DIE =nullptr) {
557GlobalData.warn(Err,getUnitName(),DIE);
558 }
559
560voiderror(Error Err,constDWARFDie *DIE =nullptr) {
561handleAllErrors(std::move(Err), [&](ErrorInfoBase &Info) {
562GlobalData.error(Info.message(),getUnitName(),DIE);
563 });
564 }
565
566 /// @}
567
568 /// Save specified accelerator info \p Info.
569voidsaveAcceleratorInfo(constDwarfUnit::AccelInfo &Info) {
570 AcceleratorRecords.add(Info);
571 }
572
573 /// Enumerates all units accelerator records.
574void
575forEachAcceleratorRecord(function_ref<void(AccelInfo &)> Handler) override{
576 AcceleratorRecords.forEach(Handler);
577 }
578
579 /// Output unit selector.
580classOutputUnitVariantPtr {
581public:
582OutputUnitVariantPtr(CompileUnit *U);
583OutputUnitVariantPtr(TypeUnit *U);
584
585 /// Accessor for common functionality.
586DwarfUnit *operator->();
587
588boolisCompileUnit();
589
590boolisTypeUnit();
591
592 /// Returns CompileUnit if applicable.
593CompileUnit *getAsCompileUnit();
594
595 /// Returns TypeUnit if applicable.
596TypeUnit *getAsTypeUnit();
597
598protected:
599PointerUnion<CompileUnit *, TypeUnit *>Ptr;
600 };
601
602private:
603 /// Navigate DWARF tree recursively and set die properties.
604void analyzeDWARFStructureRec(constDWARFDebugInfoEntry *DieEntry,
605bool IsODRUnavailableFunctionScope);
606
607structLinkedLocationExpressionsWithOffsetPatches {
608DWARFLocationExpressionExpression;
609OffsetsPtrVector Patches;
610 };
611usingLinkedLocationExpressionsVector =
612SmallVector<LinkedLocationExpressionsWithOffsetPatches>;
613
614 /// Emit debug locations.
615void emitLocations(DebugSectionKind LocationSectionKind);
616
617 /// Emit location list header.
618uint64_t emitLocListHeader(SectionDescriptor &OutLocationSection);
619
620 /// Emit location list fragment.
621uint64_t emitLocListFragment(
622const LinkedLocationExpressionsVector &LinkedLocationExpression,
623SectionDescriptor &OutLocationSection);
624
625 /// Emit the .debug_addr section fragment for current unit.
626Error emitDebugAddrSection();
627
628 /// Emit .debug_aranges.
629void emitAranges(AddressRanges &LinkedFunctionRanges);
630
631 /// Clone and emit .debug_ranges/.debug_rnglists.
632void cloneAndEmitRangeList(DebugSectionKind RngSectionKind,
633AddressRanges &LinkedFunctionRanges);
634
635 /// Emit range list header.
636uint64_t emitRangeListHeader(SectionDescriptor &OutRangeSection);
637
638 /// Emit range list fragment.
639void emitRangeListFragment(constAddressRanges &LinkedRanges,
640SectionDescriptor &OutRangeSection);
641
642 /// Insert the new line info sequence \p Seq into the current
643 /// set of already linked line info \p Rows.
644void insertLineSequence(std::vector<DWARFDebugLine::Row> &Seq,
645 std::vector<DWARFDebugLine::Row> &Rows);
646
647 /// Emits body for both macro sections.
648void emitMacroTableImpl(constDWARFDebugMacro *MacroTable,
649uint64_t OffsetToMacroTable,bool hasDWARFv5Header);
650
651 /// Creates DIE which would be placed into the "Plain" compile unit.
652DIE *createPlainDIEandCloneAttributes(
653constDWARFDebugInfoEntry *InputDieEntry,DIEGenerator &PlainDIEGenerator,
654uint64_t &OutOffset, std::optional<int64_t> &FuncAddressAdjustment,
655 std::optional<int64_t> &VarAddressAdjustment);
656
657 /// Creates DIE which would be placed into the "Type" compile unit.
658TypeEntry *createTypeDIEandCloneAttributes(
659constDWARFDebugInfoEntry *InputDieEntry,DIEGenerator &TypeDIEGenerator,
660TypeEntry *ClonedParentTypeDIE,TypeUnit *ArtificialTypeUnit);
661
662 /// Create output DIE inside specified \p TypeDescriptor.
663DIE *allocateTypeDie(TypeEntryBody *TypeDescriptor,
664DIEGenerator &TypeDIEGenerator,dwarf::Tag DieTag,
665bool IsDeclaration,bool IsParentDeclaration);
666
667 /// Enumerate \p DieEntry children and assign names for them.
668Error assignTypeNamesRec(constDWARFDebugInfoEntry *DieEntry,
669SyntheticTypeNameBuilder &NameBuilder);
670
671 /// DWARFFile containing this compile unit.
672DWARFFile &File;
673
674 /// Pointer to the paired compile unit from the input DWARF.
675DWARFUnit *OrigUnit =nullptr;
676
677 /// The DW_AT_language of this unit.
678 std::optional<uint16_t> Language;
679
680 /// Line table for this unit.
681constDWARFDebugLine::LineTable *LineTablePtr =nullptr;
682
683 /// Cached resolved paths from the line table.
684 /// The key is <UniqueUnitID, FileIdx>.
685usingResolvedPathsMap =DenseMap<unsigned, StringEntry *>;
686 ResolvedPathsMap ResolvedFullPaths;
687StringMap<StringEntry *> ResolvedParentPaths;
688
689 /// Maps an address into the index inside .debug_addr section.
690IndexedValuesMap<uint64_t> DebugAddrIndexMap;
691
692 std::unique_ptr<DependencyTracker> Dependencies;
693
694 /// \defgroup Data Members accessed asinchronously.
695 ///
696 /// @{
697OffsetToUnitTy getUnitFromOffset;
698
699 std::optional<uint64_t> LowPc;
700uint64_t HighPc = 0;
701
702 /// Flag indicating whether type de-duplication is forbidden.
703bool NoODR =true;
704
705 /// The ranges in that map are the PC ranges for functions in this unit,
706 /// associated with the PC offset to apply to the addresses to get
707 /// the linked address.
708RangesTy Ranges;
709 std::mutex RangesMutex;
710
711 /// The DW_AT_low_pc of each DW_TAG_label.
712usingLabelMapTy =SmallDenseMap<uint64_t, uint64_t, 1>;
713 LabelMapTy Labels;
714 std::mutex LabelsMutex;
715
716 /// This field keeps current stage of overall compile unit processing.
717 std::atomic<Stage>Stage;
718
719 /// DIE info indexed by DIE index.
720SmallVector<DIEInfo> DieInfoArray;
721SmallVector<uint64_t> OutDieOffsetArray;
722SmallVector<TypeEntry *> TypeEntries;
723
724 /// The list of accelerator records for this unit.
725ArrayList<AccelInfo> AcceleratorRecords;
726 /// @}
727};
728
729/// \returns list of attributes referencing type DIEs which might be
730/// deduplicated.
731/// Note: it does not include DW_AT_containing_type attribute to avoid
732/// infinite recursion.
733ArrayRef<dwarf::Attribute>getODRAttributes();
734
735}// end of namespace parallel
736}// end of namespace dwarf_linker
737}// end of namespace llvm
738
739#endif// LLVM_LIB_DWARFLINKER_PARALLEL_DWARFLINKERCOMPILEUNIT_H
load
AMDGPU Mark last scratch load
Definition:AMDGPUMarkLastScratchLoad.cpp:142
Info
Analysis containing CSE Info
Definition:CSEInfo.cpp:27
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition:Compiler.h:622
DWARFFile.h
DWARFLinkerUnit.h
Idx
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
Definition:DeadArgumentElimination.cpp:353
Addr
uint64_t Addr
Definition:ELFObjHandler.cpp:79
Index
uint32_t Index
Definition:ELFObjHandler.cpp:83
Placement
Branch Probability Basic Block Placement
Definition:MachineBlockPlacement.cpp:651
Allocator
Basic Register Allocator
Definition:RegAllocBasic.cpp:146
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::AddressRangesMap
AddressRangesMap class maps values to the address ranges.
Definition:AddressRanges.h:165
llvm::AddressRanges
The AddressRanges class helps normalize address range collections.
Definition:AddressRanges.h:121
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition:ArrayRef.h:41
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition:Allocator.h:66
llvm::DIE
A structured debug information entry.
Definition:DIE.h:819
llvm::DWARFDebugInfoEntry
DWARFDebugInfoEntry - A DIE with only the minimum required data.
Definition:DWARFDebugInfoEntry.h:22
llvm::DWARFDebugInfoEntry::getOffset
uint64_t getOffset() const
Definition:DWARFDebugInfoEntry.h:45
llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Definition:DWARFDebugInfoEntry.h:72
llvm::DWARFDebugMacro
Definition:DWARFDebugMacro.h:28
llvm::DWARFDie
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition:DWARFDie.h:42
llvm::DWARFExpression
Definition:DWARFExpression.h:23
llvm::DWARFFormValue
Definition:DWARFFormValue.h:26
llvm::DWARFUnit
Definition:DWARFUnit.h:211
llvm::DWARFUnit::getDebugInfoEntry
const DWARFDebugInfoEntry * getDebugInfoEntry(unsigned Index) const
Return DWARFDebugInfoEntry for the specified index Index.
Definition:DWARFUnit.h:276
llvm::DWARFUnit::getSiblingEntry
const DWARFDebugInfoEntry * getSiblingEntry(const DWARFDebugInfoEntry *Die) const
Definition:DWARFUnit.cpp:931
llvm::DWARFUnit::getUnitDIE
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition:DWARFUnit.h:443
llvm::DWARFUnit::getParent
DWARFDie getParent(const DWARFDebugInfoEntry *Die)
Definition:DWARFUnit.cpp:901
llvm::DWARFUnit::getDIEIndexForOffset
std::optional< uint32_t > getDIEIndexForOffset(uint64_t Offset)
Return the DIE index for a given offset Offset inside the unit's DIE vector.
Definition:DWARFUnit.h:542
llvm::DWARFUnit::getDIEIndex
uint32_t getDIEIndex(const DWARFDebugInfoEntry *Die) const
Return the index of a Die entry inside the unit's DIE vector.
Definition:DWARFUnit.h:269
llvm::DWARFUnit::getFirstChildEntry
const DWARFDebugInfoEntry * getFirstChildEntry(const DWARFDebugInfoEntry *Die) const
Definition:DWARFUnit.cpp:992
llvm::DWARFUnit::getDIEAtIndex
DWARFDie getDIEAtIndex(unsigned Index)
Return the DIE object at the given index Index.
Definition:DWARFUnit.h:521
llvm::DenseMapBase::count
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
Definition:DenseMap.h:152
llvm::DenseMap
Definition:DenseMap.h:727
llvm::ErrorInfoBase
Base class for error info classes.
Definition:Error.h:45
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:Error.h:160
llvm::Expression
Class representing an expression and its matching format.
Definition:FileCheckImpl.h:189
llvm::PointerUnion
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition:PointerUnion.h:118
llvm::SmallDenseMap
Definition:DenseMap.h:883
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:SmallVector.h:573
llvm::SmallVector< uint64_t * >
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition:StringMapEntry.h:102
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition:StringMap.h:128
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition:Triple.h:44
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:Twine.h:81
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
llvm::dwarf_linker::DWARFFile
This class represents DWARF information for source file and it's address map.
Definition:DWARFFile.h:25
llvm::dwarf_linker::IndexedValuesMap
This class stores values sequentually and assigns index to the each value.
Definition:IndexedValuesMap.h:21
llvm::dwarf_linker::IndexedValuesMap::getValueIndex
uint64_t getValueIndex(T Value)
Definition:IndexedValuesMap.h:23
llvm::dwarf_linker::StringPool
Definition:StringPool.h:53
llvm::dwarf_linker::parallel::ArrayList
This class is a simple list of T structures.
Definition:ArrayList.h:23
llvm::dwarf_linker::parallel::ArrayList::add
T & add(const T &Item)
Add specified Item to the list.
Definition:ArrayList.h:29
llvm::dwarf_linker::parallel::ArrayList::forEach
void forEach(ItemHandlerTy Handler)
Enumerate all items and apply specified Handler to each.
Definition:ArrayList.h:63
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr
Output unit selector.
Definition:DWARFLinkerCompileUnit.h:580
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::getAsTypeUnit
TypeUnit * getAsTypeUnit()
Returns TypeUnit if applicable.
Definition:DWARFLinkerCompileUnit.cpp:1827
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isTypeUnit
bool isTypeUnit()
Definition:DWARFLinkerCompileUnit.cpp:1819
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::operator->
DwarfUnit * operator->()
Accessor for common functionality.
Definition:DWARFLinkerCompileUnit.cpp:1808
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::Ptr
PointerUnion< CompileUnit *, TypeUnit * > Ptr
Definition:DWARFLinkerCompileUnit.h:599
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::getAsCompileUnit
CompileUnit * getAsCompileUnit()
Returns CompileUnit if applicable.
Definition:DWARFLinkerCompileUnit.cpp:1823
llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::isCompileUnit
bool isCompileUnit()
Definition:DWARFLinkerCompileUnit.cpp:1815
llvm::dwarf_linker::parallel::CompileUnit
Stores all information related to a compile unit, be it in its original instance of the object file o...
Definition:DWARFLinkerCompileUnit.h:53
llvm::dwarf_linker::parallel::CompileUnit::addLabelLowPc
void addLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset)
Add the low_pc of a label that is relocated by applying offset PCOffset.
llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitDebugLocations
Error cloneAndEmitDebugLocations()
Clone and emit debug locations(.debug_loc/.debug_loclists).
Definition:DWARFLinkerCompileUnit.cpp:443
llvm::dwarf_linker::parallel::CompileUnit::cloneDieAttrExpression
void cloneDieAttrExpression(const DWARFExpression &InputExpression, SmallVectorImpl< uint8_t > &OutputExpression, SectionDescriptor &Section, std::optional< int64_t > VarAddressAdjustment, OffsetsPtrVector &PatchesOffsets)
Clone attribute location axpression.
Definition:DWARFLinkerCompileUnit.cpp:1093
llvm::dwarf_linker::parallel::CompileUnit::maybeResetToLoadedStage
void maybeResetToLoadedStage()
Reset compile units data(results of liveness analysis, clonning) if current stage greater than Stage:...
Definition:DWARFLinkerCompileUnit.cpp:75
llvm::dwarf_linker::parallel::CompileUnit::addFunctionRange
void addFunctionRange(uint64_t LowPC, uint64_t HighPC, int64_t PCOffset)
Add a function range [LowPC, HighPC) that is relocated by applying offset PCOffset.
llvm::dwarf_linker::parallel::CompileUnit::analyzeImportedModule
void analyzeImportedModule(const DWARFDebugInfoEntry *DieEntry)
Collect references to parseable Swift interfaces in imported DW_TAG_module blocks.
Definition:DWARFLinkerCompileUnit.cpp:253
llvm::dwarf_linker::parallel::CompileUnit::cloneDIE
std::pair< DIE *, TypeEntry * > cloneDIE(const DWARFDebugInfoEntry *InputDieEntry, TypeEntry *ClonedParentTypeDIE, uint64_t OutOffset, std::optional< int64_t > FuncAddressAdjustment, std::optional< int64_t > VarAddressAdjustment, BumpPtrAllocator &Allocator, TypeUnit *ArtificialTypeUnit)
Definition:DWARFLinkerCompileUnit.cpp:1287
llvm::dwarf_linker::parallel::CompileUnit::cleanupDataAfterClonning
void cleanupDataAfterClonning()
Cleanup unneeded resources after compile unit is cloned.
Definition:DWARFLinkerCompileUnit.cpp:239
llvm::dwarf_linker::parallel::CompileUnit::assignTypeNames
Error assignTypeNames(TypePool &TypePoolRef)
Search for type entries and assign names.
Definition:DWARFLinkerCompileUnit.cpp:303
llvm::dwarf_linker::parallel::CompileUnit::getHighPc
uint64_t getHighPc() const
Returns value of DW_AT_high_pc attribute.
Definition:DWARFLinkerCompileUnit.h:372
llvm::dwarf_linker::parallel::CompileUnit::DieOutputPlacement
DieOutputPlacement
Kinds of placement for the output die.
Definition:DWARFLinkerCompileUnit.h:155
llvm::dwarf_linker::parallel::CompileUnit::Both
@ Both
Corresponding DIE goes to type table and to plain dwarf.
Definition:DWARFLinkerCompileUnit.h:165
llvm::dwarf_linker::parallel::CompileUnit::TypeTable
@ TypeTable
Corresponding DIE goes to the type table only.
Definition:DWARFLinkerCompileUnit.h:159
llvm::dwarf_linker::parallel::CompileUnit::NotSet
@ NotSet
Definition:DWARFLinkerCompileUnit.h:156
llvm::dwarf_linker::parallel::CompileUnit::PlainDwarf
@ PlainDwarf
Corresponding DIE goes to the plain dwarf only.
Definition:DWARFLinkerCompileUnit.h:162
llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitLineTable
Error cloneAndEmitLineTable(const Triple &TargetTriple)
Definition:DWARFLinkerCompileUnit.cpp:1516
llvm::dwarf_linker::parallel::CompileUnit::analyzeDWARFStructure
void analyzeDWARFStructure()
Navigate DWARF tree and set die properties.
Definition:DWARFLinkerCompileUnit.h:127
llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitRanges
Error cloneAndEmitRanges()
Clone and emit ranges.
Definition:DWARFLinkerCompileUnit.cpp:674
llvm::dwarf_linker::parallel::CompileUnit::updateDieRefPatchesWithClonedOffsets
void updateDieRefPatchesWithClonedOffsets()
After cloning stage the output DIEs offsets are deallocated.
Definition:DWARFLinkerCompileUnit.cpp:334
llvm::dwarf_linker::parallel::CompileUnit::getDebugAddrIndex
uint64_t getDebugAddrIndex(uint64_t Addr)
Returns index(inside .debug_addr) of an address.
Definition:DWARFLinkerCompileUnit.h:436
llvm::dwarf_linker::parallel::CompileUnit::getContaingFile
const DWARFFile & getContaingFile() const
Returns DWARFFile containing this compile unit.
Definition:DWARFLinkerCompileUnit.h:111
llvm::dwarf_linker::parallel::CompileUnit::resolveDependenciesAndMarkLiveness
bool resolveDependenciesAndMarkLiveness(bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Search for subprograms and variables referencing live code and discover dependend DIEs.
Definition:DWARFLinkerCompileUnit.cpp:1831
llvm::dwarf_linker::parallel::CompileUnit::hasLabelAt
bool hasLabelAt(uint64_t Addr) const
Returns true if there is a label corresponding to the specified Addr.
Definition:DWARFLinkerCompileUnit.h:375
llvm::dwarf_linker::parallel::CompileUnit::updateDependenciesCompleteness
bool updateDependenciesCompleteness()
Check dependend DIEs for incompatible placement.
Definition:DWARFLinkerCompileUnit.cpp:1840
llvm::dwarf_linker::parallel::CompileUnit::loadInputDIEs
bool loadInputDIEs()
Load DIEs of input compilation unit.
Definition:DWARFLinkerCompileUnit.cpp:114
llvm::dwarf_linker::parallel::CompileUnit::getFunctionRanges
const RangesTy & getFunctionRanges() const
Returns function ranges of this unit.
Definition:DWARFLinkerCompileUnit.h:401
llvm::dwarf_linker::parallel::CompileUnit::saveAcceleratorInfo
void saveAcceleratorInfo(const DwarfUnit::AccelInfo &Info)
Save specified accelerator info Info.
Definition:DWARFLinkerCompileUnit.h:569
llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitDebugMacro
Error cloneAndEmitDebugMacro()
Clone and emit debug macros(.debug_macinfo/.debug_macro).
Definition:DWARFLinkerCompileUnit.cpp:894
llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmit
Error cloneAndEmit(std::optional< std::reference_wrapper< const Triple > > TargetTriple, TypeUnit *ArtificialTypeUnit)
Clone and emit this compilation unit.
Definition:DWARFLinkerCompileUnit.cpp:1231
llvm::dwarf_linker::parallel::CompileUnit::setStage
void setStage(Stage Stage)
Set stage of overall processing.
Definition:DWARFLinkerCompileUnit.h:101
llvm::dwarf_linker::parallel::CompileUnit::getStage
Stage getStage() const
Returns stage of overall processing.
Definition:DWARFLinkerCompileUnit.h:98
llvm::dwarf_linker::parallel::CompileUnit::verifyDependencies
void verifyDependencies()
Check DIEs to have a consistent marking(keep marking, placement marking).
Definition:DWARFLinkerCompileUnit.cpp:1846
llvm::dwarf_linker::parallel::CompileUnit::Stage
Stage
The stages of new compile unit processing.
Definition:DWARFLinkerCompileUnit.h:56
llvm::dwarf_linker::parallel::CompileUnit::Stage::Cloned
@ Cloned
Output DWARF is generated.
llvm::dwarf_linker::parallel::CompileUnit::Stage::TypeNamesAssigned
@ TypeNamesAssigned
Type names assigned to DIEs.
llvm::dwarf_linker::parallel::CompileUnit::Stage::CreatedNotLoaded
@ CreatedNotLoaded
Created, linked with input DWARF file.
llvm::dwarf_linker::parallel::CompileUnit::Stage::PatchesUpdated
@ PatchesUpdated
Offsets inside patch records are updated.
llvm::dwarf_linker::parallel::CompileUnit::Stage::Cleaned
@ Cleaned
Resources(Input DWARF, Output DWARF tree) are released.
llvm::dwarf_linker::parallel::CompileUnit::Stage::Loaded
@ Loaded
Input DWARF is loaded.
llvm::dwarf_linker::parallel::CompileUnit::Stage::LivenessAnalysisDone
@ LivenessAnalysisDone
Input DWARF is analysed(DIEs pointing to the real code section are discovered,...
llvm::dwarf_linker::parallel::CompileUnit::Stage::UpdateDependenciesCompleteness
@ UpdateDependenciesCompleteness
Check if dependencies have incompatible placement.
llvm::dwarf_linker::parallel::CompileUnit::Stage::Skipped
@ Skipped
Compile Unit should be skipped.
llvm::dwarf_linker::parallel::CompileUnit::forEachAcceleratorRecord
void forEachAcceleratorRecord(function_ref< void(AccelInfo &)> Handler) override
Enumerates all units accelerator records.
Definition:DWARFLinkerCompileUnit.h:575
llvm::dwarf_linker::parallel::CompileUnit::getLowPc
std::optional< uint64_t > getLowPc() const
Returns value of DW_AT_low_pc attribute.
Definition:DWARFLinkerCompileUnit.h:369
llvm::dwarf_linker::parallel::CompileUnit::getDirAndFilenameFromLineTable
std::optional< std::pair< StringRef, StringRef > > getDirAndFilenameFromLineTable(const DWARFFormValue &FileIdxValue)
Returns directory and file from the line table by index.
Definition:DWARFLinkerCompileUnit.cpp:1672
llvm::dwarf_linker::parallel::CompileUnit::resolveDIEReference
std::optional< UnitEntryPairTy > resolveDIEReference(const DWARFFormValue &RefValue, ResolveInterCUReferencesMode CanResolveInterCUReferences)
Resolve the DIE attribute reference that has been extracted in RefValue.
Definition:DWARFLinkerCompileUnit.cpp:381
llvm::dwarf_linker::parallel::CompileUnit::loadLineTable
void loadLineTable()
Loads unit line table.
Definition:DWARFLinkerCompileUnit.cpp:71
llvm::dwarf_linker::parallel::CompileUnit::getFileName
StringEntry * getFileName(unsigned FileIdx, StringPool &GlobalStrings)
Returns name of the file for the FileIdx from the unit`s line table.
Definition:DWARFLinkerCompileUnit.cpp:188
llvm::dwarf_linker::parallel::DIEGenerator
This class is a helper to create output DIE tree.
Definition:DIEGenerator.h:22
llvm::dwarf_linker::parallel::DependencyTracker
This class discovers DIEs dependencies: marks "live" DIEs, marks DIE locations (whether DIE should be...
Definition:DependencyTracker.h:26
llvm::dwarf_linker::parallel::DwarfUnit
Base class for all Dwarf units(Compile unit/Type table unit).
Definition:DWARFLinkerUnit.h:29
llvm::dwarf_linker::parallel::DwarfUnit::getUnitName
StringRef getUnitName() const
Returns this unit name.
Definition:DWARFLinkerUnit.h:44
llvm::dwarf_linker::parallel::DwarfUnit::ClangModuleName
std::string ClangModuleName
If this is a Clang module, this holds the module's name.
Definition:DWARFLinkerUnit.h:184
llvm::dwarf_linker::parallel::LinkingGlobalData
This class keeps data and services common for the whole linking process.
Definition:DWARFLinkerGlobalData.h:85
llvm::dwarf_linker::parallel::LinkingGlobalData::warn
void warn(const Twine &Warning, StringRef Context, const DWARFDie *DIE=nullptr)
Report warning.
Definition:DWARFLinkerGlobalData.h:107
llvm::dwarf_linker::parallel::LinkingGlobalData::error
void error(const Twine &Err, StringRef Context, const DWARFDie *DIE=nullptr)
Report error.
Definition:DWARFLinkerGlobalData.h:121
llvm::dwarf_linker::parallel::OutputSections::GlobalData
LinkingGlobalData & GlobalData
Definition:OutputSections.h:451
llvm::dwarf_linker::parallel::OutputSections::Format
dwarf::FormParams Format
Format for sections.
Definition:OutputSections.h:454
llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder
The helper class to build type name based on DIE properties.
Definition:SyntheticTypeNameBuilder.h:46
llvm::dwarf_linker::parallel::TypeEntryBody
Keeps cloned data for the type DIE.
Definition:TypePool.h:30
llvm::dwarf_linker::parallel::TypePool
TypePool keeps type descriptors which contain partially cloned DIE correspinding to each type.
Definition:TypePool.h:111
llvm::dwarf_linker::parallel::TypeUnit
Type Unit is used to represent an artificial compilation unit which keeps all type information.
Definition:DWARFLinkerTypeUnit.h:24
llvm::function_ref< CompileUnit *(uint64_t Offset)>
uint32_t
uint64_t
uint8_t
unsigned
llvm::dwarf_linker::parallel::CompileUnit::getDieOutOffset
uint64_t getDieOutOffset(const DWARFDebugInfoEntry *InputDieEntry)
InputDieEntry debug info entry.
Definition:DWARFLinkerCompileUnit.h:329
llvm::dwarf_linker::parallel::CompileUnit::rememberDieOutOffset
void rememberDieOutOffset(uint32_t Idx, uint64_t Offset)
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:345
llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry
TypeEntry * getDieTypeEntry(uint32_t Idx)
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:322
llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo
DIEInfo & getDIEInfo(unsigned Idx)
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:283
llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo
const DIEInfo & getDIEInfo(const DWARFDebugInfoEntry *Entry) const
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:297
llvm::dwarf_linker::parallel::CompileUnit::getDieOutOffset
uint64_t getDieOutOffset(uint32_t Idx)
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:315
llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo
const DIEInfo & getDIEInfo(const DWARFDie &Die) const
Die
Definition:DWARFLinkerCompileUnit.h:309
llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo
const DIEInfo & getDIEInfo(unsigned Idx) const
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:287
llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo
DIEInfo & getDIEInfo(const DWARFDebugInfoEntry *Entry)
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:291
llvm::dwarf_linker::parallel::CompileUnit::getDieTypeEntry
TypeEntry * getDieTypeEntry(const DWARFDebugInfoEntry *InputDieEntry)
InputDieEntry debug info entry.
Definition:DWARFLinkerCompileUnit.h:337
llvm::dwarf_linker::parallel::CompileUnit::setDieTypeEntry
void setDieTypeEntry(const DWARFDebugInfoEntry *InputDieEntry, TypeEntry *Entry)
InputDieEntry debug info entry.
Definition:DWARFLinkerCompileUnit.h:359
llvm::dwarf_linker::parallel::CompileUnit::setDieTypeEntry
void setDieTypeEntry(uint32_t Idx, TypeEntry *Entry)
Idx index of the DIE.
Definition:DWARFLinkerCompileUnit.h:352
llvm::dwarf_linker::parallel::CompileUnit::getDIEInfo
DIEInfo & getDIEInfo(const DWARFDie &Die)
Die
Definition:DWARFLinkerCompileUnit.h:303
llvm::dwarf_linker::parallel::CompileUnit::getSiblingEntry
const DWARFDebugInfoEntry * getSiblingEntry(const DWARFDebugInfoEntry *Die) const
Definition:DWARFLinkerCompileUnit.h:465
llvm::dwarf_linker::parallel::CompileUnit::getFirstChildEntry
const DWARFDebugInfoEntry * getFirstChildEntry(const DWARFDebugInfoEntry *Die) const
Definition:DWARFLinkerCompileUnit.h:459
llvm::dwarf_linker::parallel::CompileUnit::getDIEIndexForOffset
std::optional< uint32_t > getDIEIndexForOffset(uint64_t Offset)
Definition:DWARFLinkerCompileUnit.h:526
llvm::dwarf_linker::parallel::CompileUnit::getDIEAtIndex
DWARFDie getDIEAtIndex(unsigned Index)
Definition:DWARFLinkerCompileUnit.h:475
llvm::dwarf_linker::parallel::CompileUnit::getDIE
DWARFDie getDIE(const DWARFDebugInfoEntry *Die)
Definition:DWARFLinkerCompileUnit.h:490
llvm::dwarf_linker::parallel::CompileUnit::find
std::optional< DWARFFormValue > find(const DWARFDebugInfoEntry *Die, ArrayRef< dwarf::Attribute > Attrs) const
Definition:DWARFLinkerCompileUnit.h:511
llvm::dwarf_linker::parallel::CompileUnit::getDebugInfoEntry
const DWARFDebugInfoEntry * getDebugInfoEntry(unsigned Index) const
Definition:DWARFLinkerCompileUnit.h:480
llvm::dwarf_linker::parallel::CompileUnit::getOrigUnit
DWARFUnit & getOrigUnit() const
Returns paired compile unit from input DWARF.
Definition:DWARFLinkerCompileUnit.h:453
llvm::dwarf_linker::parallel::CompileUnit::getUnitDIE
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition:DWARFLinkerCompileUnit.h:485
llvm::dwarf_linker::parallel::CompileUnit::getParent
DWARFDie getParent(const DWARFDebugInfoEntry *Die)
Definition:DWARFLinkerCompileUnit.h:470
llvm::dwarf_linker::parallel::CompileUnit::getDIEIndex
uint32_t getDIEIndex(const DWARFDebugInfoEntry *Die) const
Definition:DWARFLinkerCompileUnit.h:495
llvm::dwarf_linker::parallel::CompileUnit::getDIEIndex
uint32_t getDIEIndex(const DWARFDie &Die) const
Definition:DWARFLinkerCompileUnit.h:500
llvm::dwarf_linker::parallel::CompileUnit::find
std::optional< DWARFFormValue > find(uint32_t DieIdx, ArrayRef< dwarf::Attribute > Attrs) const
Definition:DWARFLinkerCompileUnit.h:505
llvm::dwarf_linker::parallel::CompileUnit::error
void error(Error Err, const DWARFDie *DIE=nullptr)
Definition:DWARFLinkerCompileUnit.h:560
llvm::dwarf_linker::parallel::CompileUnit::warn
void warn(Error Warning, const DWARFDie *DIE=nullptr)
Definition:DWARFLinkerCompileUnit.h:540
llvm::dwarf_linker::parallel::CompileUnit::warn
void warn(const Twine &Warning, const DWARFDie *DIE=nullptr)
Definition:DWARFLinkerCompileUnit.h:536
llvm::dwarf_linker::parallel::CompileUnit::error
void error(const Twine &Err, const DWARFDie *DIE=nullptr)
Definition:DWARFLinkerCompileUnit.h:556
llvm::dwarf_linker::parallel::CompileUnit::warn
void warn(const Twine &Warning, const DWARFDebugInfoEntry *DieEntry)
Definition:DWARFLinkerCompileUnit.h:546
SINGLE_FLAG_METHODS_SET
#define SINGLE_FLAG_METHODS_SET(Name, Value)
Definition:DWARFLinkerCompileUnit.h:210
CU
Definition:AArch64AsmBackend.cpp:549
llvm::dwarf_linker::parallel::getODRAttributes
ArrayRef< dwarf::Attribute > getODRAttributes()
Definition:DWARFLinkerCompileUnit.cpp:1852
llvm::dwarf_linker::parallel::ResolveInterCUReferencesMode
ResolveInterCUReferencesMode
Definition:DWARFLinkerCompileUnit.h:44
llvm::dwarf_linker::parallel::AvoidResolving
@ AvoidResolving
Definition:DWARFLinkerCompileUnit.h:46
llvm::dwarf_linker::parallel::Resolve
@ Resolve
Definition:DWARFLinkerCompileUnit.h:45
llvm::dwarf_linker::DebugSectionKind
DebugSectionKind
List of tracked debug tables.
Definition:DWARFLinkerBase.h:27
llvm::dwarf::Attribute
Attribute
Attributes.
Definition:Dwarf.h:123
llvm::dwarf::Tag
Tag
Definition:Dwarf.h:103
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::Offset
@ Offset
Definition:DWP.cpp:480
llvm::handleAllErrors
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
Definition:Error.h:977
llvm::IRMemLocation::Other
@ Other
Any other memory.
llvm::HighlightColor::Warning
@ Warning
llvm::endianness
endianness
Definition:bit.h:70
llvm::FunctionReturnThunksKind::Keep
@ Keep
No function return thunk.
llvm::DWARFDebugLine::LineTable
Definition:DWARFDebugLine.h:229
llvm::DWARFLocationExpression
Represents a single DWARF expression, whose value is location-dependent.
Definition:DWARFLocationExpression.h:21
llvm::dwarf::FormParams
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition:Dwarf.h:1084
llvm::dwarf_linker::parallel::AttributesInfo
Information gathered and exchanged between the various clone*Attr helpers about the attributes of a p...
Definition:DIEAttributeCloner.h:24
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo
Information gathered about source DIEs.
Definition:DWARFLinkerCompileUnit.h:169
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::dump
LLVM_DUMP_METHOD void dump()
Definition:DWARFLinkerCompileUnit.cpp:22
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::setPlacement
void setPlacement(DieOutputPlacement Placement)
Sets Placement kind for the corresponding die.
Definition:DWARFLinkerCompileUnit.h:186
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::needToKeepInPlainDwarf
bool needToKeepInPlainDwarf() const
Definition:DWARFLinkerCompileUnit.h:270
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::Flags
std::atomic< uint16_t > Flags
Data member keeping various flags.
Definition:DWARFLinkerCompileUnit.h:178
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::DIEInfo
DIEInfo()=default
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::needToPlaceInTypeTable
bool needToPlaceInTypeTable() const
Definition:DWARFLinkerCompileUnit.h:264
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::getPlacement
DieOutputPlacement getPlacement() const
Definition:DWARFLinkerCompileUnit.h:181
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::unsetPlacement
void unsetPlacement()
Unsets Placement kind for the corresponding die.
Definition:DWARFLinkerCompileUnit.h:194
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::setPlacementIfUnset
bool setPlacementIfUnset(DieOutputPlacement Placement)
Sets Placement kind for the corresponding die.
Definition:DWARFLinkerCompileUnit.h:201
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::operator=
DIEInfo & operator=(const DIEInfo &Other)
Definition:DWARFLinkerCompileUnit.h:172
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::unsetFlagsWhichSetDuringLiveAnalysis
void unsetFlagsWhichSetDuringLiveAnalysis()
DIE is a part of the linked output.
Definition:DWARFLinkerCompileUnit.h:250
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::DIEInfo
DIEInfo(const DIEInfo &Other)
Definition:DWARFLinkerCompileUnit.h:171
llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::eraseData
void eraseData()
Erase all flags.
Definition:DWARFLinkerCompileUnit.h:258
llvm::dwarf_linker::parallel::DwarfUnit::AccelInfo
This structure keeps fields which would be used for creating accelerator table.
Definition:DWARFLinkerUnit.h:122
llvm::dwarf_linker::parallel::SectionDescriptor
This structure is used to keep data of the concrete section.
Definition:OutputSections.h:152
llvm::dwarf_linker::parallel::UnitEntryPairTy
This is a helper structure which keeps a debug info entry with it's containing compilation unit.
Definition:DWARFLinkerCompileUnit.h:32
llvm::dwarf_linker::parallel::UnitEntryPairTy::UnitEntryPairTy
UnitEntryPairTy()=default
llvm::dwarf_linker::parallel::UnitEntryPairTy::UnitEntryPairTy
UnitEntryPairTy(CompileUnit *CU, const DWARFDebugInfoEntry *DieEntry)
Definition:DWARFLinkerCompileUnit.h:34
llvm::dwarf_linker::parallel::UnitEntryPairTy::getParent
std::optional< UnitEntryPairTy > getParent()
Definition:DWARFLinkerCompileUnit.cpp:1792
llvm::dwarf_linker::parallel::UnitEntryPairTy::getNamespaceOrigin
UnitEntryPairTy getNamespaceOrigin()
Definition:DWARFLinkerCompileUnit.cpp:1775
llvm::dwarf_linker::parallel::UnitEntryPairTy::DieEntry
const DWARFDebugInfoEntry * DieEntry
Definition:DWARFLinkerCompileUnit.h:38

Generated on Sun Jul 20 2025 07:19:02 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp