LLVM: llvm::dwarf_linker::parallel::CompileUnit Class Reference (original) (raw)

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](lib%5F2DWARFLinker%5F2Parallel%5F2DWARFLinkerCompileUnit%5F8h%5Fsource.html)"

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.
StringEntry * getFileName (unsigned FileIdx, StringPool &GlobalStrings)
Returns name of the file for the FileIdx from the unit`s line table.
const DWARFFile & getContaingFile () 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.
DIEInfo & getDIEInfo (unsigned Idx)
Idx index of the DIE.
const DIEInfo & getDIEInfo (unsigned Idx) const
Idx index of the DIE.
DIEInfo & getDIEInfo (const DWARFDebugInfoEntry *Entry)
Idx index of the DIE.
const DIEInfo & getDIEInfo (const DWARFDebugInfoEntry *Entry) const
Idx index of the DIE.
DIEInfo & getDIEInfo (const DWARFDie &Die)
Die
const DIEInfo & getDIEInfo (const DWARFDie &Die) const
Die
uint64_t getDieOutOffset (uint32_t Idx)
Idx index of the DIE.
TypeEntry * getDieTypeEntry (uint32_t Idx)
Idx index of the DIE.
uint64_t getDieOutOffset (const DWARFDebugInfoEntry *InputDieEntry)
InputDieEntry debug info entry.
TypeEntry * getDieTypeEntry (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_t > getLowPc () 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< UnitEntryPairTy > resolveDIEReference (const DWARFFormValue &RefValue, ResolveInterCUReferencesMode CanResolveInterCUReferences)
Resolve the DIE attribute reference that has been extracted in RefValue.
std::optional< UnitEntryPairTy > resolveDIEReference (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 RangesTy & getFunctionRanges () 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.
DWARFUnit & getOrigUnit () const
Returns paired compile unit from input DWARF.
const DWARFDebugInfoEntry * getFirstChildEntry (const DWARFDebugInfoEntry *Die) const
const DWARFDebugInfoEntry * getSiblingEntry (const DWARFDebugInfoEntry *Die) const
DWARFDie getParent (const DWARFDebugInfoEntry *Die)
DWARFDie getDIEAtIndex (unsigned Index)
const DWARFDebugInfoEntry * getDebugInfoEntry (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< DWARFFormValue > find (uint32_t DieIdx, ArrayRef< dwarf::Attribute > Attrs) const
std::optional< DWARFFormValue > find (const DWARFDebugInfoEntry *Die, ArrayRef< dwarf::Attribute > Attrs) const
std::optional< uint32_t > getDIEIndexForOffset (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 ()=default
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;.
LinkingGlobalData & getGlobalData ()
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.
DIE * getOutUnitDIE ()
Returns output unit DIE.
void setOutUnitDIE (DIE *UnitDie)
Set output unit DIE.
dwarf::Tag getTag () const
Returns unit DWARF tag.
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 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 SectionDescriptor & getSectionDescriptor (DebugSectionKind SectionKind) const
Returns descriptor for the specified section of SectionKind.
SectionDescriptor & getSectionDescriptor (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.
SectionDescriptor & getOrCreateSectionDescriptor (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::FormParams & getFormParams () const
Return size of address.
Additional Inherited Members
Protected Types inherited from llvm::dwarf_linker::parallel::DwarfUnit
using FileNamesCache
Cache for file names for this unit.
Protected Types inherited from llvm::dwarf_linker::parallel::OutputSections
using SectionsSetTy
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_t > emitPubAcceleratorEntry (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
dwarf::Tag UnitTag = dwarf::DW_TAG_null
DWARF unit tag.
std::atomic< bool > IsInterconnectedCU = {false}
true if current unit references_to/is_referenced by other unit.
FoldingSet< DIEAbbrev > AbbreviationsSet
FoldingSet that uniques the abbreviations.
std::vector< std::unique_ptr< DIEAbbrev > > Abbreviations
Storage for the unique Abbreviations.
DIE * OutUnitDIE = 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
LinkingGlobalData & GlobalData
dwarf::FormParams Format = {4, 4, dwarf::DWARF32}
Format for sections.
llvm::endianness Endianness = llvm::endianness::native
Endiannes for sections.
SectionsSetTy SectionDescriptors

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.

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.

Definition at line 27 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf_linker::parallel::DwarfUnit::ClangModuleName, CreatedNotLoaded, llvm::dwarf_linker::DebugInfo, llvm::dwarf_linker::parallel::DwarfUnit::DwarfUnit(), llvm::dwarf_linker::parallel::OutputSections::Format, llvm::dwarf_linker::parallel::OutputSections::getOrCreateSectionDescriptor(), llvm::dwarf_linker::parallel::OutputSections::GlobalData, llvm::dwarf_linker::parallel::DwarfUnit::ID, llvm::dwarf_linker::parallel::OutputSections::setOutputFormat(), and llvm::dwarf_linker::parallel::DwarfUnit::UnitName.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::getAsCompileUnit(), llvm::dwarf_linker::parallel::CompileUnit::OutputUnitVariantPtr::OutputUnitVariantPtr(), and resolveDIEReference().

CompileUnit() [2/2]

Definition at line 39 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf_linker::parallel::DwarfUnit::ClangModuleName, CreatedNotLoaded, llvm::dwarf_linker::DebugInfo, llvm::dwarf_linker::parallel::DwarfUnit::DwarfUnit(), llvm::DWARFDie::find(), llvm::dwarf_linker::parallel::OutputSections::Format, llvm::DWARFDie::getName(), llvm::dwarf_linker::parallel::OutputSections::getOrCreateSectionDescriptor(), llvm::dwarf_linker::parallel::OutputSections::GlobalData, llvm::dwarf_linker::parallel::DwarfUnit::ID, llvm::dwarf_linker::parallel::isODRLanguage(), llvm::dwarf_linker::parallel::OutputSections::setOutputFormat(), llvm::ShortName, llvm::StringRef::str(), llvm::dwarf_linker::parallel::DwarfUnit::SysRoot, llvm::dwarf::toStringRef(), llvm::dwarf::toUnsigned(), and llvm::dwarf_linker::parallel::DwarfUnit::UnitName.

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

analyzeImportedModule()

Collect references to parseable Swift interfaces in imported DW_TAG_module blocks.

Definition at line 250 of file DWARFLinkerCompileUnit.cpp.

References llvm::sys::path::append(), llvm::StringRef::empty(), find(), getDIE(), llvm::dwarf_linker::parallel::DwarfUnit::getSysRoot(), getUnitDIE(), llvm::dwarf_linker::parallel::OutputSections::GlobalData, llvm::dwarf_linker::guessDeveloperDir(), llvm::sys::path::is_relative(), llvm::dwarf_linker::isInToolchainDir(), llvm::dwarf_linker::parallel::DwarfUnit::Name, llvm::dwarf_linker::parallel::DwarfUnit::SysRoot, llvm::dwarf::toString(), llvm::dwarf::toStringRef(), and warn().

assignTypeNames()

cleanupDataAfterClonning()

void CompileUnit::cleanupDataAfterClonning ( )

cloneAndEmit()

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

Clone and emit this compilation unit.

Definition at line 1228 of file DWARFLinkerCompileUnit.cpp.

References cloneAndEmitDebugLocations(), cloneAndEmitDebugMacro(), cloneAndEmitLineTable(), cloneAndEmitRanges(), cloneDIE(), llvm::dwarf_linker::DebugInfo, llvm::dwarf_linker::parallel::DwarfUnit::emitAbbreviations(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugInfo(), llvm::dwarf_linker::parallel::DwarfUnit::emitDebugStringOffsetSection(), llvm::dwarf_linker::parallel::DwarfUnit::emitPubAccelerators(), llvm::DWARFDie::getDebugInfoEntry(), llvm::dwarf_linker::parallel::OutputSections::getDebugInfoHeaderSize(), llvm::dwarf_linker::parallel::OutputSections::getOrCreateSectionDescriptor(), getOrigUnit(), llvm::dwarf_linker::parallel::TypePool::getRoot(), llvm::dwarf_linker::parallel::TypeUnit::getTypePool(), llvm::DWARFUnit::getUnitDIE(), llvm::dwarf_linker::parallel::OutputSections::GlobalData, llvm::is_contained(), llvm::DWARFDie::isValid(), llvm::dwarf_linker::DWARFLinkerBase::Pub, llvm::dwarf_linker::parallel::DwarfUnit::setOutUnitDIE(), and llvm::Error::success().

cloneAndEmitDebugLocations()

Error CompileUnit::cloneAndEmitDebugLocations ( )

cloneAndEmitDebugMacro()

Error CompileUnit::cloneAndEmitDebugMacro ( )

cloneAndEmitLineTable()

Definition at line 1513 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf::FormParams::AddrSize, llvm::dwarf_linker::DWARFFile::Dwarf, llvm::dwarf_linker::parallel::DwarfUnit::emitDebugLine(), find(), llvm::DWARFDebugLine::Prologue::FormParams, getContaingFile(), llvm::dwarf_linker::parallel::OutputSections::getFormParams(), getFunctionRanges(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), getOrigUnit(), getUnitDIE(), llvm::DWARFDebugLine::LineTable::Prologue, llvm::DWARFDebugLine::LineTable::Rows, llvm::DWARFDebugLine::LineTable::Sequences, llvm::Error::success(), and warn().

Referenced by cloneAndEmit().

cloneAndEmitRanges()

Error CompileUnit::cloneAndEmitRanges ( )

cloneDIE()

Definition at line 1284 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf_linker::parallel::DIEGenerator::addChild(), assert(), cloneDIE(), llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), getDIEIndex(), getDIEInfo(), getFirstChildEntry(), getSiblingEntry(), llvm::DWARFDebugInfoEntry::getTag(), llvm::dwarf_linker::parallel::TypePool::getThreadLocalAllocator(), and llvm::dwarf_linker::parallel::TypeUnit::getTypePool().

Referenced by cloneAndEmit(), and cloneDIE().

cloneDieAttrExpression()

Clone attribute location axpression.

Definition at line 1090 of file DWARFLinkerCompileUnit.cpp.

References llvm::SmallVectorImpl< T >::append(), assert(), llvm::ArrayRef< T >::begin(), llvm::StringRef::begin(), llvm::encodeULEB128(), llvm::ArrayRef< T >::end(), llvm::StringRef::end(), llvm::formatv(), llvm::DWARFExpression::getData(), llvm::dwarf::FormParams::getDwarfOffsetByteSize(), llvm::dwarf_linker::parallel::OutputSections::getEndianness(), llvm::dwarf_linker::parallel::OutputSections::getFormParams(), llvm::dwarf_linker::parallel::DwarfUnit::getGlobalData(), getOrigUnit(), llvm::native, llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::StringRef::slice(), llvm::sys::swapByteOrder(), and warn().

forEachAcceleratorRecord()

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

getContaingFile()

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

getDebugAddrIndex()

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

getDirAndFilenameFromLineTable() [1/2]

getDirAndFilenameFromLineTable() [2/2]

Returns directory and file from the line table by index.

Definition at line 1685 of file DWARFLinkerCompileUnit.cpp.

References llvm::sys::path::append(), llvm::StringRef::empty(), llvm::dwarf_linker::parallel::DwarfUnit::FileNames, llvm::DWARFUnit::getCompilationDir(), getOrigUnit(), llvm::dwarf_linker::parallel::OutputSections::getVersion(), llvm::dwarf_linker::isPathAbsoluteOnWindowsOrPosix(), llvm::dwarf_linker::parallel::DwarfUnit::Name, llvm::sys::path::native, llvm::Expected< T >::takeError(), and warn().

getFileName()

Returns name of the file for the FileIdx from the unit`s line table.

Definition at line 185 of file DWARFLinkerCompileUnit.cpp.

References llvm::DILineInfoSpecifier::AbsoluteFilePath, llvm::sys::path::append(), assert(), llvm::sys::path::filename(), getOrigUnit(), llvm::ConcurrentHashTableByPtr< KeyTy, KeyDataTy, AllocatorTy, Info >::insert(), llvm::sys::path::parent_path(), and llvm::sys::fs::real_path().

getFunctionRanges()

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

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

hasLabelAt()

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

loadInputDIEs()

bool CompileUnit::loadInputDIEs ( )

loadLineTable()

void CompileUnit::loadLineTable ( )

maybeResetToLoadedStage()

void CompileUnit::maybeResetToLoadedStage ( )

Reset compile units data(results of liveness analysis, clonning) if current stage greater than Stage::Loaded.

We need to reset data as we are going to repeat stages.

Definition at line 74 of file DWARFLinkerCompileUnit.cpp.

References llvm::dwarf_linker::parallel::DwarfUnit::Abbreviations, llvm::dwarf_linker::parallel::DwarfUnit::AbbreviationsSet, Cloned, CreatedNotLoaded, llvm::dwarf_linker::parallel::OutputSections::eraseSections(), llvm::fill(), getStage(), Loaded, llvm::dwarf_linker::parallel::DwarfUnit::OutUnitDIE, and setStage().

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 1828 of file DWARFLinkerCompileUnit.cpp.

resolveDIEReference() [1/2]

resolveDIEReference() [2/2]

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 378 of file DWARFLinkerCompileUnit.cpp.

References Cloned, CompileUnit(), llvm::DWARFFormValue::getAsDebugInfoReference(), llvm::DWARFFormValue::getAsRelativeReference(), getDebugInfoEntry(), getDIEIndexForOffset(), llvm::DWARFUnit::getOffset(), getStage(), llvm::DWARFFormValue::getUnit(), and llvm::Offset.

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

saveAcceleratorInfo()

setStage()

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

updateDependenciesCompleteness()

bool CompileUnit::updateDependenciesCompleteness ( )

updateDieRefPatchesWithClonedOffsets()

void CompileUnit::updateDieRefPatchesWithClonedOffsets ( )

verifyDependencies()

void CompileUnit::verifyDependencies ( )

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