LLVM 19.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::dwarf_linker::parallel::CompileUnit Class Reference

Stores all information related to a compile unit, be it in its original instance of the object file or its brand new cloned and generated DIE tree. More...

#include "DWARFLinker/Parallel/DWARFLinkerCompileUnit.h"

Inheritance diagram for llvm::dwarf_linker::parallel::CompileUnit:
Inheritance graph
[legend]

Classes

struct  DIEInfo
 Information gathered about source DIEs. More...
 
class  OutputUnitVariantPtr
 Output unit selector. More...
 

Public Types

enum class  Stage : uint8_t {
  CreatedNotLoaded = 0 , Loaded , LivenessAnalysisDone , UpdateDependenciesCompleteness ,
  TypeNamesAssigned , Cloned , PatchesUpdated , Cleaned ,
  Skipped
}
 The stages of new compile unit processing. More...
 
enum  DieOutputPlacement : uint8_t { NotSet = 0 , TypeTable = 1 , PlainDwarf = 2 , Both = 3 }
 Kinds of placement for the output die. More...
 
- Public Types inherited from llvm::dwarf_linker::parallel::DwarfUnit
enum class  AccelType : uint8_t {
  AccelType::None , AccelType::Name , AccelType::Namespace , AccelType::ObjC ,
  AccelType::Type
}
 

Public Member Functions

 CompileUnit (LinkingGlobalData &GlobalData, unsigned ID, StringRef ClangModuleName, DWARFFile &File, OffsetToUnitTy UnitFromOffset, dwarf::FormParams Format, llvm::endianness Endianess)
 
 CompileUnit (LinkingGlobalData &GlobalData, DWARFUnit &OrigUnit, unsigned ID, StringRef ClangModuleName, DWARFFile &File, OffsetToUnitTy UnitFromOffset, dwarf::FormParams Format, llvm::endianness Endianess)
 
Stage getStage () const
 Returns stage of overall processing.
 
void setStage (Stage Stage)
 Set stage of overall processing.
 
void loadLineTable ()
 Loads unit line table.
 
StringEntrygetFileName (unsigned FileIdx, StringPool &GlobalStrings)
 Returns name of the file for the FileIdx from the unit`s line table.
 
const DWARFFilegetContaingFile () const
 Returns DWARFFile containing this compile unit.
 
bool loadInputDIEs ()
 Load DIEs of input compilation unit.
 
void maybeResetToLoadedStage ()
 Reset compile units data(results of liveness analysis, clonning) if current stage greater than Stage::Loaded.
 
void analyzeImportedModule (const DWARFDebugInfoEntry *DieEntry)
 Collect references to parseable Swift interfaces in imported DW_TAG_module blocks.
 
void analyzeDWARFStructure ()
 Navigate DWARF tree and set die properties.
 
void cleanupDataAfterClonning ()
 Cleanup unneeded resources after compile unit is cloned.
 
void updateDieRefPatchesWithClonedOffsets ()
 After cloning stage the output DIEs offsets are deallocated.
 
bool resolveDependenciesAndMarkLiveness (bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
 Search for subprograms and variables referencing live code and discover dependend DIEs.
 
bool updateDependenciesCompleteness ()
 Check dependend DIEs for incompatible placement.
 
void verifyDependencies ()
 Check DIEs to have a consistent marking(keep marking, placement marking).
 
Error assignTypeNames (TypePool &TypePoolRef)
 Search for type entries and assign names.
 
DIEInfogetDIEInfo (unsigned Idx)
 Idx index of the DIE.
 
const DIEInfogetDIEInfo (unsigned Idx) const
 Idx index of the DIE.
 
DIEInfogetDIEInfo (const DWARFDebugInfoEntry *Entry)
 Idx index of the DIE.
 
const DIEInfogetDIEInfo (const DWARFDebugInfoEntry *Entry) const
 Idx index of the DIE.
 
DIEInfogetDIEInfo (const DWARFDie &Die)
 Die
 
const DIEInfogetDIEInfo (const DWARFDie &Die) const
 Die
 
uint64_t getDieOutOffset (uint32_t Idx)
 Idx index of the DIE.
 
TypeEntrygetDieTypeEntry (uint32_t Idx)
 Idx index of the DIE.
 
uint64_t getDieOutOffset (const DWARFDebugInfoEntry *InputDieEntry)
 InputDieEntry debug info entry.
 
TypeEntrygetDieTypeEntry (const DWARFDebugInfoEntry *InputDieEntry)
 InputDieEntry debug info entry.
 
void rememberDieOutOffset (uint32_t Idx, uint64_t Offset)
 Idx index of the DIE.
 
void setDieTypeEntry (uint32_t Idx, TypeEntry *Entry)
 Idx index of the DIE.
 
void setDieTypeEntry (const DWARFDebugInfoEntry *InputDieEntry, TypeEntry *Entry)
 InputDieEntry debug info entry.
 
std::optional< uint64_tgetLowPc () const
 Returns value of DW_AT_low_pc attribute.
 
uint64_t getHighPc () const
 Returns value of DW_AT_high_pc attribute.
 
bool hasLabelAt (uint64_t Addr) const
 Returns true if there is a label corresponding to the specified Addr.
 
void addLabelLowPc (uint64_t LabelLowPc, int64_t PcOffset)
 Add the low_pc of a label that is relocated by applying offset PCOffset.
 
std::optional< UnitEntryPairTyresolveDIEReference (const DWARFFormValue &RefValue, ResolveInterCUReferencesMode CanResolveInterCUReferences)
 Resolve the DIE attribute reference that has been extracted in RefValue.
 
std::optional< UnitEntryPairTyresolveDIEReference (const DWARFDebugInfoEntry *DieEntry, dwarf::Attribute Attr, ResolveInterCUReferencesMode CanResolveInterCUReferences)
 
void addFunctionRange (uint64_t LowPC, uint64_t HighPC, int64_t PCOffset)
 Add a function range [LowPC, HighPC) that is relocated by applying offset PCOffset.
 
const RangesTygetFunctionRanges () const
 Returns function ranges of this unit.
 
Error cloneAndEmit (std::optional< std::reference_wrapper< const Triple > > TargetTriple, TypeUnit *ArtificialTypeUnit)
 Clone and emit this compilation unit.
 
Error cloneAndEmitDebugLocations ()
 Clone and emit debug locations(.debug_loc/.debug_loclists).
 
Error cloneAndEmitRanges ()
 Clone and emit ranges.
 
Error cloneAndEmitDebugMacro ()
 Clone and emit debug macros(.debug_macinfo/.debug_macro).
 
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)
 
Error cloneAndEmitLineTable (const Triple &TargetTriple)
 
void cloneDieAttrExpression (const DWARFExpression &InputExpression, SmallVectorImpl< uint8_t > &OutputExpression, SectionDescriptor &Section, std::optional< int64_t > VarAddressAdjustment, OffsetsPtrVector &PatchesOffsets)
 Clone attribute location axpression.
 
uint64_t getDebugAddrIndex (uint64_t Addr)
 Returns index(inside .debug_addr) of an address.
 
std::optional< std::pair< StringRef, StringRef > > getDirAndFilenameFromLineTable (const DWARFFormValue &FileIdxValue)
 Returns directory and file from the line table by index.
 
std::optional< std::pair< StringRef, StringRef > > getDirAndFilenameFromLineTable (uint64_t FileIdx)
 Returns directory and file from the line table by index.
 
DWARFUnitgetOrigUnit () const
 Returns paired compile unit from input DWARF.
 
const DWARFDebugInfoEntrygetFirstChildEntry (const DWARFDebugInfoEntry *Die) const
 
const DWARFDebugInfoEntrygetSiblingEntry (const DWARFDebugInfoEntry *Die) const
 
DWARFDie getParent (const DWARFDebugInfoEntry *Die)
 
DWARFDie getDIEAtIndex (unsigned Index)
 
const DWARFDebugInfoEntrygetDebugInfoEntry (unsigned Index) const
 
DWARFDie getUnitDIE (bool ExtractUnitDIEOnly=true)
 
DWARFDie getDIE (const DWARFDebugInfoEntry *Die)
 
uint32_t getDIEIndex (const DWARFDebugInfoEntry *Die) const
 
uint32_t getDIEIndex (const DWARFDie &Die) const
 
std::optional< DWARFFormValuefind (uint32_t DieIdx, ArrayRef< dwarf::Attribute > Attrs) const
 
std::optional< DWARFFormValuefind (const DWARFDebugInfoEntry *Die, ArrayRef< dwarf::Attribute > Attrs) const
 
std::optional< uint32_tgetDIEIndexForOffset (uint64_t Offset)
 
void warn (const Twine &Warning, const DWARFDie *DIE=nullptr)
 
void warn (Error Warning, const DWARFDie *DIE=nullptr)
 
void warn (const Twine &Warning, const DWARFDebugInfoEntry *DieEntry)
 
void error (const Twine &Err, const DWARFDie *DIE=nullptr)
 
void error (Error Err, const DWARFDie *DIE=nullptr)
 
void saveAcceleratorInfo (const DwarfUnit::AccelInfo &Info)
 Save specified accelerator info Info.
 
void forEachAcceleratorRecord (function_ref< void(AccelInfo &)> Handler) override
 Enumerates all units accelerator records.
 
- Public Member Functions inherited from llvm::dwarf_linker::parallel::DwarfUnit
virtual ~DwarfUnit ()
 
 DwarfUnit (LinkingGlobalData &GlobalData, unsigned ID, StringRef ClangModuleName)
 
unsigned getUniqueID () const
 Unique id of the unit.
 
uint64_t getUnitSize () const
 Returns size of this(newly generated) compile unit.
 
StringRef getUnitName () const
 Returns this unit name.
 
StringRef getSysRoot ()
 Return the DW_AT_LLVM_sysroot of the compile unit or an empty StringRef.
 
bool isClangModule () const
 Return true if this compile unit is from Clang module.
 
const std::string & getClangModuleName () const
 Return Clang module name;.
 
LinkingGlobalDatagetGlobalData ()
 Return global data.
 
bool isInterconnectedCU () const
 Returns true if unit is inter-connected(it references/referenced by other unit).
 
void setInterconnectedCU ()
 Mark this unit as inter-connected(it references/referenced by other unit).
 
void assignAbbrev (DIEAbbrev &Abbrev)
 Adds Abbrev into unit`s abbreviation table.
 
const std::vector< std::unique_ptr< DIEAbbrev > > & getAbbreviations () const
 Returns abbreviations for this compile unit.
 
DIEgetOutUnitDIE ()
 Returns output unit DIE.
 
void setOutUnitDIE (DIE *UnitDie)
 Set output unit DIE.
 
Error emitAbbreviations ()
 
Error emitDebugInfo (const Triple &TargetTriple)
 Emit .debug_info section for unit DIEs.
 
Error emitDebugLine (const Triple &TargetTriple, const DWARFDebugLine::LineTable &OutLineTable)
 Emit .debug_line section.
 
Error emitDebugStringOffsetSection ()
 Emit the .debug_str_offsets section for current unit.
 
void warn (const Twine &Warning)
 
void error (const Twine &Err)
 
void emitPubAccelerators ()
 Emit .debug_pubnames and .debug_pubtypes for Unit.
 
virtual void forEachAcceleratorRecord (function_ref< void(AccelInfo &)> Handler)=0
 Enumerates accelerator data.
 
virtual uint64_t getDebugStrIndex (const StringEntry *String)
 Returns index(inside .debug_str_offsets) of specified string.
 
- Public Member Functions inherited from llvm::dwarf_linker::parallel::OutputSections
 OutputSections (LinkingGlobalData &GlobalData)
 
void setOutputFormat (dwarf::FormParams Format, llvm::endianness Endianness)
 Sets output format for all keeping sections.
 
const SectionDescriptorgetSectionDescriptor (DebugSectionKind SectionKind) const
 Returns descriptor for the specified section of SectionKind.
 
SectionDescriptorgetSectionDescriptor (DebugSectionKind SectionKind)
 Returns descriptor for the specified section of SectionKind.
 
std::optional< const SectionDescriptor * > tryGetSectionDescriptor (DebugSectionKind SectionKind) const
 Returns descriptor for the specified section of SectionKind.
 
std::optional< SectionDescriptor * > tryGetSectionDescriptor (DebugSectionKind SectionKind)
 Returns descriptor for the specified section of SectionKind.
 
SectionDescriptorgetOrCreateSectionDescriptor (DebugSectionKind SectionKind)
 Returns descriptor for the specified section of SectionKind.
 
void eraseSections ()
 Erases data of all sections.
 
void forEach (function_ref< void(SectionDescriptor &)> Handler)
 Enumerate all sections and call Handler for each.
 
void forEach (function_ref< void(std::shared_ptr< SectionDescriptor > Section)> Handler)
 Enumerate all sections and call Handler for each.
 
void assignSectionsOffsetAndAccumulateSize (std::array< uint64_t, SectionKindsNum > &SectionSizesAccumulator)
 Enumerate all sections, for each section set current offset (kept by SectionSizesAccumulator), update current offset with section length.
 
void applyPatches (SectionDescriptor &Section, StringEntryToDwarfStringPoolEntryMap &DebugStrStrings, StringEntryToDwarfStringPoolEntryMap &DebugLineStrStrings, TypeUnit *TypeUnitPtr)
 Enumerate all sections, for each section apply all section patches.
 
llvm::endianness getEndianness () const
 Endiannes for the sections.
 
uint16_t getVersion () const
 Return DWARF version.
 
uint16_t getDebugInfoHeaderSize () const
 Return size of header of debug_info table.
 
uint16_t getDebugAddrHeaderSize () const
 Return size of header of debug_ table.
 
uint16_t getDebugStrOffsetsHeaderSize () const
 Return size of header of debug_str_offsets table.
 
const dwarf::FormParamsgetFormParams () const
 Return size of address.
 

Additional Inherited Members

- Protected Types inherited from llvm::dwarf_linker::parallel::DwarfUnit
using FileNamesCache = DenseMap< uint64_t, std::pair< std::string, std::string > >
 Cache for file names for this unit.
 
- Protected Types inherited from llvm::dwarf_linker::parallel::OutputSections
using SectionsSetTy = std::map< DebugSectionKind, std::shared_ptr< SectionDescriptor > >
 All keeping sections.
 
- Protected Member Functions inherited from llvm::dwarf_linker::parallel::DwarfUnit
void emitDwarfAbbrevEntry (const DIEAbbrev &Abbrev, SectionDescriptor &AbbrevSection)
 Emit single abbreviation entry.
 
std::optional< uint64_temitPubAcceleratorEntry (SectionDescriptor &OutSection, const AccelInfo &Info, std::optional< uint64_t > LengthOffset)
 Emit single pubnames/pubtypes accelerator entry.
 
- Protected Attributes inherited from llvm::dwarf_linker::parallel::DwarfUnit
unsigned ID = 0
 Unique ID for the unit.
 
std::string UnitName
 The name of this unit.
 
std::string SysRoot
 The DW_AT_LLVM_sysroot of this unit.
 
std::string ClangModuleName
 If this is a Clang module, this holds the module's name.
 
uint64_t UnitSize = 0
 
std::atomic< boolIsInterconnectedCU = {false}
 true if current unit references_to/is_referenced by other unit.
 
FoldingSet< DIEAbbrevAbbreviationsSet
 FoldingSet that uniques the abbreviations.
 
std::vector< std::unique_ptr< DIEAbbrev > > Abbreviations
 Storage for the unique Abbreviations.
 
DIEOutUnitDIE = nullptr
 Output unit DIE.
 
FileNamesCache FileNames
 
IndexedValuesMap< const StringEntry * > DebugStringIndexMap
 Maps a string into the index inside .debug_str_offsets section.
 
- Protected Attributes inherited from llvm::dwarf_linker::parallel::OutputSections
LinkingGlobalDataGlobalData
 
dwarf::FormParams Format = {4, 4, dwarf::DWARF32}
 Format for sections.
 
llvm::endianness Endianness = llvm::endianness::native
 Endiannes for sections.
 
SectionsSetTy SectionDescriptors
 

Detailed Description

Stores all information related to a compile unit, be it in its original instance of the object file or its brand new cloned and generated DIE tree.

NOTE: we need alignment of at least 8 bytes as we use PointerIntPair<CompileUnit *, 3> in the DependencyTracker.h

Definition at line 53 of file DWARFLinkerCompileUnit.h.

Member Enumeration Documentation

◆ DieOutputPlacement

Kinds of placement for the output die.

Enumerator
NotSet 
TypeTable 

Corresponding DIE goes to the type table only.

PlainDwarf 

Corresponding DIE goes to the plain dwarf only.

Both 

Corresponding DIE goes to type table and to plain dwarf.

Definition at line 155 of file DWARFLinkerCompileUnit.h.

◆ Stage

The stages of new compile unit processing.

Enumerator
CreatedNotLoaded 

Created, linked with input DWARF file.

Loaded 

Input DWARF is loaded.

LivenessAnalysisDone 

Input DWARF is analysed(DIEs pointing to the real code section are discovered, type names are assigned if ODR is requested).

UpdateDependenciesCompleteness 

Check if dependencies have incompatible placement.

If that is the case modify placement to be compatible.

TypeNamesAssigned 

Type names assigned to DIEs.

Cloned 

Output DWARF is generated.

PatchesUpdated 

Offsets inside patch records are updated.

Cleaned 

Resources(Input DWARF, Output DWARF tree) are released.

Skipped 

Compile Unit should be skipped.

Definition at line 56 of file DWARFLinkerCompileUnit.h.

Constructor & Destructor Documentation

◆ CompileUnit() [1/2]

CompileUnit::CompileUnit ( LinkingGlobalData GlobalData,
unsigned  ID,
StringRef  ClangModuleName,
DWARFFile File,
OffsetToUnitTy  UnitFromOffset,
dwarf::FormParams  Format,
llvm::endianness  Endianess 
)

◆ CompileUnit() [2/2]

CompileUnit::CompileUnit ( LinkingGlobalData GlobalData,
DWARFUnit OrigUnit,
unsigned  ID,
StringRef  ClangModuleName,
DWARFFile File,
OffsetToUnitTy  UnitFromOffset,
dwarf::FormParams  Format,
llvm::endianness  Endianess 
)

Member Function Documentation

◆ addFunctionRange()

void llvm::dwarf_linker::parallel::CompileUnit::addFunctionRange ( uint64_t  LowPC,
uint64_t  HighPC,
int64_t  PCOffset 
)

Add a function range [LowPC, HighPC) that is relocated by applying offset PCOffset.

◆ addLabelLowPc()

void llvm::dwarf_linker::parallel::CompileUnit::addLabelLowPc ( uint64_t  LabelLowPc,
int64_t  PcOffset 
)

Add the low_pc of a label that is relocated by applying offset PCOffset.

◆ analyzeDWARFStructure()

void llvm::dwarf_linker::parallel::CompileUnit::analyzeDWARFStructure ( )
inline

Navigate DWARF tree and set die properties.

Definition at line 127 of file DWARFLinkerCompileUnit.h.

References getDebugInfoEntry(), and getUnitDIE().

◆ analyzeImportedModule()

void CompileUnit::analyzeImportedModule ( const DWARFDebugInfoEntry DieEntry)

◆ assignTypeNames()

Error CompileUnit::assignTypeNames ( TypePool TypePoolRef)

Search for type entries and assign names.

Definition at line 301 of file DWARFLinkerCompileUnit.cpp.

References getDebugInfoEntry(), getUnitDIE(), isValid(), and llvm::Error::success().

◆ cleanupDataAfterClonning()

void CompileUnit::cleanupDataAfterClonning ( )

◆ cloneAndEmit()

Error CompileUnit::cloneAndEmit ( std::optional< std::reference_wrapper< const Triple > >  TargetTriple,
TypeUnit ArtificialTypeUnit 
)

◆ cloneAndEmitDebugLocations()

Error CompileUnit::cloneAndEmitDebugLocations ( )

◆ cloneAndEmitDebugMacro()

Error CompileUnit::cloneAndEmitDebugMacro ( )

◆ cloneAndEmitLineTable()

Error CompileUnit::cloneAndEmitLineTable ( const Triple TargetTriple)

◆ cloneAndEmitRanges()

Error CompileUnit::cloneAndEmitRanges ( )

◆ cloneDIE()

std::pair< DIE *, TypeEntry * > CompileUnit::cloneDIE ( const DWARFDebugInfoEntry InputDieEntry,
TypeEntry ClonedParentTypeDIE,
uint64_t  OutOffset,
std::optional< int64_t >  FuncAddressAdjustment,
std::optional< int64_t >  VarAddressAdjustment,
BumpPtrAllocator Allocator,
TypeUnit ArtificialTypeUnit 
)

◆ cloneDieAttrExpression()

void CompileUnit::cloneDieAttrExpression ( const DWARFExpression InputExpression,
SmallVectorImpl< uint8_t > &  OutputExpression,
SectionDescriptor Section,
std::optional< int64_t >  VarAddressAdjustment,
OffsetsPtrVector PatchesOffsets 
)

◆ forEachAcceleratorRecord()

void llvm::dwarf_linker::parallel::CompileUnit::forEachAcceleratorRecord ( function_ref< void(AccelInfo &)>  Handler)
inlineoverridevirtual

Enumerates all units accelerator records.

Implements llvm::dwarf_linker::parallel::DwarfUnit.

Definition at line 575 of file DWARFLinkerCompileUnit.h.

References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::forEach().

◆ getContaingFile()

const DWARFFile & llvm::dwarf_linker::parallel::CompileUnit::getContaingFile ( ) const
inline

◆ getDebugAddrIndex()

uint64_t llvm::dwarf_linker::parallel::CompileUnit::getDebugAddrIndex ( uint64_t  Addr)
inline

Returns index(inside .debug_addr) of an address.

Definition at line 436 of file DWARFLinkerCompileUnit.h.

References Addr, and llvm::dwarf_linker::IndexedValuesMap< T >::getValueIndex().

Referenced by llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneAddressAttr().

◆ getDirAndFilenameFromLineTable() [1/2]

std::optional< std::pair< StringRef, StringRef > > CompileUnit::getDirAndFilenameFromLineTable ( const DWARFFormValue FileIdxValue)

◆ getDirAndFilenameFromLineTable() [2/2]

std::optional< std::pair< StringRef, StringRef > > CompileUnit::getDirAndFilenameFromLineTable ( uint64_t  FileIdx)

◆ getFileName()

StringEntry * CompileUnit::getFileName ( unsigned  FileIdx,
StringPool GlobalStrings 
)

◆ getFunctionRanges()

const RangesTy & llvm::dwarf_linker::parallel::CompileUnit::getFunctionRanges ( ) const
inline

Returns function ranges of this unit.

Definition at line 401 of file DWARFLinkerCompileUnit.h.

Referenced by cloneAndEmitLineTable(), and cloneAndEmitRanges().

◆ getHighPc()

uint64_t llvm::dwarf_linker::parallel::CompileUnit::getHighPc ( ) const
inline

◆ getLowPc()

std::optional< uint64_t > llvm::dwarf_linker::parallel::CompileUnit::getLowPc ( ) const
inline

◆ getStage()

Stage llvm::dwarf_linker::parallel::CompileUnit::getStage ( ) const
inline

Returns stage of overall processing.

Definition at line 98 of file DWARFLinkerCompileUnit.h.

Referenced by maybeResetToLoadedStage().

◆ hasLabelAt()

bool llvm::dwarf_linker::parallel::CompileUnit::hasLabelAt ( uint64_t  Addr) const
inline

Returns true if there is a label corresponding to the specified Addr.

Definition at line 375 of file DWARFLinkerCompileUnit.h.

References Addr, and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count().

◆ loadInputDIEs()

bool CompileUnit::loadInputDIEs ( )

Load DIEs of input compilation unit.

Returns
true if input DIEs successfully loaded.

Definition at line 114 of file DWARFLinkerCompileUnit.cpp.

References getOrigUnit(), getUnitDIE(), and llvm::SmallVectorImpl< T >::resize().

◆ loadLineTable()

void CompileUnit::loadLineTable ( )

Loads unit line table.

Definition at line 71 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf_linker::DWARFFile::Dwarf, and getOrigUnit().

◆ maybeResetToLoadedStage()

void CompileUnit::maybeResetToLoadedStage ( )

◆ resolveDependenciesAndMarkLiveness()

bool CompileUnit::resolveDependenciesAndMarkLiveness ( bool  InterCUProcessingStarted,
std::atomic< bool > &  HasNewInterconnectedCUs 
)

Search for subprograms and variables referencing live code and discover dependend DIEs.

Mark live DIEs, set placement for DIEs.

Definition at line 1832 of file DWARFLinkerCompileUnit.cpp.

◆ resolveDIEReference() [1/2]

std::optional< UnitEntryPairTy > CompileUnit::resolveDIEReference ( const DWARFDebugInfoEntry DieEntry,
dwarf::Attribute  Attr,
ResolveInterCUReferencesMode  CanResolveInterCUReferences 
)

Definition at line 417 of file DWARFLinkerCompileUnit.cpp.

References find(), and resolveDIEReference().

◆ resolveDIEReference() [2/2]

std::optional< UnitEntryPairTy > CompileUnit::resolveDIEReference ( const DWARFFormValue RefValue,
ResolveInterCUReferencesMode  CanResolveInterCUReferences 
)

Resolve the DIE attribute reference that has been extracted in RefValue.

The resulting DIE might be in another CompileUnit.

Returns
referenced die and corresponding compilation unit. compilation unit is null if reference could not be resolved.

Definition at line 379 of file DWARFLinkerCompileUnit.cpp.

References Cloned, llvm::DWARFFormValue::getAsRelativeReference(), llvm::DWARFUnit::getDebugInfoEntry(), getDebugInfoEntry(), getDIEIndexForOffset(), llvm::DWARFUnit::getOffset(), and llvm::Ref.

Referenced by llvm::dwarf_linker::parallel::SyntheticTypeNameBuilder::addReferencedODRDies(), llvm::dwarf_linker::parallel::DIEAttributeCloner::cloneDieRefAttr(), llvm::dwarf_linker::parallel::UnitEntryPairTy::getNamespaceOrigin(), and resolveDIEReference().

◆ saveAcceleratorInfo()

void llvm::dwarf_linker::parallel::CompileUnit::saveAcceleratorInfo ( const DwarfUnit::AccelInfo Info)
inline

◆ setStage()

void llvm::dwarf_linker::parallel::CompileUnit::setStage ( Stage  Stage)
inline

Set stage of overall processing.

Definition at line 101 of file DWARFLinkerCompileUnit.h.

Referenced by maybeResetToLoadedStage().

◆ updateDependenciesCompleteness()

bool CompileUnit::updateDependenciesCompleteness ( )

Check dependend DIEs for incompatible placement.

Make placement to be consistent.

Definition at line 1841 of file DWARFLinkerCompileUnit.cpp.

References assert().

◆ updateDieRefPatchesWithClonedOffsets()

void CompileUnit::updateDieRefPatchesWithClonedOffsets ( )

After cloning stage the output DIEs offsets are deallocated.

This method copies output offsets for referenced DIEs into DIEs patches.

Replace stored DIE indexes with DIE output offsets.

Replace stored DIE indexes with DIE output offsets.

Replace stored DIE indexes with DIE output offsets.

Replace stored DIE indexes with DIE output offsets.

Definition at line 332 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf_linker::DebugInfo, llvm::dwarf_linker::DebugLoc, llvm::dwarf_linker::DebugLocLists, getDieOutOffset(), llvm::dwarf_linker::parallel::DebugDieRefPatch::RefCU, llvm::dwarf_linker::parallel::DebugULEB128DieRefPatch::RefCU, llvm::dwarf_linker::parallel::DebugDieRefPatch::RefDieIdxOrClonedOffset, llvm::dwarf_linker::parallel::DebugULEB128DieRefPatch::RefDieIdxOrClonedOffset, and llvm::dwarf_linker::parallel::OutputSections::tryGetSectionDescriptor().

◆ verifyDependencies()

void CompileUnit::verifyDependencies ( )

Check DIEs to have a consistent marking(keep marking, placement marking).

Definition at line 1847 of file DWARFLinkerCompileUnit.cpp.

References assert().


The documentation for this class was generated from the following files: