LLVM: lib/DWARFLinker/Parallel/DependencyTracker.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_LIB_DWARFLINKER_PARALLEL_DEPENDENCYTRACKER_H

10#define LLVM_LIB_DWARFLINKER_PARALLEL_DEPENDENCYTRACKER_H

11

15

16namespace llvm {

19

22

23

24

25

27public:

29

30

31

32

33

34

35

36

37

38

39

40

42 bool InterCUProcessingStarted,

43 std::atomic &HasNewInterconnectedCUs);

44

45

46

47

48

49

51

52

53

54

55

56

58

59protected:

61

63

64

66

67

69

70

72

73

75

76

78 };

79

80

82 switch (Action) {

83 default:

84 return false;

85

89 return true;

90 }

91 }

92

93

95 switch (Action) {

96 default:

97 return false;

98

102 return true;

103 }

104 }

105

106

107

109 switch (Action) {

110 default:

111 return false;

112

115 return true;

116 }

117 }

118

119

120

122 switch (Action) {

123 default:

124 return false;

125

128 return true;

129 }

130 }

131

132

134 public:

139 RootCU.setInt(Action);

140 RootCU.setPointer(RootEntry.CU);

141

143 }

147 RootCU.setPointer(RootEntry.CU);

148 RootCU.setInt(Action);

150

153 }

154

158

162

164

170

174

175 protected:

176

177

178

179

180

187 static_assert(

189 "CompileUnit insufficiently aligned to have enough low bits.");

190 };

191

196

197

198

199

200

203 };

204

206

207

208

209

210

211

213 std::optional ReferencedBy,

214 bool IsLiveParent);

215

216

218 bool IsLiveParent);

219

220

222

223

224

226 std::atomic &HasNewInterconnectedCUs);

227

228

232 bool InterCUProcessingStarted,

233 std::atomic &HasNewInterconnectedCUs);

234

235

237

238

240

241

245 bool InterCUProcessingStarted,

246 std::atomic &HasNewInterconnectedCUs);

247

248

249

251

252

254

255

256 void

259 std::optional ReferencedBy);

260

262

263

265

266

268};

269

270}

271}

272}

273

274#endif

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

Definition DependencyTracker.h:165

LiveRootWorklistItemTy(const LiveRootWorklistItemTy &)=default

LiveRootWorklistItemTy()=default

LiveRootWorklistItemTy(LiveRootWorklistActionTy Action, UnitEntryPairTy RootEntry)

Definition DependencyTracker.h:137

PointerIntPair< CompileUnit *, 3, LiveRootWorklistActionTy, CompileUnitPointerTraits > RootCU

Definition DependencyTracker.h:194

UnitEntryPairTy getRootEntry() const

Definition DependencyTracker.h:155

const DWARFDebugInfoEntry * ReferencedByDieEntry

Definition DependencyTracker.h:202

LiveRootWorklistItemTy(LiveRootWorklistActionTy Action, UnitEntryPairTy RootEntry, UnitEntryPairTy ReferencedBy)

Definition DependencyTracker.h:144

CompileUnit * ReferencedByCU

Another root entry which references this RootDieEntry.

Definition DependencyTracker.h:201

const DWARFDebugInfoEntry * RootDieEntry

Definition DependencyTracker.h:195

LiveRootWorklistActionTy getAction() const

Definition DependencyTracker.h:171

CompileUnit::DieOutputPlacement getPlacement() const

Definition DependencyTracker.h:159

bool hasReferencedByOtherEntry() const

Definition DependencyTracker.h:163

void verifyKeepChain()

Recursively walk the DIE tree and check "keepness" and "placement" information.

RootEntriesListTy Dependencies

List of entries dependencies.

Definition DependencyTracker.h:267

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 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 isLiveAction(LiveRootWorklistActionTy Action)

Definition DependencyTracker.h:81

bool isChildrenAction(LiveRootWorklistActionTy Action)

Definition DependencyTracker.h:121

bool isTypeAction(LiveRootWorklistActionTy Action)

Definition DependencyTracker.h:94

bool markDIEEntryAsKeptRec(LiveRootWorklistActionTy Action, const UnitEntryPairTy &RootEntry, const UnitEntryPairTy &Entry, bool InterCUProcessingStarted, std::atomic< bool > &HasNewInterconnectedCUs)

Mark whole DIE tree as kept recursively.

bool isTypeTableCandidate(const DWARFDebugInfoEntry *DIEEntry)

DependencyTracker(CompileUnit &CU)

Definition DependencyTracker.h:28

SmallVector< LiveRootWorklistItemTy > RootEntriesListTy

Definition DependencyTracker.h:205

void setPlainDwarfPlacementRec(const UnitEntryPairTy &Entry)

Mark whole DIE tree as placed in "PlainDwarf".

RootEntriesListTy RootEntriesWorkList

List of entries which are 'root DIE's.

Definition DependencyTracker.h:264

void addActionToRootEntriesWorkList(LiveRootWorklistActionTy Action, const UnitEntryPairTy &Entry, std::optional< UnitEntryPairTy > ReferencedBy)

Add action item to the work list.

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.

LiveRootWorklistActionTy

Definition DependencyTracker.h:60

@ MarkSingleTypeEntry

Mark current item as type entry.

Definition DependencyTracker.h:65

@ MarkSingleLiveEntry

Mark current item as live entry.

Definition DependencyTracker.h:62

@ MarkTypeEntryRec

Mark current item and all its children as type entry.

Definition DependencyTracker.h:71

@ MarkLiveChildrenRec

Mark all children of current item as live entry.

Definition DependencyTracker.h:74

@ MarkLiveEntryRec

Mark current item and all its children as live entry.

Definition DependencyTracker.h:68

@ MarkTypeChildrenRec

Mark all children of current item as type entry.

Definition DependencyTracker.h:77

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.

Root entry.

Definition DependencyTracker.h:181

static void * getAsVoidPointer(CompileUnit *P)

Definition DependencyTracker.h:182

static constexpr int NumLowBitsAvailable

Definition DependencyTracker.h:186

static CompileUnit * getFromVoidPointer(void *P)

Definition DependencyTracker.h:183

This is a helper structure which keeps a debug info entry with it's containing compilation unit.

const DWARFDebugInfoEntry * DieEntry