9#ifndef LLVM_LIB_DWARFLINKER_PARALLEL_DEPENDENCYTRACKER_H
10#define LLVM_LIB_DWARFLINKER_PARALLEL_DEPENDENCYTRACKER_H
42 bool InterCUProcessingStarted,
43 std::atomic<bool> &HasNewInterconnectedCUs);
201 "CompileUnit insufficiently aligned to have enough low bits.");
233 std::optional<UnitEntryPairTy> ReferencedBy,
246 std::atomic<bool> &HasNewInterconnectedCUs);
255 bool InterCUProcessingStarted,
256 std::atomic<bool> &HasNewInterconnectedCUs,
257 bool RecordDepsOnly =
false);
276 bool InterCUProcessingStarted,
277 std::atomic<bool> &HasNewInterconnectedCUs,
278 bool RecordDepsOnly =
false);
290 std::optional<UnitEntryPairTy> ReferencedBy,
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the PointerIntPair class.
This file defines the SmallVector class.
A pointer to another debug information entry.
DWARFDebugInfoEntry - A DIE with only the minimum required data.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
PointerIntPair - This class implements a pair of a pointer and small integer.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Stores all information related to a compile unit, be it in its original instance of the object file o...
DieOutputPlacement
Kinds of placement for the output die.
UnitEntryPairTy getReferencedByEntry() const
LiveRootWorklistItemTy(const LiveRootWorklistItemTy &)=default
LiveRootWorklistItemTy(LiveRootWorklistActionTy Action, UnitEntryPairTy RootEntry, UnitEntryPairTy ReferencedBy, const DWARFDebugInfoEntry *ReferencedTypeDieEntry=nullptr)
LiveRootWorklistItemTy()=default
LiveRootWorklistItemTy(LiveRootWorklistActionTy Action, UnitEntryPairTy RootEntry)
PointerIntPair< CompileUnit *, 3, LiveRootWorklistActionTy, CompileUnitPointerTraits > RootCU
UnitEntryPairTy getRootEntry() const
const DWARFDebugInfoEntry * getReferencedTypeDieEntry() const
const DWARFDebugInfoEntry * ReferencedByDieEntry
const DWARFDebugInfoEntry * ReferencedTypeDieEntry
The DIE actually referenced by ReferencedByDieEntry.
CompileUnit * ReferencedByCU
Another root entry which references this RootDieEntry.
const DWARFDebugInfoEntry * RootDieEntry
LiveRootWorklistActionTy getAction() const
CompileUnit::DieOutputPlacement getPlacement() const
bool hasReferencedByOtherEntry() const
bool markDIEEntryAsKeptRec(LiveRootWorklistActionTy Action, const UnitEntryPairTy &RootEntry, const UnitEntryPairTy &Entry, bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs, bool RecordDepsOnly=false)
Mark whole DIE tree as kept recursively.
void verifyKeepChain()
Recursively walk the DIE tree and check "keepness" and "placement" information.
RootEntriesListTy Dependencies
List of entries dependencies.
void markParentsAsKeepingChildren(const UnitEntryPairTy &Entry)
Mark parents as keeping children.
UnitEntryPairTy getRootForSpecifiedEntry(UnitEntryPairTy Entry)
bool markCollectedLiveRootsAsKept(bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Examine worklist and mark all 'root DIE's as kept and set "Placement" property.
bool isLiveAction(LiveRootWorklistActionTy Action)
bool isChildrenAction(LiveRootWorklistActionTy Action)
bool isTypeAction(LiveRootWorklistActionTy Action)
void addActionToRootEntriesWorkList(LiveRootWorklistActionTy Action, const UnitEntryPairTy &Entry, std::optional< UnitEntryPairTy > ReferencedBy, const DWARFDebugInfoEntry *ReferencedTypeDieEntry=nullptr)
Add action item to the work list.
bool isTypeTableCandidate(const DWARFDebugInfoEntry *DIEEntry)
DependencyTracker(CompileUnit &CU)
SmallVector< LiveRootWorklistItemTy > RootEntriesListTy
void setPlainDwarfPlacementRec(const UnitEntryPairTy &Entry)
Mark whole DIE tree as placed in "PlainDwarf".
RootEntriesListTy RootEntriesWorkList
List of entries which are 'root DIE's.
static bool isLiveSubprogramEntry(const UnitEntryPairTy &Entry)
Returns true if specified subprogram references live code section.
bool resolveDependenciesAndMarkLiveness(bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)
Recursively walk the DIE tree and look for DIEs to keep.
static bool isLiveVariableEntry(const UnitEntryPairTy &Entry, bool IsLiveParent)
Returns true if specified variable references live code section.
@ MarkSingleTypeEntry
Mark current item as type entry.
@ MarkSingleLiveEntry
Mark current item as live entry.
@ MarkTypeEntryRec
Mark current item and all its children as type entry.
@ MarkLiveChildrenRec
Mark all children of current item as live entry.
@ MarkLiveEntryRec
Mark current item and all its children as live entry.
@ MarkTypeChildrenRec
Mark all children of current item as type entry.
bool maybeAddReferencedRoots(LiveRootWorklistActionTy Action, const UnitEntryPairTy &RootEntry, const UnitEntryPairTy &Entry, bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs, bool RecordDepsOnly=false)
Check referenced DIEs and add them into the worklist.
void collectRootsToKeep(const UnitEntryPairTy &Entry, std::optional< UnitEntryPairTy > ReferencedBy, bool IsLiveParent)
This function navigates DIEs tree starting from specified Entry.
bool updateDependenciesCompleteness()
Check if dependencies have incompatible placement.
This is an optimization pass for GlobalISel generic memory operations.
static void * getAsVoidPointer(CompileUnit *P)
static constexpr int NumLowBitsAvailable
static CompileUnit * getFromVoidPointer(void *P)
This is a helper structure which keeps a debug info entry with it's containing compilation unit.
const DWARFDebugInfoEntry * DieEntry