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

This class discovers DIEs dependencies: marks "live" DIEs, marks DIE locations (whether DIE should be cloned as regular DIE or it should be put into the artificial type unit). More...

#include "[DWARFLinker/Parallel/DependencyTracker.h](DependencyTracker%5F8h%5Fsource.html)"

Public Member Functions
DependencyTracker (CompileUnit &CU)
bool resolveDependenciesAndMarkLiveness (bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Recursively walk the DIE tree and look for DIEs to keep.
bool updateDependenciesCompleteness ()
Check if dependencies have incompatible placement.
void verifyKeepChain ()
Recursively walk the DIE tree and check "keepness" and "placement" information.
Protected Member Functions
bool isLiveAction (LiveRootWorklistActionTy Action)
bool isTypeAction (LiveRootWorklistActionTy Action)
bool isChildrenAction (LiveRootWorklistActionTy Action)
void collectRootsToKeep (const UnitEntryPairTy &Entry, std::optional< UnitEntryPairTy > ReferencedBy, bool IsLiveParent)
This function navigates DIEs tree starting from specified Entry.
bool markCollectedLiveRootsAsKept (bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Examine worklist and mark all 'root DIE's as kept and set "Placement" property.
bool markDIEEntryAsKeptRec (LiveRootWorklistActionTy Action, const UnitEntryPairTy &RootEntry, const UnitEntryPairTy &Entry, bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Mark whole DIE tree as kept recursively.
void markParentsAsKeepingChildren (const UnitEntryPairTy &Entry)
Mark parents as keeping children.
void setPlainDwarfPlacementRec (const UnitEntryPairTy &Entry)
Mark whole DIE tree as placed in "PlainDwarf".
bool maybeAddReferencedRoots (LiveRootWorklistActionTy Action, const UnitEntryPairTy &RootEntry, const UnitEntryPairTy &Entry, bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Check referenced DIEs and add them into the worklist.
bool isTypeTableCandidate (const DWARFDebugInfoEntry *DIEEntry)
UnitEntryPairTy getRootForSpecifiedEntry (UnitEntryPairTy Entry)
void addActionToRootEntriesWorkList (LiveRootWorklistActionTy Action, const UnitEntryPairTy &Entry, std::optional< UnitEntryPairTy > ReferencedBy)
Add action item to the work list.
Protected Attributes
CompileUnit & CU
RootEntriesListTy RootEntriesWorkList
List of entries which are 'root DIE's.
RootEntriesListTy Dependencies
List of entries dependencies.

This class discovers DIEs dependencies: marks "live" DIEs, marks DIE locations (whether DIE should be cloned as regular DIE or it should be put into the artificial type unit).

Definition at line 26 of file DependencyTracker.h.

RootEntriesListTy

LiveRootWorklistActionTy

Enumerator
MarkSingleLiveEntry Mark current item as live entry.
MarkSingleTypeEntry Mark current item as type entry.
MarkLiveEntryRec Mark current item and all its children as live entry.
MarkTypeEntryRec Mark current item and all its children as type entry.
MarkLiveChildrenRec Mark all children of current item as live entry.
MarkTypeChildrenRec Mark all children of current item as type entry.

Definition at line 60 of file DependencyTracker.h.

llvm::dwarf_linker::parallel::DependencyTracker::DependencyTracker ( CompileUnit & CU) inline

addActionToRootEntriesWorkList()

collectRootsToKeep()

This function navigates DIEs tree starting from specified Entry.

It puts found 'root DIE' into the worklist. The CollectLiveEntries instructs to collect either live roots(like subprograms having live DW_AT_low_pc) or otherwise roots which is not live(they need to be collected if they are imported f.e. by DW_TAG_imported_module).

Definition at line 134 of file DependencyTracker.cpp.

References addActionToRootEntriesWorkList(), collectRootsToKeep(), llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), isLiveSubprogramEntry(), isLiveVariableEntry(), llvm_unreachable, MarkLiveEntryRec, MarkSingleLiveEntry, MarkSingleTypeEntry, and MarkTypeEntryRec.

Referenced by collectRootsToKeep(), and resolveDependenciesAndMarkLiveness().

getRootForSpecifiedEntry()

isChildrenAction()

bool llvm::dwarf_linker::parallel::DependencyTracker::isChildrenAction ( LiveRootWorklistActionTy Action) inlineprotected

Returns

true if the specified action affects only Root entry itself and does not affect it`s children. bool isSingleAction(LiveRootWorklistActionTy Action) { switch (Action) { default: return false;

case LiveRootWorklistActionTy::MarkSingleLiveEntry: case LiveRootWorklistActionTy::MarkSingleTypeEntry: return true; } }

/

Returns

true if the specified action affects only Root entry / itself and does not affect it`s children.

Definition at line 121 of file DependencyTracker.h.

References MarkLiveChildrenRec, and MarkTypeChildrenRec.

Referenced by markDIEEntryAsKeptRec().

isLiveAction()

bool llvm::dwarf_linker::parallel::DependencyTracker::isLiveAction ( LiveRootWorklistActionTy Action) inlineprotected

isLiveSubprogramEntry()

isLiveVariableEntry()

isTypeAction()

bool llvm::dwarf_linker::parallel::DependencyTracker::isTypeAction ( LiveRootWorklistActionTy Action) inlineprotected

isTypeTableCandidate()

markCollectedLiveRootsAsKept()

bool DependencyTracker::markCollectedLiveRootsAsKept ( bool InterCUProcessingStarted, std::atomic< bool > & HasNewInterconnectedCUs ) protected

markDIEEntryAsKeptRec()

Mark whole DIE tree as kept recursively.

Definition at line 428 of file DependencyTracker.cpp.

References assert(), llvm::dwarf_linker::parallel::UnitEntryPairTy::DieEntry, llvm::DWARFDebugInfoEntry::getAbbreviationDeclarationPtr(), getFinalPlacementForEntry(), llvm::DWARFDebugInfoEntry::getTag(), isAlreadyMarked(), isChildrenAction(), isLiveAction(), isTypeAction(), isTypeTableCandidate(), markDIEEntryAsKeptRec(), markParentsAsKeepingChildren(), maybeAddReferencedRoots(), Placement, llvm::dwarf_linker::parallel::CompileUnit::PlainDwarf, and llvm::dwarf_linker::parallel::CompileUnit::TypeTable.

Referenced by markCollectedLiveRootsAsKept(), and markDIEEntryAsKeptRec().

markParentsAsKeepingChildren()

maybeAddReferencedRoots()

Check referenced DIEs and add them into the worklist.

Definition at line 612 of file DependencyTracker.cpp.

References addActionToRootEntriesWorkList(), assert(), llvm::dwarf_linker::parallel::AvoidResolving, llvm::Data, llvm::DWARFFormValue::extractValue(), llvm::DWARFFormValue::FC_Reference, llvm::dwarf_linker::parallel::getODRAttributes(), getRootForSpecifiedEntry(), llvm::getULEB128Size(), llvm::is_contained(), llvm::DWARFFormValue::isFormClass(), isLiveAction(), isNamespaceLikeEntry(), isTypeAction(), MarkLiveEntryRec, MarkSingleLiveEntry, MarkSingleTypeEntry, MarkTypeEntryRec, llvm::Offset, llvm::dwarf_linker::parallel::Resolve, and llvm::DWARFFormValue::skipValue().

Referenced by markDIEEntryAsKeptRec().

resolveDependenciesAndMarkLiveness()

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

setPlainDwarfPlacementRec()

updateDependenciesCompleteness()

bool DependencyTracker::updateDependenciesCompleteness ( )

verifyKeepChain()

void DependencyTracker::verifyKeepChain ( )

Recursively walk the [DIE](classllvm%5F1%5F1DIE.html "A structured debug information entry.") tree and check "keepness" and "placement" information.

Verify the keep chain by looking for DIEs that are kept but who's parent isn't.

It is an error if parent node does not have "keep" flag, while child has one. It is an error if parent node has "TypeTable" placement while child has "PlainDwarf" placement. This function dump error at stderr in that case.

Definition at line 28 of file DependencyTracker.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::DWARFDie::children(), llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::WithColor::error(), llvm::errs(), llvm::formatv(), llvm::DWARFDie::getDebugInfoEntry(), isLiveSubprogramEntry(), llvm::DWARFDie::isValid(), llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::needToKeepInPlainDwarf(), llvm::dwarf_linker::parallel::CompileUnit::DIEInfo::needToPlaceInTypeTable(), llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), and llvm::reverse().

CU

CompileUnit& llvm::dwarf_linker::parallel::DependencyTracker::CU protected

Dependencies

RootEntriesListTy llvm::dwarf_linker::parallel::DependencyTracker::Dependencies protected

RootEntriesWorkList

RootEntriesListTy llvm::dwarf_linker::parallel::DependencyTracker::RootEntriesWorkList protected

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