@@ -135,7 +135,7 @@ class DependencyTracker {
135
135
LiveRootWorklistItemTy (const LiveRootWorklistItemTy &) = default ;
136
136
LiveRootWorklistItemTy (LiveRootWorklistActionTy Action,
137
137
UnitEntryPairTy RootEntry) {
138
- RootCU.setInt (static_cast < uint8_t >( Action) );
138
+ RootCU.setInt (Action);
139
139
RootCU.setPointer (RootEntry.CU );
140
140
141
141
RootDieEntry = RootEntry.DieEntry ;
@@ -144,7 +144,7 @@ class DependencyTracker {
144
144
UnitEntryPairTy RootEntry,
145
145
UnitEntryPairTy ReferencedBy) {
146
146
RootCU.setPointer (RootEntry.CU );
147
- RootCU.setInt (static_cast < uint8_t >( Action) );
147
+ RootCU.setInt (Action);
148
148
RootDieEntry = RootEntry.DieEntry ;
149
149
150
150
ReferencedByCU = ReferencedBy.CU ;
@@ -175,7 +175,22 @@ class DependencyTracker {
175
175
// / Root entry.
176
176
// / ASSUMPTION: 3 bits are used to store LiveRootWorklistActionTy value.
177
177
// / Thus LiveRootWorklistActionTy should have no more eight elements.
178
- PointerIntPair<CompileUnit *, 3 > RootCU;
178
+
179
+ // / Pointer traits for CompileUnit.
180
+ struct CompileUnitPointerTraits {
181
+ static inline void *getAsVoidPointer (CompileUnit *P) { return P; }
182
+ static inline CompileUnit *getFromVoidPointer (void *P) {
183
+ return (CompileUnit *)P;
184
+ }
185
+ static constexpr int NumLowBitsAvailable = 3 ;
186
+ static_assert (
187
+ alignof (CompileUnit) >= (1 << NumLowBitsAvailable),
188
+ "CompileUnit insufficiently aligned to have enough low bits.");
189
+ };
190
+
191
+ PointerIntPair<CompileUnit *, 3 , LiveRootWorklistActionTy,
192
+ CompileUnitPointerTraits>
193
+ RootCU;
179
194
const DWARFDebugInfoEntry *RootDieEntry = nullptr ;
180
195
181
196
// / Another root entry which references this RootDieEntry.
0 commit comments